Skip to content
Snippets Groups Projects
Commit b48eab0f authored by Steve Williams's avatar Steve Williams
Browse files

Added some code to Normalize to make it compatible with ISIS and added some...

Added some code to Normalize to make it compatible with ISIS and added some ISIS compatibility comments re #1421
parent 56ac4837
No related branches found
No related tags found
No related merge requests found
...@@ -14,6 +14,8 @@ __version__ = '0.0' ...@@ -14,6 +14,8 @@ __version__ = '0.0'
class SANSReducer(Reducer): class SANSReducer(Reducer):
""" """
SANS-specific implementation of the Reducer SANS-specific implementation of the Reducer
#TODO: ISIS can't deal with the solidAngle() and WeightedAzimuthalAverage steps, can we make them optional and remove references to them from this file?
#TODO: _dark_current_subtracter isn't a spallation source concept, I don't think
""" """
## Normalization options ## Normalization options
#TODO: those also correspond to the timer and monitor spectra -> store this in instr conf instead #TODO: those also correspond to the timer and monitor spectra -> store this in instr conf instead
......
...@@ -12,7 +12,9 @@ from mantidsimple import * ...@@ -12,7 +12,9 @@ from mantidsimple import *
class BaseBeamFinder(ReductionStep): class BaseBeamFinder(ReductionStep):
""" """
Base beam finder. Holds the position of the beam center Base beam finder. Holds the position of the beam center
as well as the algorithm for finding it. and the algorithm for calculates it using the beam's
displacement under gravity
TODO: Maintain HFIR-ISIS compatibility
""" """
def __init__(self, beam_center_x=0.0, beam_center_y=0.0): def __init__(self, beam_center_x=0.0, beam_center_y=0.0):
super(BaseBeamFinder, self).__init__() super(BaseBeamFinder, self).__init__()
...@@ -85,6 +87,7 @@ class BaseTransmission(ReductionStep): ...@@ -85,6 +87,7 @@ class BaseTransmission(ReductionStep):
""" """
Base transmission. Holds the transmission value Base transmission. Holds the transmission value
as well as the algorithm for calculating it. as well as the algorithm for calculating it.
TODO: ISIS doesn't use ApplyTransmissionCorrection, perhaps it's in Q1D, can we remove it from here?
""" """
def __init__(self, trans=0.0, error=0.0): def __init__(self, trans=0.0, error=0.0):
super(BaseTransmission, self).__init__() super(BaseTransmission, self).__init__()
...@@ -348,11 +351,19 @@ class LoadRun(ReductionStep): ...@@ -348,11 +351,19 @@ class LoadRun(ReductionStep):
class Normalize(ReductionStep): class Normalize(ReductionStep):
""" """
Normalize the data to time or monitor Normalize the data to
time ???is this implemented??
or a spectrum, typically a monitor, with in the workspace.
By default the normalization is done with respect to the Instrument's
incident monitor
TODO: Maintain HFIR-ISIS compatibility
""" """
def __init__(self, normalization_spectrum=0): def __init__(self, normalization_spectrum=-1):
super(Normalize, self).__init__() super(Normalize, self).__init__()
self._normalization_spectrum = normalization_spectrum if normalization_spectrum == -1:
self._normalization_spectrum = reducer.instrument.get_incident_mon()
else:
self._normalization_spectrum = normalization_spectrum
def get_normalization_spectrum(self): def get_normalization_spectrum(self):
return self._normalization_spectrum return self._normalization_spectrum
...@@ -366,6 +377,8 @@ class Normalize(ReductionStep): ...@@ -366,6 +377,8 @@ class Normalize(ReductionStep):
Divide(workspace, norm_ws, workspace) Divide(workspace, norm_ws, workspace)
mtd.deleteWorkspace(norm_ws)
# HFIR-specific: If we count for monitor we need to multiply by 1e8 # HFIR-specific: If we count for monitor we need to multiply by 1e8
if self._normalization_spectrum == reducer.NORMALIZATION_MONITOR: if self._normalization_spectrum == reducer.NORMALIZATION_MONITOR:
Scale(workspace, workspace, 1.0e8, 'Multiply') Scale(workspace, workspace, 1.0e8, 'Multiply')
...@@ -452,9 +465,19 @@ class SensitivityCorrection(ReductionStep): ...@@ -452,9 +465,19 @@ class SensitivityCorrection(ReductionStep):
class Mask(ReductionStep): class Mask(ReductionStep):
""" """
Apply mask to workspace Marks some spectra so that they are not included in the analysis
TODO: Maintain HFIR-ISIS compatibility
TODO: ISIS to add a xml string data member and a MaskDetectorsInShape call
""" """
def __init__(self, nx_low=0, nx_high=0, ny_low=0, ny_high=0): def __init__(self, nx_low=0, nx_high=0, ny_low=0, ny_high=0):
"""
Initalize masking and optionally define a "picture frame" outside of
which the spectra from all detectors are to be masked.
@param nx_low: number of pixels to mask on the lower-x side of the detector
@param nx_high: number of pixels to mask on the higher-x side of the detector
@param ny_low: number of pixels to mask on the lower-y side of the detector
@param ny_high: number of pixels to mask on the higher-y side of the detector
"""
super(Mask, self).__init__() super(Mask, self).__init__()
self._nx_low = nx_low self._nx_low = nx_low
self._nx_high = nx_high self._nx_high = nx_high
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment