Commit dfb82823 authored by Neil Vaytet's avatar Neil Vaytet
Browse files

moved astropy to soft dependency, and fixed wfm window finding when input...

moved astropy to soft dependency, and fixed wfm window finding when input workspace does not have bin edges as x values.
parent f17d3943
......@@ -20,7 +20,7 @@
from mantid.simpleapi import LoadAscii, LoadNexus, DeleteWorkspace, CloneWorkspace, \
Divide, ReplaceSpecialValues
from mantid.simpleapi import mtd
from astropy.io import fits
# from astropy.io import fits
import numpy as np
import math
import os
......@@ -96,6 +96,7 @@ def normalize(sample_workspace, reference_workspace, normalized_workspace_name,
def save_fits_stack(base_path, base_image_name, workspace, pixels=None):
from astropy.io import fits
if isinstance(workspace, str):
workspace = mtd[workspace]
......
......@@ -170,7 +170,9 @@ def get_wfm_windows(workspace=None, data=None, filename=None, nwindows=6,
data = np.zeros([nz,2])
summed_x = summed.extractX()[0]
summed_y = summed.extractY()[0]
data[:,0] = 0.5*(summed_x[1:]+summed_x[:-1])
if len(summed_x) > len(summed_y):
summed_x = 0.5*(summed_x[1:]+summed_x[:-1])
data[:,0] = summed_x
data[:,1] = summed_y
DeleteWorkspace(summed)
elif filename is not None:
......
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