Commit bb5302b9 authored by Owen Arnold's avatar Owen Arnold
Browse files

attempted port

parent af5aeb5e
......@@ -29,7 +29,7 @@ which yields, if installed correctly, something like the following:
Name: wfm-stitching
Version: 0.1.0
Location: ~/virtualenvironments/v20/lib/python2.7/site-packages
Requires: pyfits
Requires: astropy
6. You are done, you should be able to import from `wfm_stitching`, i.e.
import os.path
import numpy as np
from import fits
except ImportError:
import pyfits as fits
from import fits
from mantid.simpleapi import SaveNexusProcessed, mtd
from mantid.api import AlgorithmManager as am
......@@ -28,7 +28,7 @@ with open(path.join(here, ''), encoding='utf-8') as f:
description='Tools for Wavelength Frame Multiplication stiching in Mantid',
......@@ -48,5 +48,5 @@ setup(
keywords='neutron scattering, science',
......@@ -20,8 +20,7 @@
from mantid.simpleapi import LoadAscii, LoadNexus, DeleteWorkspace, CloneWorkspace, \
Divide, ReplaceSpecialValues
from mantid.simpleapi import mtd
import pyfits
from import fits
import numpy as np
import math
import os
......@@ -115,15 +114,15 @@ def save_fits_stack(base_path, base_image_name, workspace, pixels=None):
for i in range(0, size_x):
image_2d = stack_y[:, :, i]
header = pyfits.Header([
pyfits.Card('Z_UNIT', workspace_unit, 'Unit of z-axis along stack'),
pyfits.Card('Z_VALUE', x_values[i], 'Value of z-coordinate')])
header = fits.Header([
fits.Card('Z_UNIT', workspace_unit, 'Unit of z-axis along stack'),
fits.Card('Z_VALUE', x_values[i], 'Value of z-coordinate')])
filename = '{}{}.fits'.format(
os.path.sep.join((base_path, base_image_name)),
str(i).rjust(num_digits, '0'))
pyfits.writeto(filename, image_2d, header)
fits.writeto(filename, image_2d, header)
__all__ = ['load', 'normalize', 'save_fits_stack']
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment