示例#1
0
 def PyInit(self):
     self.declareProperty(MultipleFileProperty(name="Filename", action=FileAction.OptionalLoad,
                                               extensions=[".dat"]), "Data files to load")
     condition = EnabledWhenProperty("Filename", PropertyCriterion.IsDefault)
     self.declareProperty('IPTS', Property.EMPTY_INT, "IPTS number to load from")
     self.setPropertySettings("IPTS", condition)
     self.declareProperty('Exp', Property.EMPTY_INT, "Experiment number to load from")
     self.setPropertySettings("Exp", condition)
     self.declareProperty(IntArrayProperty("ScanNumbers", []), 'Scan numbers to load')
     self.setPropertySettings("ScanNumbers", condition)
     self.declareProperty(FileProperty(name="Vanadium", defaultValue="", action=FileAction.OptionalLoad, extensions=[".dat", ".txt"]),
                          doc="Vanadium file, can be either the vanadium scan file or the reduced vcorr file. "
                          "If not provided the vcorr file adjacent to the data file will be used")
     self.declareProperty('Normalise', True, "If False vanadium normalisation will not be performed")
     self.declareProperty(IntArrayProperty("ExcludeDetectors", []),
                          doc="Detectors to exclude. If not provided the HB2A_exp???__exclude_detectors.txt adjacent "
                          "to the data file will be used if it exist")
     self.declareProperty('DefX', '',
                          "By default the def_x (x-axis) from the file will be used, it can be overridden by setting it here")
     self.declareProperty('IndividualDetectors', False,
                          "If True the workspace will include each anode as a separate spectrum, useful for debugging issues")
     condition = EnabledWhenProperty("IndividualDetectors", PropertyCriterion.IsDefault)
     self.declareProperty('BinData', True, "Data will be binned using BinWidth. If False then all data will be unbinned")
     self.setPropertySettings("BinData", condition)
     positiveFloat = FloatBoundedValidator(lower=0., exclusive=True)
     self.declareProperty('BinWidth', 0.05, positiveFloat, "Bin size of the output workspace")
     self.setPropertySettings("BinWidth", condition)
     self.declareProperty('Scale', 1.0, positiveFloat, "The output will be scaled by this value")
     self.declareProperty(WorkspaceProperty("OutputWorkspace", "",
                                            optional=PropertyMode.Mandatory,
                                            direction=Direction.Output),
                          "Output Workspace")
示例#2
0
 def PyInit(self):
     self.declareProperty(MultipleFileProperty(name="Filename", action=FileAction.OptionalLoad, extensions=[".nxs.h5"]), "Files to Load")
     self.declareProperty('IPTS', Property.EMPTY_INT, "IPTS number to load from")
     self.declareProperty(IntArrayProperty("RunNumbers", []), 'Run numbers to load')
     self.declareProperty("ApplyMask", True, "If True standard masking will be applied to the workspace")
     self.declareProperty("Grouping", 'None', StringListValidator(['None', '2x2', '4x4']), "Group pixels")
     self.declareProperty(WorkspaceProperty(name="OutputWorkspace", defaultValue="", direction=Direction.Output))
示例#3
0
 def PyInit(self):
     self.declareProperty(MultipleFileProperty('SampleRuns',
                                               extensions=['nxs']),
                          doc="File path for run(s).")
     self.declareProperty(
         MatrixWorkspaceProperty('OutputWorkspace',
                                 '',
                                 direction=Direction.Output),
         doc='The output workspace group containing reduced data.')
     self.declareProperty(
         "MaskPixelsFromStart",
         10,
         validator=IntBoundedValidator(lower=0),
         doc="Number of pixels to mask at the start of each tube")
     self.declareProperty(
         "MaskPixelsFromEnd",
         10,
         validator=IntBoundedValidator(lower=0),
         doc="Number of pixels to mask at the end of each tube")
     self.declareProperty(
         "Observable",
         "sample.temperature",
         doc=
         "If multiple files, the parameter from SampleLog to use as an index when conjoined."
     )
     self.declareProperty("Transpose", True, doc="Transpose the result.")
     self.declareProperty("Sum", False, doc="Sum along the scan")
     self.declareProperty(
         name='ComponentsToMask',
         defaultValue='',
         doc=
         'Comma separated list of component names to mask, for instance: tube_1, tube_2'
     )
示例#4
0
 def PyInit(self):
     self.declareProperty(
         MultipleFileProperty('Files', extensions=[".raw", ".s0x"]),
         doc='Files of calibration runs (numors). Must be detector scans.')
     self.declareProperty(name='FoilType',
                          defaultValue='Hf01',
                          validator=StringListValidator([
                              'Hf01', 'Hf02', 'Ta10', 'Irp6', 'Iro5', 'Iro9'
                          ]),
                          direction=Direction.Input,
                          doc="Type of foil included with the sample")
     self.declareProperty(name='Ediv',
                          defaultValue='0.0025',
                          direction=Direction.Input,
                          doc="Energy step in eV")
     self.declareProperty(name='ReferenceTemp',
                          defaultValue='290',
                          direction=Direction.Input,
                          doc="Enter reference temperature in K")
     self.declareProperty(
         name='Calibration',
         defaultValue=False,
         direction=Direction.Input,
         doc=
         "Calibration flag, default is False in which case temperature measured"
     )
     self.declareProperty(
         name='Debug',
         defaultValue=False,
         direction=Direction.Input,
         doc=
         "True/False - provides more verbose output of procedure for debugging purposes"
     )
示例#5
0
    def PyInit(self):
        self.declareProperty(
            MultipleFileProperty(name="Filename", extensions=EXTENSIONS_NXS),
            "Files to combine in reduction")
        self.declareProperty(
            "MaxChunkSize", 0.,
            "Specify maximum Gbytes of file to read in one chunk.  Default is whole file."
        )
        self.declareProperty(
            "FilterBadPulses",
            0.,
            doc=
            "Filter out events measured while proton charge is more than 5% below average"
        )

        self.declareProperty(
            MatrixWorkspaceProperty('AbsorptionWorkspace', '', Direction.Input,
                                    PropertyMode.Optional),
            doc='Divide data by this Pixel-by-pixel workspace')

        self.copyProperties('CreateCacheFilename', 'CacheDir')

        self.declareProperty(MatrixWorkspaceProperty('OutputWorkspace', '',
                                                     Direction.Output),
                             doc='Combined output workspace')
        self.copyProperties('AlignAndFocusPowder', ['UnfocussedWorkspace'])

        self.declareProperty(
            ITableWorkspaceProperty('Characterizations', '', Direction.Input,
                                    PropertyMode.Optional),
            'Characterizations table')

        self.copyProperties("AlignAndFocusPowder", PROPS_FOR_ALIGN)
        self.copyProperties('PDDetermineCharacterizations',
                            PROPS_FOR_PD_CHARACTER)
示例#6
0
    def PyInit(self):
        # Input workspace/data info (filename or IPTS+RunNumber)
        # Priority: Filename > IPTS + RunNumber
        self.declareProperty(
            MultipleFileProperty(name="Filename",
                                 action=FileAction.OptionalLoad,
                                 extensions=[".nxs.h5"]), "Files to load")
        self.declareProperty('IPTS', Property.EMPTY_INT,
                             "IPTS number to load from")
        self.declareProperty(IntArrayProperty("RunNumbers", []),
                             'Run numbers to load')

        # Normalization info (optional, skip normalization if not specified)
        # Priority: IPTS + RunNumber > Filename >  NormalizationFile
        # NOTE:
        #   The current convention for loading Vanadium data is by IPTS+RunNumber, so this is the default\
        # -- default
        self.declareProperty('VanadiumIPTS', Property.EMPTY_INT,
                             "IPTS number to load Vanadium normalization")
        self.declareProperty('VanadiumRunNumber', Property.EMPTY_INT,
                             "Run number to load Vanadium normalization")
        # -- alternative
        self.declareProperty(FileProperty(name="VanadiumFile",
                                          defaultValue="",
                                          extensions=[".nxs"],
                                          direction=Direction.Input,
                                          action=FileAction.OptionalLoad),
                             doc="File with Vanadium normalization scan data")
        # alternative
        self.declareProperty(
            IMDHistoWorkspaceProperty("VanadiumWorkspace",
                                      defaultValue="",
                                      direction=Direction.Input,
                                      optional=PropertyMode.Optional),
            doc="MDHisto workspace containing vanadium normalization data")
        # normalization method
        self.declareProperty(
            "NormalizedBy", 'None',
            StringListValidator(['None', 'Counts', 'Monitor', 'Time']),
            "Normalize to Counts, Monitor, Time.")
        # group normalization properties
        self.setPropertyGroup('VanadiumIPTS', 'Normalization')
        self.setPropertyGroup('VanadiumRunNumber', 'Normalization')
        self.setPropertyGroup('VanadiumFile', 'Normalization')
        self.setPropertyGroup('VanadiumWorkspace', 'Normalization')
        self.setPropertyGroup('NormalizedBy', 'Normalization')

        # Grouping info
        self.declareProperty(
            "Grouping", 'None', StringListValidator(['None', '2x2', '4x4']),
            "Group pixels (shared by input and normalization)")

        # Output workspace/data info
        self.declareProperty(
            WorkspaceProperty("OutputWorkspace",
                              "",
                              optional=PropertyMode.Mandatory,
                              direction=Direction.Output), "Output Workspace")
示例#7
0
    def PyInit(self):

        self.declareProperty(MultipleFileProperty('Run', extensions=['nxs']),
                             doc='File path of run(s).')

        self.declareProperty(name='NormaliseTo',
                             defaultValue='Monitor',
                             validator=StringListValidator(['None', 'Monitor']),
                             doc='Normalise to monitor, or skip normalisation.')

        self.declareProperty(FileProperty('CalibrationFile', '', action=FileAction.OptionalLoad, extensions=['nxs']),
                             doc='File containing the detector efficiencies.')

        self.declareProperty(name='UseCalibratedData',
                             defaultValue=True,
                             doc='Whether or not to use the calibrated data in the NeXus files.')

        self.declareProperty(name='Output2DTubes',
                             defaultValue=False,
                             doc='Output a 2D workspace of height along tube against tube scattering angle.')

        self.declareProperty(name='Output2D',
                             defaultValue=False,
                             doc='Output a 2D workspace of height along tube against the real scattering angle.')

        self.declareProperty(name='Output1D',
                             defaultValue=True,
                             doc='Output a 1D workspace with counts against scattering angle.')

        self.declareProperty(name='CropNegativeScatteringAngles', defaultValue=True,
                             doc='Whether or not to crop the negative scattering angles.')

        self.declareProperty(FloatArrayProperty(name='HeightRange', values=[],
                                                validator=CompositeValidator([FloatArrayOrderedPairsValidator(),
                                                                              FloatArrayLengthValidator(0, 2)])),
                             doc='A pair of values, comma separated, to give the minimum and maximum height range (in m). If not specified '
                                 'the full height range is used.')

        self.declareProperty(WorkspaceGroupProperty('OutputWorkspace', '',
                                                    direction=Direction.Output),
                             doc='Output workspace containing the reduced data.')

        self.declareProperty(name='InitialMask', defaultValue=20, validator=IntBoundedValidator(lower=0, upper=64),
                             doc='Number of pixels to mask from the bottom and the top of each tube before superposition.')

        self.declareProperty(name='FinalMask', defaultValue=30, validator=IntBoundedValidator(lower=0, upper=70),
                             doc='Number of spectra to mask from the bottom and the top of the result of 2D options.')

        self.declareProperty(name='ComponentsToMask', defaultValue='',
                             doc='Comma separated list of component names to mask, for instance: tube_1, tube_2')

        self.declareProperty(name='ComponentsToReduce', defaultValue='',
                             doc='Comma separated list of component names to output the reduced data for; for example tube_1')

        self.declareProperty(name='AlignTubes', defaultValue=True,
                             doc='Align the tubes vertically and horizontally according to IPF.')
示例#8
0
 def PyInit(self):
     self.declareProperty(MultipleFileProperty(name="Filename", action=FileAction.OptionalLoad,
                                               extensions=[".nxs.h5"]),
                          "Files to load")
     self.declareProperty('IPTS', Property.EMPTY_INT, "IPTS number to load from")
     self.declareProperty(IntArrayProperty("RunNumbers", []), 'Run numbers to load')
     self.declareProperty("Grouping", 'None', StringListValidator(['None', '2x2', '4x4']), "Group pixels")
     self.declareProperty(WorkspaceProperty("OutputWorkspace", "",
                                            optional=PropertyMode.Mandatory,
                                            direction=Direction.Output),
                          "Output Workspace")
示例#9
0
    def PyInit(self):

        self.declareProperty(MultipleFileProperty('Run', extensions=['nxs']),
                             doc='File path of run(s).')

        self.declareProperty(
            name='NormaliseTo',
            defaultValue='Monitor',
            validator=StringListValidator(['None', 'Monitor']),
            doc='Normalise to monitor, or skip normalisation.')

        self.declareProperty(
            name='UseCalibratedData',
            defaultValue=True,
            doc='Whether or not to use the calibrated data in the NeXus files.'
        )

        self.declareProperty(
            name='Output2DTubes',
            defaultValue=False,
            doc=
            'Output a 2D workspace of height along tube against tube scattering angle.'
        )

        self.declareProperty(
            name='Output2D',
            defaultValue=False,
            doc=
            'Output a 2D workspace of height along tube against the real scattering angle.'
        )

        self.declareProperty(
            name='Output1D',
            defaultValue=True,
            doc='Output a 1D workspace with counts against scattering angle.')

        self.declareProperty(
            FloatArrayProperty(name='HeightRange',
                               values=[],
                               validator=CompositeValidator([
                                   FloatArrayOrderedPairsValidator(),
                                   FloatArrayLengthValidator(0, 2)
                               ])),
            doc=
            'A pair of values, comma separated, to give the minimum and maximum height range (in m). If not specified '
            'the full height range is used.')

        self.declareProperty(
            WorkspaceGroupProperty('OutputWorkspace',
                                   '',
                                   direction=Direction.Output),
            doc='Output workspace containing the reduced data.')
    def PyInit(self):

        self.declareProperty(MultipleFileProperty('Run', extensions=['nxs']),
                             doc='File path of run(s).')

        self.declareProperty(FileProperty('CalibrationFile', '',
                                          action=FileAction.OptionalLoad, extensions=['nxs']),
                             doc='File containing the detector efficiencies.')

        self.declareProperty(FileProperty('ROCCorrectionFile', '',
                                          action=FileAction.OptionalLoad, extensions=['nxs']),
                             doc='File containing the radial oscillating collimator (ROC) corrections.')

        self.declareProperty(name='NormaliseTo',
                             defaultValue='None',
                             validator=StringListValidator(['None', 'Time', 'Monitor', 'ROI']),
                             doc='Normalise to time, monitor or ROI counts.')

        thetaRangeValidator = FloatArrayOrderedPairsValidator()

        self.declareProperty(FloatArrayProperty(name='ROI', values=[0, 153.6], validator=thetaRangeValidator),
                             doc='Regions of interest for normalisation [in scattering angle in degrees].')

        normaliseToROI = VisibleWhenProperty('NormaliseTo', PropertyCriterion.IsEqualTo, 'ROI')
        self.setPropertySettings('ROI', normaliseToROI)

        self.declareProperty(name='Observable',
                             defaultValue='sample.temperature',
                             doc='Scanning observable, a Sample Log entry.')

        self.declareProperty(name='SortObservableAxis',
                             defaultValue=False,
                             doc='Whether or not to sort the scanning observable axis.')

        self.declareProperty(name='ScanAxisBinWidth', defaultValue=0., validator=FloatBoundedValidator(lower=0.),
                             doc='Rebin the observable axis to this width. Default is to not rebin.')

        self.declareProperty(name='CropNegative2Theta', defaultValue=True,
                             doc='Whether or not to crop out the bins corresponding to negative scattering angle.')

        self.declareProperty(name='ZeroCountingCells', defaultValue='Interpolate',
                             validator=StringListValidator(['Crop','Interpolate','Leave']),
                             doc='Crop out the zero counting cells or interpolate the counts from the neighbours.')

        self.declareProperty(name='Unit',
                             defaultValue='ScatteringAngle',
                             validator=StringListValidator(['ScatteringAngle', 'MomentumTransfer', 'dSpacing']),
                             doc='The unit of the reduced diffractogram.')

        self.declareProperty(MatrixWorkspaceProperty('OutputWorkspace', '',
                                                     direction=Direction.Output),
                             doc='Output workspace containing the reduced data.')
示例#11
0
 def PyInit(self):
     self.declareProperty(MultipleFileProperty('Filename'), doc='List of input files')
     self.declareProperty('LoaderName', defaultValue='Load', validator=StringContainsValidator(['Load']),
                          direction=Direction.InOut,
                          doc='The name of the specific loader. Generic Load by default.')
     self.declareProperty('LoaderVersion', defaultValue=-1, direction=Direction.InOut,
                          doc='The version of the specific loader')
     self.declareProperty(PropertyManagerProperty('LoaderOptions',dict()),
                          doc='Options for the specific loader')
     self.declareProperty(PropertyManagerProperty('MergeRunsOptions',dict()),
                          doc='Options for merging the metadata')
     self.declareProperty(WorkspaceProperty('OutputWorkspace', '', direction=Direction.Output),
                          doc='Output workspace or workspace group.')
示例#12
0
    def PyInit(self):

        self.declareProperty(MultipleFileProperty('Run', extensions=['nxs']),
                             doc='File path of run (s).')

        self.declareProperty(
            FileProperty('MapFile',
                         '',
                         action=FileAction.OptionalLoad,
                         extensions=['map', 'xml']),
            doc='Filename of the detector grouping map file to use. \n'
            'By default all the pixels will be summed per each tube. \n'
            'Use .map or .xml file (see GroupDetectors documentation) '
            'only if different range is needed for each tube.')

        self.declareProperty(
            name='ManualPSDIntegrationRange',
            defaultValue=[1, 128],
            doc='Integration range of vertical pixels in each PSD tube. \n'
            'By default all the pixels will be summed per each tube. \n'
            'Use this option if the same range (other than default) '
            'is needed for all the tubes.')

        self.declareProperty(name='Analyser',
                             defaultValue='silicon',
                             validator=StringListValidator(['silicon']),
                             doc='Analyser crystal.')

        self.declareProperty(name='Reflection',
                             defaultValue='111',
                             validator=StringListValidator(['111', '311']),
                             doc='Analyser reflection.')

        self.declareProperty(
            name='CropDeadMonitorChannels',
            defaultValue=False,
            doc='Whether or not to exclude the first and last few channels '
            'with 0 monitor count in the energy transfer formula.')

        self.declareProperty(WorkspaceGroupProperty(
            'OutputWorkspace', '', direction=Direction.Output),
                             doc='Group name for the reduced workspace(s).')

        self.declareProperty(name='SpectrumAxis',
                             defaultValue='SpectrumNumber',
                             validator=StringListValidator(
                                 ['SpectrumNumber', '2Theta', 'Q', 'Q2']),
                             doc='The spectrum axis conversion target.')
示例#13
0
 def PyInit(self):
     self.declareProperty(MultipleFileProperty('Filename'),
                          doc='List of input files')
     self.getProperty('Filename').setAutoTrim(setting=False)
     self.declareProperty(
         'LoaderName',
         defaultValue='Load',
         validator=StringContainsValidator(['Load']),
         direction=Direction.InOut,
         doc='The name of the specific loader. Generic Load by default.')
     self.declareProperty('LoaderVersion',
                          defaultValue=-1,
                          direction=Direction.InOut,
                          doc='The version of the specific loader')
     self.declareProperty(PropertyManagerProperty('LoaderOptions', dict()),
                          doc='Options for the specific loader')
     self.declareProperty(PropertyManagerProperty('MergeRunsOptions',
                                                  dict()),
                          doc='Options for merging the metadata')
     self.declareProperty(WorkspaceProperty('OutputWorkspace',
                                            '',
                                            direction=Direction.Output),
                          doc='Output workspace or workspace group.')
     self.declareProperty(
         'OutputBehaviour',
         'Group',
         StringListValidator(['Group', 'Concatenate']),
         doc=
         'Whether to group the workspaces to a workspace group or to concatenate them to a single workspace.'
     )
     self.declareProperty(
         'SampleLogAsXAxis',
         '',
         doc=
         'Sample log to be put as x-axis when concatenating; will use linear indices if left blank.'
     )
     self.setPropertySettings(
         'SampleLogAsXAxis',
         EnabledWhenProperty('OutputBehaviour', PropertyCriterion.IsEqualTo,
                             'Concatenate'))
    def PyInit(self):
        self.declareProperty(MultipleFileProperty("Filenames",
                                                  action=FileAction.OptionalLoad),
                             doc="The file names with a single YIG scan.")

        self.declareProperty(MatrixWorkspaceProperty('InputWorkspace', '',
                                                     direction=Direction.Input,
                                                     optional=PropertyMode.Optional),
                             doc='The name of the workspace containing the entire YIG scan.')
        default_d7_yig_file = os.path.join(config.getInstrumentDirectory(), 'D7_YIG_peaks.xml')
        self.declareProperty(FileProperty('YIGPeaksFile', default_d7_yig_file,
                                          action=FileAction.Load,
                                          extensions=['.xml']),
                             doc='The file name with all YIG peaks in d-spacing.')

        self.declareProperty(name="ApproximateWavelength",
                             defaultValue=3.1,
                             validator=FloatBoundedValidator(lower=0),
                             direction=Direction.Input,
                             doc="The initial guess for the neutrons' wavelength")

        self.declareProperty(name="MinimalDistanceBetweenPeaks",
                             defaultValue=3.0,
                             validator=FloatBoundedValidator(lower=0),
                             direction=Direction.Input,
                             doc="The minimal allowable distance between two YIG peaks (in degrees 2theta).")

        self.declareProperty(name="BankOffsets",
                             defaultValue=[3.0, 3.0, 0.0],
                             direction=Direction.Input,
                             doc="List of values of offset for each bank (in degrees).")

        self.declareProperty(name="BraggPeakWidth",
                             defaultValue=2.0,
                             validator=FloatBoundedValidator(lower=0),
                             direction=Direction.Input,
                             doc="An initial guess for the width of YIG Bragg peaks used for fitting (in degrees).")

        self.declareProperty(name="MaskedBinsRange",
                             defaultValue=[-35.0, 15.0],
                             direction=Direction.Input,
                             doc="The lower and upper bound for the masked region around the direct beam (in degrees).")

        self.declareProperty(FileProperty(name='CalibrationOutputFile',
                                          action=FileAction.OptionalSave,
                                          extensions=['xml'],
                                          defaultValue=''),
                             doc="The output YIG calibration Instrument Parameter File.")

        self.declareProperty(name="ClearCache", defaultValue=True, direction=Direction.Input,
                             doc="Whether to clear the intermediate fitting results.")

        self.declareProperty(ITableWorkspaceProperty(name='FitOutputWorkspace',
                                                     defaultValue='',
                                                     direction=Direction.Output,
                                                     optional=PropertyMode.Optional),
                             doc="The table workspace name that will be used to store all of the calibration parameters.")

        self.declareProperty(name="FittingMethod",
                             defaultValue="None",
                             validator=StringListValidator(["None", "Individual", "Global"]),
                             direction=Direction.Input,
                             doc="Option to provide the initial guesses or perform fits for Bragg peaks either individually or globally.")
示例#15
0
    def PyInit(self):

        self.declareProperty(
            WorkspaceGroupProperty('OutputWorkspace',
                                   '',
                                   direction=Direction.Output),
            doc='The output workspace group containing reduced data.')

        self.declareProperty(MultipleFileProperty(
            'SampleRuns',
            action=FileAction.OptionalLoad,
            extensions=['nxs'],
            allow_empty=True),
                             doc='Sample run(s).')

        self.declareProperty(
            MultipleFileProperty('AbsorberRuns',
                                 action=FileAction.OptionalLoad,
                                 extensions=['nxs']),
            doc='Absorber (Cd/B4C) run(s).')

        self.declareProperty(MultipleFileProperty(
            'BeamRuns', action=FileAction.OptionalLoad, extensions=['nxs']),
                             doc='Empty beam run(s).')

        self.declareProperty(
            MultipleFileProperty('FluxRuns',
                                 action=FileAction.OptionalLoad,
                                 extensions=['nxs']),
            doc='Empty beam run(s) for flux calculation only; '
            'if left blank flux will be calculated from BeamRuns.')

        self.declareProperty(MultipleFileProperty(
            'ContainerRuns',
            action=FileAction.OptionalLoad,
            extensions=['nxs']),
                             doc='Empty container run(s).')

        self.setPropertyGroup('SampleRuns', 'Numors')
        self.setPropertyGroup('AbsorberRuns', 'Numors')
        self.setPropertyGroup('BeamRuns', 'Numors')
        self.setPropertyGroup('FluxRuns', 'Numors')
        self.setPropertyGroup('ContainerRuns', 'Numors')

        self.declareProperty(MultipleFileProperty(
            'SampleTransmissionRuns',
            action=FileAction.OptionalLoad,
            extensions=['nxs']),
                             doc='Sample transmission run(s).')

        self.declareProperty(MultipleFileProperty(
            'ContainerTransmissionRuns',
            action=FileAction.OptionalLoad,
            extensions=['nxs']),
                             doc='Container transmission run(s).')

        self.declareProperty(MultipleFileProperty(
            'TransmissionBeamRuns',
            action=FileAction.OptionalLoad,
            extensions=['nxs']),
                             doc='Empty beam run(s) for transmission.')

        self.declareProperty(MultipleFileProperty(
            'TransmissionAbsorberRuns',
            action=FileAction.OptionalLoad,
            extensions=['nxs']),
                             doc='Absorber (Cd/B4C) run(s) for transmission.')

        self.setPropertyGroup('SampleTransmissionRuns', 'Transmissions')
        self.setPropertyGroup('ContainerTransmissionRuns', 'Transmissions')
        self.setPropertyGroup('TransmissionBeamRuns', 'Transmissions')
        self.setPropertyGroup('TransmissionAbsorberRuns', 'Transmissions')
        self.copyProperties('SANSILLReduction', ['ThetaDependent'])
        self.setPropertyGroup('ThetaDependent', 'Transmissions')

        self.declareProperty(
            'SensitivityMaps',
            '',
            doc=
            'File(s) or workspaces containing the maps of relative detector efficiencies.'
        )

        self.declareProperty(
            'DefaultMaskFile',
            '',
            doc=
            'File or workspace containing the default mask (typically the detector edges and dead pixels/tubes)'
            ' to be applied to all the detector configurations.')

        self.declareProperty(
            'MaskFiles',
            '',
            doc=
            'File(s) or workspaces containing the detector mask (typically beam stop).'
        )

        self.declareProperty(
            'ReferenceFiles',
            '',
            doc=
            'File(s) or workspaces containing the corrected water data (in 2D) for absolute normalisation.'
        )

        self.declareProperty(
            'SolventFiles',
            '',
            doc=
            'File(s) or workspaces containing the corrected solvent data (in 2D) for solvent subtraction.'
        )

        self.declareProperty(MatrixWorkspaceProperty(
            'SensitivityOutputWorkspace',
            '',
            direction=Direction.Output,
            optional=PropertyMode.Optional),
                             doc='The output sensitivity map workspace.')

        self.copyProperties('SANSILLReduction', ['NormaliseBy'])

        self.declareProperty('SampleThickness',
                             0.1,
                             validator=FloatBoundedValidator(lower=-1),
                             doc='Sample thickness [cm]')

        self.declareProperty('TransmissionBeamRadius',
                             0.1,
                             validator=FloatBoundedValidator(lower=0.),
                             doc='Beam radius [m]; used for transmission '
                             'calculations.')

        self.declareProperty(FloatArrayProperty('BeamRadius', values=[0.1]),
                             doc='Beam radius [m]; used for beam center '
                             'finding and flux calculations.')

        self.declareProperty(
            'WaterCrossSection',
            1.,
            doc='Provide water cross-section; '
            'used only if the absolute scale is done by dividing to water.')

        self.setPropertyGroup('SensitivityMaps', 'Options')
        self.setPropertyGroup('DefaultMaskFile', 'Options')
        self.setPropertyGroup('MaskFiles', 'Options')
        self.setPropertyGroup('ReferenceFiles', 'Options')
        self.setPropertyGroup('SolventFiles', 'Options')
        self.setPropertyGroup('SensitivityOutputWorkspace', 'Options')
        self.setPropertyGroup('NormaliseBy', 'Options')
        self.setPropertyGroup('SampleThickness', 'Options')
        self.setPropertyGroup('BeamRadius', 'Options')
        self.setPropertyGroup('TransmissionBeamRadius', 'Options')
        self.setPropertyGroup('WaterCrossSection', 'Options')

        self.declareProperty(FloatArrayProperty('MaxQxy', values=[-1]),
                             doc='Maximum of absolute Qx and Qy.')
        self.declareProperty(FloatArrayProperty('DeltaQ', values=[-1]),
                             doc='The dimension of a Qx-Qy cell.')

        self.declareProperty('OutputPanels',
                             False,
                             doc='Whether or not process the individual '
                             'detector panels.')

        self.copyProperties('SANSILLIntegration', [
            'OutputType', 'CalculateResolution', 'DefaultQBinning',
            'BinningFactor', 'NPixelDivision', 'NumberOfWedges', 'WedgeAngle',
            'WedgeOffset', 'AsymmetricWedges', 'IQxQyLogBinning',
            'WavelengthRange'
        ])

        self.declareProperty(
            'OutputBinning',
            '',
            doc=
            'Output binning for each distance. : separated list of binning params.'
        )
        self.setPropertyGroup('OutputBinning', 'Integration Options')
        self.setPropertyGroup('OutputType', 'Integration Options')
        self.setPropertyGroup('CalculateResolution', 'Integration Options')
        self.declareProperty(
            'ClearCorrected2DWorkspace', True,
            'Whether to clear the fully corrected 2D workspace.')

        self.declareProperty(
            'SensitivityWithOffsets', False,
            'Whether the sensitivity data has been measured with different horizontal offsets.'
        )

        self.declareProperty(
            'StitchReferenceIndex',
            defaultValue=1,
            validator=IntBoundedValidator(lower=0),
            doc='Index of reference workspace during stitching.')

        self.copyProperties('SANSILLIntegration', ['ShapeTable'])

        self.copyProperties('SANSILLReduction', 'Wavelength')
    def PyInit(self):
        """Initialize the input and output properties of the algorithm."""
        nonnegativeInts = IntArrayBoundedValidator()
        nonnegativeInts.setLower(0)
        maxTwoNonnegativeInts = CompositeValidator()
        maxTwoNonnegativeInts.add(IntArrayLengthValidator(lenmin=0, lenmax=2))
        maxTwoNonnegativeInts.add(nonnegativeInts)
        nonnegativeFloatArray = FloatArrayBoundedValidator()
        nonnegativeFloatArray.setLower(0.)
        stringArrayValidator = StringArrayLengthValidator()
        stringArrayValidator.setLengthMin(1)

        #======================== Main Properties ========================
        self.declareProperty(
            PropertyNames.POLARIZATION_OPTION, 'NonPolarized',
            StringListValidator(['NonPolarized', 'Polarized']),
            'Indicate whether measurements are polarized')

        is_polarized = EnabledWhenProperty(PropertyNames.POLARIZATION_OPTION,
                                           PropertyCriterion.IsEqualTo,
                                           'Polarized')
        is_not_polarized = EnabledWhenProperty(
            PropertyNames.POLARIZATION_OPTION, PropertyCriterion.IsEqualTo,
            'NonPolarized')
        polarized = 'Inputs for polarized measurements'

        self.declareProperty(MultipleFileProperty(
            PropertyNames.RB,
            action=FileAction.OptionalLoad,
            extensions=['nxs']),
                             doc='A list of reflected run numbers/files.')
        self.setPropertySettings(PropertyNames.RB, is_not_polarized)

        self.declareProperty(
            MultipleFileProperty(PropertyNames.RB00,
                                 action=FileAction.OptionalLoad,
                                 extensions=['nxs']),
            doc='A list of reflected run numbers/files for 00.')
        self.setPropertySettings(PropertyNames.RB00, is_polarized)
        self.setPropertyGroup(PropertyNames.RB00, polarized)

        self.declareProperty(
            MultipleFileProperty(PropertyNames.RB01,
                                 action=FileAction.OptionalLoad,
                                 extensions=['nxs']),
            doc='A list of reflected run numbers/files for 01.')
        self.setPropertySettings(PropertyNames.RB01, is_polarized)
        self.setPropertyGroup(PropertyNames.RB01, polarized)

        self.declareProperty(
            MultipleFileProperty(PropertyNames.RB10,
                                 action=FileAction.OptionalLoad,
                                 extensions=['nxs']),
            doc='A list of reflected run numbers/files for 10.')
        self.setPropertySettings(PropertyNames.RB10, is_polarized)
        self.setPropertyGroup(PropertyNames.RB10, polarized)

        self.declareProperty(
            MultipleFileProperty(PropertyNames.RB11,
                                 action=FileAction.OptionalLoad,
                                 extensions=['nxs']),
            doc='A list of reflected run numbers/files for 11.')
        self.setPropertySettings(PropertyNames.RB11, is_polarized)
        self.setPropertyGroup(PropertyNames.RB11, polarized)

        self.declareProperty(
            FileProperty(PropertyNames.EFFICIENCY_FILE,
                         defaultValue='',
                         action=FileAction.OptionalLoad),
            doc='A file containing the polarization efficiency factors.')
        self.setPropertySettings(PropertyNames.EFFICIENCY_FILE, is_polarized)
        self.setPropertyGroup(PropertyNames.EFFICIENCY_FILE, polarized)

        self.declareProperty(MultipleFileProperty(PropertyNames.DB,
                                                  action=FileAction.Load,
                                                  extensions=['nxs']),
                             doc='A list of direct run numbers/files.')
        self.declareProperty(WorkspaceGroupProperty(
            Prop.OUTPUT_WS, defaultValue='', direction=Direction.Output),
                             doc='The output workspace group.')
        self.declareProperty(
            PropertyNames.BKG_METHOD_DIRECT,
            defaultValue=BkgMethod.CONSTANT,
            validator=StringListValidator(
                [BkgMethod.CONSTANT, BkgMethod.LINEAR, BkgMethod.OFF]),
            doc='Flat background calculation method for background subtraction.'
        )
        self.declareProperty(
            PropertyNames.BKG_METHOD,
            defaultValue=BkgMethod.CONSTANT,
            validator=StringListValidator(
                [BkgMethod.CONSTANT, BkgMethod.LINEAR, BkgMethod.OFF]),
            doc='Flat background calculation method for background subtraction.'
        )
        self.copyProperties('ReflectometryILLPreprocess', [
            Prop.SUBALG_LOGGING, Prop.CLEANUP, Prop.WATER_REFERENCE,
            Prop.SLIT_NORM, Prop.FLUX_NORM_METHOD
        ])
        self.declareProperty(PropertyNames.SCALE_FACTOR,
                             defaultValue=1.0,
                             doc='Scale factor.')

        self.declareProperty(
            PropertyNames.USE_MANUAL_SCALE_FACTORS,
            defaultValue=False,
            doc='Choose to apply manual scale factors for stitching.')

        self.declareProperty(
            FloatArrayProperty(PropertyNames.MANUAL_SCALE_FACTORS, values=[]),
            doc=
            'A list of manual scale factors for stitching (number of anlge configurations minus 1)'
        )

        self.setPropertySettings(
            PropertyNames.MANUAL_SCALE_FACTORS,
            EnabledWhenProperty(PropertyNames.USE_MANUAL_SCALE_FACTORS,
                                PropertyCriterion.IsNotDefault))

        self.declareProperty(
            PropertyNames.CACHE_DIRECT_BEAM,
            defaultValue=False,
            doc=
            'Cache the processed direct beam in ADS for ready use with further reflected beams;'
            'saves important execution time, however assumes that the direct beam processing '
            'configuration must be invariant for different reflected beams.')

        # ======================== Common Properties ========================
        commonProp = 'Preprocessing common properties: provide a list or a single value'

        self.declareProperty(StringArrayProperty(
            PropertyNames.ANGLE_OPTION,
            values=[PropertyNames.DAN],
            validator=stringArrayValidator,
            direction=Direction.Input,
        ),
                             doc='Angle option used for detector positioning')
        self.declareProperty(FloatArrayProperty(PropertyNames.THETA,
                                                values=[-1.]),
                             doc='A user-defined angle theta in degree')
        self.declareProperty(StringArrayProperty(
            PropertyNames.SUM_TYPE,
            values=[PropertyNames.INCOHERENT],
            validator=stringArrayValidator,
            direction=Direction.Input,
        ),
                             doc='Type of summation to perform')
        self.declareProperty(FloatArrayProperty(
            PropertyNames.WAVELENGTH_LOWER,
            values=[0.],
            validator=nonnegativeFloatArray),
                             doc='The lower wavelength bound (Angstrom)')
        self.declareProperty(FloatArrayProperty(
            PropertyNames.WAVELENGTH_UPPER,
            values=[35.],
            validator=nonnegativeFloatArray),
                             doc='The upper wavelength bound (Angstrom)')
        self.declareProperty(
            FloatArrayProperty(
                PropertyNames.GROUPING_FRACTION,
                values=[0.5],
                validator=nonnegativeFloatArray,
            ),
            doc=
            'If set, group the output by steps of this fraction multiplied by Q resolution'
        )
        self.setPropertyGroup(PropertyNames.ANGLE_OPTION, commonProp)
        self.setPropertyGroup(PropertyNames.THETA, commonProp)
        self.setPropertyGroup(PropertyNames.SUM_TYPE, commonProp)
        self.setPropertyGroup(PropertyNames.WAVELENGTH_LOWER, commonProp)
        self.setPropertyGroup(PropertyNames.WAVELENGTH_UPPER, commonProp)
        self.setPropertyGroup(PropertyNames.GROUPING_FRACTION, commonProp)

        # ======================== Direct Run Properties ========================
        preProcessDirect = 'Preprocessing for direct runs: provide a list or a single value'

        self.declareProperty(
            IntArrayProperty(PropertyNames.LOW_FRG_HALF_WIDTH_DIRECT,
                             values=[0],
                             validator=nonnegativeInts),
            doc=
            'Number of foreground pixels at lower angles from the centre pixel.'
        )
        self.setPropertyGroup(PropertyNames.LOW_FRG_HALF_WIDTH_DIRECT,
                              preProcessDirect)
        self.declareProperty(
            IntArrayProperty(
                PropertyNames.LOW_BKG_OFFSET_DIRECT,
                values=[7],
                validator=nonnegativeInts,
            ),
            doc=
            'Distance of flat background region towards smaller detector angles from the '
            + 'foreground centre, in pixels')
        self.setPropertyGroup(PropertyNames.LOW_BKG_OFFSET_DIRECT,
                              preProcessDirect)
        self.declareProperty(
            IntArrayProperty(
                PropertyNames.LOW_BKG_WIDTH_DIRECT,
                values=[5],
                validator=nonnegativeInts,
            ),
            doc=
            'Width of flat background region towards smaller detector angles from the '
            + 'foreground centre, in pixels')
        self.setPropertyGroup(PropertyNames.LOW_BKG_WIDTH_DIRECT,
                              preProcessDirect)
        self.declareProperty(
            IntArrayProperty(PropertyNames.HIGH_FRG_HALF_WIDTH_DIRECT,
                             values=[0],
                             validator=nonnegativeInts),
            doc=
            'Number of foreground pixels at higher angles from the centre pixel.'
        )
        self.setPropertyGroup(PropertyNames.HIGH_FRG_HALF_WIDTH_DIRECT,
                              preProcessDirect)
        self.declareProperty(
            IntArrayProperty(
                PropertyNames.HIGH_BKG_OFFSET_DIRECT,
                values=[7],
                validator=nonnegativeInts,
            ),
            doc=
            'Distance of flat background region towards larger detector angles from the '
            + 'foreground centre, in pixels')
        self.setPropertyGroup(PropertyNames.HIGH_BKG_OFFSET_DIRECT,
                              preProcessDirect)
        self.declareProperty(
            IntArrayProperty(
                PropertyNames.HIGH_BKG_WIDTH_DIRECT,
                values=[5],
                validator=nonnegativeInts,
            ),
            doc=
            'Width of flat background region towards larger detector angles from the '
            + 'foreground centre, in pixels')
        self.setPropertyGroup(PropertyNames.HIGH_BKG_WIDTH_DIRECT,
                              preProcessDirect)
        self.declareProperty(IntArrayProperty(
            PropertyNames.START_WS_INDEX_DIRECT,
            values=[0],
            validator=nonnegativeInts,
        ),
                             doc='Start histogram index used for peak fitting')
        self.setPropertyGroup(PropertyNames.START_WS_INDEX_DIRECT,
                              preProcessDirect)
        self.declareProperty(IntArrayProperty(
            PropertyNames.END_WS_INDEX_DIRECT,
            values=[255],
            validator=nonnegativeInts,
        ),
                             doc='Last histogram index used for peak fitting')
        self.setPropertyGroup(PropertyNames.END_WS_INDEX_DIRECT,
                              preProcessDirect)
        self.declareProperty(
            PropertyNames.XMIN_DIRECT,
            defaultValue=-1.,
            doc='Minimum x value (unit wavelength) used for peak fitting.')
        self.setPropertyGroup(PropertyNames.XMIN_DIRECT, preProcessDirect)
        self.declareProperty(
            PropertyNames.XMAX_DIRECT,
            defaultValue=-1.,
            doc='Maximum x value (unit wavelength) used for peak fitting.')
        self.setPropertyGroup(PropertyNames.XMAX_DIRECT, preProcessDirect)

        # ======================== Preprocessing For Reflected Runs ========================
        preProcessReflected = 'Preprocessing for reflected runs: provide a list or a single value'

        self.declareProperty(
            IntArrayProperty(
                PropertyNames.LOW_FRG_HALF_WIDTH,
                values=[0],
                validator=nonnegativeInts,
            ),
            doc=
            'Number of foreground pixels at lower angles from the centre pixel.'
        )
        self.setPropertyGroup(PropertyNames.LOW_FRG_HALF_WIDTH,
                              preProcessReflected)
        self.declareProperty(
            IntArrayProperty(
                PropertyNames.LOW_BKG_OFFSET,
                values=[7],
                validator=nonnegativeInts,
            ),
            doc=
            'Distance of flat background region towards smaller detector angles from the '
            + 'foreground centre, in pixels.')
        self.setPropertyGroup(PropertyNames.LOW_BKG_OFFSET,
                              preProcessReflected)
        self.declareProperty(
            IntArrayProperty(
                PropertyNames.LOW_BKG_WIDTH,
                values=[5],
                validator=nonnegativeInts,
            ),
            doc=
            'Width of flat background region towards smaller detector angles from the '
            + 'foreground centre, in pixels')
        self.setPropertyGroup(PropertyNames.LOW_BKG_WIDTH, preProcessReflected)
        self.declareProperty(
            IntArrayProperty(
                PropertyNames.HIGH_FRG_HALF_WIDTH,
                values=[0],
                validator=nonnegativeInts,
            ),
            doc=
            'Number of foreground pixels at higher angles from the centre pixel.'
        )
        self.setPropertyGroup(PropertyNames.HIGH_FRG_HALF_WIDTH,
                              preProcessReflected)
        self.declareProperty(
            IntArrayProperty(
                PropertyNames.HIGH_BKG_OFFSET,
                values=[7],
                validator=nonnegativeInts,
            ),
            doc=
            'Distance of flat background region towards larger detector angles from the '
            + 'foreground centre, in pixels')
        self.setPropertyGroup(PropertyNames.HIGH_BKG_OFFSET,
                              preProcessReflected)
        self.declareProperty(
            IntArrayProperty(
                PropertyNames.HIGH_BKG_WIDTH,
                values=[5],
                validator=nonnegativeInts,
            ),
            doc=
            'Width of flat background region towards larger detector angles from the '
            + 'foreground centre, in pixels.')
        self.setPropertyGroup(PropertyNames.HIGH_BKG_WIDTH,
                              preProcessReflected)
        self.declareProperty(IntArrayProperty(
            PropertyNames.START_WS_INDEX,
            values=[0],
            validator=nonnegativeInts,
        ),
                             doc='Start histogram index used for peak fitting')
        self.setPropertyGroup(PropertyNames.START_WS_INDEX,
                              preProcessReflected)
        self.declareProperty(IntArrayProperty(
            PropertyNames.END_WS_INDEX,
            values=[255],
            validator=nonnegativeInts,
        ),
                             doc='Last histogram index used for peak fitting')
        self.setPropertyGroup(PropertyNames.END_WS_INDEX, preProcessReflected)
        self.declareProperty(
            FloatArrayProperty(PropertyNames.XMIN, values=[-1.]),
            doc='Minimum x value (unit wavelength) used for peak fitting')
        self.setPropertyGroup(PropertyNames.XMIN, preProcessReflected)
        self.declareProperty(
            FloatArrayProperty(PropertyNames.XMAX, values=[-1.]),
            doc='Maximum x value (unit wavelength) used for peak fitting')
        self.setPropertyGroup(PropertyNames.XMAX, preProcessReflected)
示例#17
0
    def PyInit(self):

        self.declareProperty(MultipleFileProperty('Run', extensions=['nxs']),
                             doc='Run number(s) of sample run(s).')

        self.declareProperty(
            MultipleFileProperty('BackgroundRun',
                                 action=FileAction.OptionalLoad,
                                 extensions=['nxs']),
            doc='Run number(s) of background (empty can) run(s).')

        self.declareProperty(
            MultipleFileProperty('CalibrationRun',
                                 action=FileAction.OptionalLoad,
                                 extensions=['nxs']),
            doc='Run number(s) of vanadium calibration run(s).')

        self.declareProperty(
            MultipleFileProperty('CalibrationBackgroundRun',
                                 action=FileAction.OptionalLoad,
                                 extensions=['nxs']),
            doc=
            'Run number(s) of background (empty can) run(s) for vanadium run.')

        self.declareProperty(
            MultipleFileProperty('AlignmentRun',
                                 action=FileAction.OptionalLoad,
                                 extensions=['nxs']),
            doc='Run number(s) of vanadium run(s) used for '
            'peak alignment for UnmirrorOption=[5, 7]')

        self.declareProperty(name='SumRuns',
                             defaultValue=False,
                             doc='Whether to sum all the input runs.')

        self.declareProperty(
            name='CropDeadMonitorChannels',
            defaultValue=False,
            doc='Whether or not to exclude the first and last few channels '
            'with 0 monitor count in the energy transfer formula.')

        self.declareProperty(
            name='UnmirrorOption',
            defaultValue=6,
            validator=IntBoundedValidator(lower=0, upper=7),
            doc='Unmirroring options : \n'
            '0 no unmirroring\n'
            '1 sum of left and right\n'
            '2 left\n'
            '3 right\n'
            '4 shift right according to left and sum\n'
            '5 like 4, but use alignment run for peak positions\n'
            '6 center both left and right at zero and sum\n'
            '7 like 6, but use alignment run for peak positions')

        self.declareProperty(name='BackgroundScalingFactor',
                             defaultValue=1.,
                             validator=FloatBoundedValidator(lower=0),
                             doc='Scaling factor for background subtraction')

        self.declareProperty(
            name='CalibrationBackgroundScalingFactor',
            defaultValue=1.,
            validator=FloatBoundedValidator(lower=0),
            doc=
            'Scaling factor for background subtraction for vanadium calibration'
        )

        self.declareProperty(
            name='CalibrationPeakRange',
            defaultValue=[-0.003, 0.003],
            validator=FloatArrayMandatoryValidator(),
            doc='Peak range for integration over calibration file peak (in mev)'
        )

        self.declareProperty(
            FileProperty('MapFile',
                         '',
                         action=FileAction.OptionalLoad,
                         extensions=['map', 'xml']),
            doc='Filename of the detector grouping map file to use. \n'
            'By default all the pixels will be summed per each tube. \n'
            'Use .map or .xml file (see GroupDetectors documentation) '
            'only if different range is needed for each tube.')

        self.declareProperty(
            name='ManualPSDIntegrationRange',
            defaultValue=[1, 128],
            doc='Integration range of vertical pixels in each PSD tube. \n'
            'By default all the pixels will be summed per each tube. \n'
            'Use this option if the same range (other than default) '
            'is needed for all the tubes.')

        self.declareProperty(name='Analyser',
                             defaultValue='silicon',
                             validator=StringListValidator(['silicon']),
                             doc='Analyser crystal.')

        self.declareProperty(name='Reflection',
                             defaultValue='111',
                             validator=StringListValidator(['111', '311']),
                             doc='Analyser reflection.')

        self.declareProperty(WorkspaceGroupProperty(
            'OutputWorkspace', '', direction=Direction.Output),
                             doc='Group name for the reduced workspace(s).')

        self.declareProperty(name='SpectrumAxis',
                             defaultValue='SpectrumNumber',
                             validator=StringListValidator(
                                 ['SpectrumNumber', '2Theta', 'Q', 'Q2']),
                             doc='The spectrum axis conversion target.')
    def PyInit(self):

        self.declareProperty(MultipleFileProperty('Run', extensions=['nxs']),
                             doc='File path of run (s).')

        self.declareProperty(
            FileProperty('MapFile',
                         '',
                         action=FileAction.OptionalLoad,
                         extensions=['map', 'xml']),
            doc='Filename of the detector grouping map file to use. \n'
            'By default all the pixels will be summed per each tube. \n'
            'Use .map or .xml file (see GroupDetectors documentation) '
            'only if different range is needed for each tube.')

        self.declareProperty(
            name='ManualPSDIntegrationRange',
            defaultValue=[1, 128],
            doc='Integration range of vertical pixels in each PSD tube. \n'
            'By default all the pixels will be summed per each tube. \n'
            'Use this option if the same range (other than default) '
            'is needed for all the tubes.')

        self.declareProperty(name='Analyser',
                             defaultValue='silicon',
                             validator=StringListValidator(['silicon']),
                             doc='Analyser crystal.')

        self.declareProperty(name='Reflection',
                             defaultValue='111',
                             validator=StringListValidator(['111', '311']),
                             doc='Analyser reflection.')

        self.declareProperty(
            name='CropDeadMonitorChannels',
            defaultValue=False,
            doc='Whether or not to exclude the first and last few channels '
            'with 0 monitor count in the energy transfer formula.')

        self.declareProperty(WorkspaceGroupProperty(
            'OutputWorkspace', '', direction=Direction.Output),
                             doc='Group name for the reduced workspace(s).')

        self.declareProperty(name='SpectrumAxis',
                             defaultValue='SpectrumNumber',
                             validator=StringListValidator(
                                 ['SpectrumNumber', '2Theta', 'Q', 'Q2']),
                             doc='The spectrum axis conversion target.')

        self.declareProperty(name='NormaliseTo',
                             defaultValue='Monitor',
                             validator=StringListValidator(['Monitor',
                                                            'None']),
                             doc='Choose to normalise to monitor.')

        self.declareProperty(
            name='MonitorCutoff',
            defaultValue=0.5,
            validator=FloatBoundedValidator(lower=0., upper=1.),
            doc=
            'Choose the cutoff fraction wrt the maximum of the monitor counts.'
        )

        self.declareProperty(
            WorkspaceProperty('InputElasticChannelWorkspace',
                              '',
                              direction=Direction.Input,
                              optional=PropertyMode.Optional),
            doc='The name of the input elastic channel workspace.')

        self.declareProperty(
            WorkspaceProperty('OutputElasticChannelWorkspace',
                              '',
                              direction=Direction.Output,
                              optional=PropertyMode.Optional),
            doc='The name of the output elastic channel workspace.')

        self.declareProperty(name='ElasticPeakFitting',
                             defaultValue='FitAllPixelGroups',
                             validator=StringListValidator(
                                 ['FitAllPixelGroups', 'FitEquatorialOnly']),
                             doc='Choose the method for calibrating TOF axes.')

        self.declareProperty(
            name='GroupPixelsBy',
            defaultValue=4,
            validator=IntBoundedValidator(lower=1, upper=128),
            doc=
            'Choose how to group the pixels for elastic peak fitting; must be a power of 2.'
        )

        self.declareProperty(FloatArrayProperty("SampleCoordinates",
                                                [0., 0., 0.],
                                                FloatArrayLengthValidator(3),
                                                direction=Direction.Input),
                             doc='The sample coordinates X, Y, Z.')

        self.declareProperty(name='PulseChopper',
                             defaultValue='Auto',
                             validator=StringListValidator(
                                 ['Auto', '12', '34']),
                             doc='Define the pulse chopper.')

        bats_options = 'BATS only options'
        self.setPropertyGroup('MonitorCutoff', bats_options)
        self.setPropertyGroup('InputElasticChannelWorkspace', bats_options)
        self.setPropertyGroup('OutputElasticChannelWorkspace', bats_options)
        self.setPropertyGroup('ElasticPeakFitting', bats_options)
        self.setPropertyGroup('GroupPixelsBy', bats_options)
        self.setPropertyGroup('SampleCoordinates', bats_options)
        self.setPropertyGroup('PulseChopper', bats_options)

        self.declareProperty(
            name='GroupDetectors',
            defaultValue=True,
            doc=
            'Group the pixels using the range, tube-by-tube (default) or in a custom way; \n'
            'it is not recommended to group the detectors at this stage, \n'
            'in order to get absorption corrections right, \n'
            'however the default value is True for backwards compatibility.')

        self.declareProperty(
            name='DiscardSingleDetectors',
            defaultValue=False,
            doc='Whether to discard the spectra of single detectors.')
示例#19
0
    def PyInit(self):
        """Initialize the algorithm's input and output properties."""
        PROPGROUP_FLAT_BKG = 'Flat Time-Independent Background'
        PROPGROUP_INCIDENT_ENERGY_CALIBRATION = 'Indicent Energy Calibration'
        PROPGROUP_MON_NORMALISATION = 'Neutron Flux Normalisation'
        # Validators.
        mandatoryPositiveInt = CompositeValidator()
        mandatoryPositiveInt.add(IntMandatoryValidator())
        mandatoryPositiveInt.add(IntBoundedValidator(lower=0))
        positiveFloat = FloatBoundedValidator(lower=0)
        positiveInt = IntBoundedValidator(lower=0)
        inputWorkspaceValidator = CompositeValidator()
        inputWorkspaceValidator.add(InstrumentValidator())
        inputWorkspaceValidator.add(WorkspaceUnitValidator('TOF'))

        # Properties.
        self.declareProperty(MultipleFileProperty(name=common.PROP_INPUT_FILE,
                                                  action=FileAction.OptionalLoad,
                                                  extensions=['nxs']),
                             doc='An input run number (or a list thereof) or a filename.')
        self.getProperty(common.PROP_INPUT_FILE).setAutoTrim(False)
        self.declareProperty(MatrixWorkspaceProperty(
            name=common.PROP_INPUT_WS,
            defaultValue='',
            validator=inputWorkspaceValidator,
            optional=PropertyMode.Optional,
            direction=Direction.Input),
            doc='Input workspace if no run is given.')
        self.declareProperty(WorkspaceProperty(name=common.PROP_OUTPUT_WS,
                                               defaultValue='',
                                               direction=Direction.Output),
                             doc='A flux normalized and background subtracted workspace.')
        self.declareProperty(name=common.PROP_CLEANUP_MODE,
                             defaultValue=utils.Cleanup.ON,
                             validator=StringListValidator([
                                 utils.Cleanup.ON,
                                 utils.Cleanup.OFF]),
                             direction=Direction.Input,
                             doc='What to do with intermediate workspaces.')
        self.declareProperty(name=common.PROP_SUBALG_LOGGING,
                             defaultValue=common.SUBALG_LOGGING_OFF,
                             validator=StringListValidator([
                                 common.SUBALG_LOGGING_OFF,
                                 common.SUBALG_LOGGING_ON]),
                             direction=Direction.Input,
                             doc='Enable or disable subalgorithms to ' + 'print in the logs.')
        self.declareProperty(name=common.PROP_EPP_METHOD,
                             defaultValue=common.EPP_METHOD_AUTO,
                             validator=StringListValidator([
                                 common.EPP_METHOD_AUTO,
                                 common.EPP_METHOD_FIT,
                                 common.EPP_METHOD_CALCULATE]),
                             direction=Direction.Input,
                             doc='Method to create the EPP table for detectors (monitor is awlays fitted).')
        self.declareProperty(name=common.PROP_EPP_SIGMA,
                             defaultValue=Property.EMPTY_DBL,
                             validator=positiveFloat,
                             direction=Direction.Input,
                             doc='Nominal sigma for the EPP table when ' + common.PROP_EPP_METHOD
                                 + ' is set to ' + common.EPP_METHOD_CALCULATE
                                 + ' (default: 10 times the first bin width).')
        self.declareProperty(name=common.PROP_ELASTIC_CHANNEL_MODE,
                             defaultValue=common.ELASTIC_CHANNEL_AUTO,
                             validator=StringListValidator([
                                 common.ELASTIC_CHANNEL_AUTO,
                                 common.ELASTIC_CHANNEL_SAMPLE_LOG,
                                 common.ELASTIC_CHANNEL_FIT]),
                             direction=Direction.Input,
                             doc='How to acquire the nominal elastic channel.')
        self.declareProperty(MatrixWorkspaceProperty(
                             name=common.PROP_ELASTIC_CHANNEL_WS,
                             defaultValue='',
                             direction=Direction.Input,
                             optional=PropertyMode.Optional),
                             doc='A single value workspace containing the nominal elastic channel index'
                                 '(can be floating point). Overrides {}.'.format(common.PROP_ELASTIC_CHANNEL_MODE))
        self.declareProperty(name=common.PROP_MON_INDEX,
                             defaultValue=Property.EMPTY_INT,
                             validator=positiveInt,
                             direction=Direction.Input,
                             doc='Index of the incident monitor, if not specified in instrument parameters.')
        self.declareProperty(name=common.PROP_INCIDENT_ENERGY_CALIBRATION,
                             defaultValue=common.INCIDENT_ENERGY_CALIBRATION_AUTO,
                             validator=StringListValidator([
                                 common.INCIDENT_ENERGY_CALIBRATION_AUTO,
                                 common.INCIDENT_ENERGY_CALIBRATION_ON,
                                 common.INCIDENT_ENERGY_CALIBRATION_OFF]),
                             direction=Direction.Input,
                             doc='Control the incident energy calibration.')
        self.setPropertyGroup(common.PROP_INCIDENT_ENERGY_CALIBRATION, PROPGROUP_INCIDENT_ENERGY_CALIBRATION)
        self.declareProperty(MatrixWorkspaceProperty(
            name=common.PROP_INCIDENT_ENERGY_WS,
            defaultValue='',
            direction=Direction.Input,
            optional=PropertyMode.Optional),
            doc='A single-valued workspace holding a previously determined ' + 'incident energy.')
        self.setPropertyGroup(common.PROP_INCIDENT_ENERGY_WS, PROPGROUP_INCIDENT_ENERGY_CALIBRATION)
        self.declareProperty(name=common.PROP_FLAT_BKG,
                             defaultValue=common.BKG_AUTO,
                             validator=StringListValidator([
                                 common.BKG_AUTO,
                                 common.BKG_ON,
                                 common.BKG_OFF]),
                             direction=Direction.Input,
                             doc='Control flat background subtraction.')
        self.setPropertyGroup(common.PROP_FLAT_BKG, PROPGROUP_FLAT_BKG)
        self.declareProperty(name=common.PROP_FLAT_BKG_SCALING,
                             defaultValue=1.0,
                             validator=positiveFloat,
                             direction=Direction.Input,
                             doc='Flat background multiplication factor.')
        self.setPropertyGroup(common.PROP_FLAT_BKG_SCALING, PROPGROUP_FLAT_BKG)
        self.declareProperty(name=common.PROP_FLAT_BKG_WINDOW,
                             defaultValue=30,
                             validator=mandatoryPositiveInt,
                             direction=Direction.Input,
                             doc='Running average window width (in bins) for flat background.')
        self.setPropertyGroup(common.PROP_FLAT_BKG_WINDOW, PROPGROUP_FLAT_BKG)
        self.declareProperty(MatrixWorkspaceProperty(
            name=common.PROP_FLAT_BKG_WS,
            defaultValue='',
            direction=Direction.Input,
            optional=PropertyMode.Optional),
            doc='Workspace with previously determined flat background data.')
        self.setPropertyGroup(common.PROP_FLAT_BKG_WS, PROPGROUP_FLAT_BKG)
        self.declareProperty(name=common.PROP_DET_HOR_GROUPING,
                             defaultValue=1,
                             doc='Step to use when grouping detectors horizontally (between tubes) to increase'
                                 ' the statistics for flat background calculation.')
        self.setPropertyGroup(common.PROP_DET_HOR_GROUPING, PROPGROUP_FLAT_BKG)
        self.declareProperty(name=common.PROP_DET_VER_GROUPING,
                             defaultValue=1,
                             doc='Step to use when grouping detectors vertically (inside the same tube)'
                                 ' to increase the statistics for flat background calculation.')
        self.setPropertyGroup(common.PROP_DET_VER_GROUPING, PROPGROUP_FLAT_BKG)
        self.declareProperty(name=common.PROP_NORMALISATION,
                             defaultValue=common.NORM_METHOD_MON,
                             validator=StringListValidator([
                                 common.NORM_METHOD_MON,
                                 common.NORM_METHOD_TIME,
                                 common.NORM_METHOD_OFF]),
                             direction=Direction.Input,
                             doc='Normalisation method.')
        self.setPropertyGroup(common.PROP_NORMALISATION, PROPGROUP_MON_NORMALISATION)
        self.declareProperty(name=common.PROP_MON_PEAK_SIGMA_MULTIPLIER,
                             defaultValue=7.0,
                             validator=positiveFloat,
                             direction=Direction.Input,
                             doc="Width of the monitor peak in multiples " + " of 'Sigma' in monitor's EPP table.")
        self.setPropertyGroup(common.PROP_MON_PEAK_SIGMA_MULTIPLIER, PROPGROUP_MON_NORMALISATION)
        # Rest of the output properties.
        self.declareProperty(WorkspaceProperty(
            name=common.PROP_OUTPUT_RAW_WS,
            defaultValue='',
            direction=Direction.Output,
            optional=PropertyMode.Optional),
            doc='Non-normalized and non-background subtracted output workspace for DirectILLDiagnostics.')
        self.setPropertyGroup(common.PROP_OUTPUT_RAW_WS,
                              common.PROPGROUP_OPTIONAL_OUTPUT)
        self.declareProperty(WorkspaceProperty(
            name=common.PROP_OUTPUT_ELASTIC_CHANNEL_WS,
            defaultValue='',
            direction=Direction.Output,
            optional=PropertyMode.Optional),
            doc='Output workspace for elastic channel index.')
        self.setPropertyGroup(common.PROP_OUTPUT_ELASTIC_CHANNEL_WS,
                              common.PROPGROUP_OPTIONAL_OUTPUT)
        self.declareProperty(ITableWorkspaceProperty(
            name=common.PROP_OUTPUT_DET_EPP_WS,
            defaultValue='',
            direction=Direction.Output,
            optional=PropertyMode.Optional),
            doc='Output workspace for elastic peak positions.')
        self.setPropertyGroup(common.PROP_OUTPUT_DET_EPP_WS,
                              common.PROPGROUP_OPTIONAL_OUTPUT)
        self.declareProperty(WorkspaceProperty(
            name=common.PROP_OUTPUT_INCIDENT_ENERGY_WS,
            defaultValue='',
            direction=Direction.Output,
            optional=PropertyMode.Optional),
            doc='Output workspace for calibrated incident energy.')
        self.setPropertyGroup(common.PROP_OUTPUT_INCIDENT_ENERGY_WS,
                              common.PROPGROUP_OPTIONAL_OUTPUT)
        self.declareProperty(WorkspaceProperty(
            name=common.PROP_OUTPUT_FLAT_BKG_WS,
            defaultValue='',
            direction=Direction.Output,
            optional=PropertyMode.Optional),
            doc='Output workspace for flat background.')
        self.setPropertyGroup(common.PROP_OUTPUT_FLAT_BKG_WS,
                              common.PROPGROUP_OPTIONAL_OUTPUT)
示例#20
0
    def PyInit(self):
        # files to reduce
        self.declareProperty(
            MultipleFileProperty(name="Filename",
                                 extensions=["_event.nxs", ".nxs.h5", ".nxs"]),
            "Files to combine in reduction")

        # Filter by time
        self.copyProperties(
            'LoadEventNexus',
            ['FilterByTofMin', 'FilterByTofMax', 'FilterByTimeStop'])

        # UBMatrix
        self.declareProperty(
            FileProperty(name="UBMatrix",
                         defaultValue="",
                         action=FileAction.OptionalLoad,
                         extensions=[".mat", ".ub", ".txt"]),
            doc=
            "Path to an ISAW-style UB matrix text file. See :ref:`LoadIsawUB <algm-LoadIsawUB>`"
        )
        # Goniometer
        self.declareProperty(
            'SetGoniometer', False,
            "Set which Goniometer to use. See :ref:`SetGoniometer <algm-SetGoniometer>`"
        )
        condition = VisibleWhenProperty("SetGoniometer",
                                        PropertyCriterion.IsNotDefault)
        self.copyProperties('SetGoniometer',
                            ['Goniometers', 'Axis0', 'Axis1', 'Axis2'])
        self.setPropertySettings("Goniometers", condition)
        self.setPropertySettings('Axis0', condition)
        self.setPropertySettings('Axis1', condition)
        self.setPropertySettings('Axis2', condition)

        # Corrections
        self.declareProperty(
            FileProperty(name="LoadInstrument",
                         defaultValue="",
                         action=FileAction.OptionalLoad,
                         extensions=[".xml"]),
            "Load a different instrument IDF onto the data from a file. See :ref:`LoadInstrument <algm-LoadInstrument>`"
        )
        self.declareProperty(
            FileProperty(name="DetCal",
                         defaultValue="",
                         action=FileAction.OptionalLoad,
                         extensions=[".detcal"]),
            "Load an ISAW DetCal calibration onto the data from a file. See :ref:`LoadIsawDetCal <algm-LoadIsawDetCal>`"
        )
        self.declareProperty(
            FileProperty(name="MaskFile",
                         defaultValue="",
                         action=FileAction.OptionalLoad,
                         extensions=[".xml", ".msk"]),
            "Masking file for masking. Supported file format is XML and ISIS ASCII. See :ref:`LoadMask <algm-LoadMask>`"
        )

        self.declareProperty(
            WorkspaceProperty("OutputWorkspace",
                              "",
                              optional=PropertyMode.Mandatory,
                              direction=Direction.Output), "Output Workspace")

        # Convert Settings
        self.copyProperties('ConvertToMD', [
            'Uproj', 'Vproj', 'Wproj', 'MinValues', 'MaxValues', 'SplitInto',
            'SplitThreshold', 'MaxRecursionDepth', 'OverwriteExisting'
        ])

        self.setPropertyGroup('FilterByTofMin', 'Loading')
        self.setPropertyGroup('FilterByTofMax', 'Loading')
        self.setPropertyGroup('FilterByTimeStop', 'Loading')

        # Goniometer
        self.setPropertyGroup("SetGoniometer", "Goniometer")
        self.setPropertyGroup("Goniometers", "Goniometer")
        self.setPropertyGroup("Axis0", "Goniometer")
        self.setPropertyGroup("Axis1", "Goniometer")
        self.setPropertyGroup("Axis2", "Goniometer")

        # Corrections
        self.setPropertyGroup("LoadInstrument", "Corrections")
        self.setPropertyGroup("DetCal", "Corrections")
        self.setPropertyGroup("MaskFile", "Corrections")

        # ConvertToMD
        self.setPropertyGroup('Uproj', 'ConvertToMD')
        self.setPropertyGroup('Vproj', 'ConvertToMD')
        self.setPropertyGroup('Wproj', 'ConvertToMD')
        self.setPropertyGroup('MinValues', 'ConvertToMD')
        self.setPropertyGroup('MaxValues', 'ConvertToMD')
        self.setPropertyGroup('SplitInto', 'ConvertToMD')
        self.setPropertyGroup('SplitThreshold', 'ConvertToMD')
        self.setPropertyGroup('MaxRecursionDepth', 'ConvertToMD')
示例#21
0
    def PyInit(self):
        # files to reduce
        self.declareProperty(
            MultipleFileProperty(name="Filename",
                                 extensions=["_event.nxs", ".nxs.h5", ".nxs"]),
            "Files to combine in reduction")

        # background
        self.declareProperty(
            FileProperty(name="Background",
                         defaultValue="",
                         action=FileAction.OptionalLoad,
                         extensions=["_event.nxs", ".nxs.h5", ".nxs"]),
            "Background run")
        self.declareProperty(
            "BackgroundScale",
            1.0,
            doc=
            "The background will be scaled by this number before being subtracted."
        )

        # Filter by TOF
        self.copyProperties('LoadEventNexus',
                            ['FilterByTofMin', 'FilterByTofMax'])

        # Vanadium SA and flux
        self.declareProperty(
            "ReuseSAFlux", True,
            "If True then if a previous SolidAngle and Flux has been loaded "
            "it will be reused otherwise it will be loaded.")
        self.declareProperty(
            FileProperty(name="SolidAngle",
                         defaultValue="",
                         action=FileAction.Load,
                         extensions=[".nxs"]),
            doc=
            "An input workspace containing momentum integrated vanadium (a measure "
            "of the solid angle). See :ref:`MDNormSCDPreprocessIncoherent <algm-MDNormSCDPreprocessIncoherent>` "
            "for details")
        self.declareProperty(
            FileProperty(name="Flux",
                         defaultValue="",
                         action=FileAction.Load,
                         extensions=[".nxs"]),
            "An input workspace containing momentum dependent flux. See :ref:`MDnormSCD <algm-MDnormSCD>` for details"
        )
        self.declareProperty(
            'MomentumMin',
            Property.EMPTY_DBL,
            doc=
            "Minimum value in momentum. The max of this value and the flux momentum minimum will be used."
        )
        self.declareProperty(
            'MomentumMax',
            Property.EMPTY_DBL,
            doc=
            "Maximum value in momentum. The min of this value and the flux momentum maximum will be used."
        )

        # UBMatrix
        self.declareProperty(
            MultipleFileProperty(name="UBMatrix",
                                 extensions=[".mat", ".ub", ".txt"]),
            doc=
            "Path to an ISAW-style UB matrix text file. See :ref:`LoadIsawUB <algm-LoadIsawUB>`"
        )
        # Goniometer
        self.declareProperty(
            'SetGoniometer', False,
            "Set which Goniometer to use. See :ref:`SetGoniometer <algm-SetGoniometer>`"
        )
        condition = VisibleWhenProperty("SetGoniometer",
                                        PropertyCriterion.IsNotDefault)
        self.copyProperties('SetGoniometer',
                            ['Goniometers', 'Axis0', 'Axis1', 'Axis2'])
        self.setPropertySettings("Goniometers", condition)
        self.setPropertySettings('Axis0', condition)
        self.setPropertySettings('Axis1', condition)
        self.setPropertySettings('Axis2', condition)
        self.declareProperty(
            FloatArrayProperty('OmegaOffset', [], direction=Direction.Input),
            doc=
            "Offset to apply to the omega rotation of the Goniometer. Need to provide one value for every run."
        )

        # Corrections
        self.declareProperty(
            FileProperty(name="LoadInstrument",
                         defaultValue="",
                         action=FileAction.OptionalLoad,
                         extensions=[".xml"]),
            "Load a different instrument IDF onto the data from a file. See :ref:`LoadInstrument <algm-LoadInstrument>`"
        )
        self.declareProperty(
            ITableWorkspaceProperty("ApplyCalibration",
                                    '',
                                    optional=PropertyMode.Optional,
                                    direction=Direction.Input),
            doc='Calibration will be applied using this TableWorkspace using '
            ':ref:`ApplyCalibration <algm-ApplyCalibration>`.')
        self.declareProperty(
            FileProperty(name="DetCal",
                         defaultValue="",
                         action=FileAction.OptionalLoad,
                         extensions=[".detcal"]),
            "Load an ISAW DetCal calibration onto the data from a file. "
            "See :ref:`LoadIsawDetCal <algm-LoadIsawDetCal>`")
        self.declareProperty(
            MatrixWorkspaceProperty("CopyInstrumentParameters",
                                    '',
                                    optional=PropertyMode.Optional,
                                    direction=Direction.Input),
            doc=
            'The input workpsace from which :ref:`CopyInstrumentParameters <algm-CopyInstrumentParameters>` '
            'will copy parameters to data')
        self.declareProperty(
            FileProperty(name="MaskFile",
                         defaultValue="",
                         action=FileAction.OptionalLoad,
                         extensions=[".xml", ".msk"]),
            "Masking file for masking. Supported file format is XML and ISIS ASCII. See :ref:`LoadMask <algm-LoadMask>`"
        )

        self.copyProperties('MDNorm', ['SymmetryOperations'])

        self.declareProperty(
            FloatArrayProperty('QDimension0', [1, 0, 0],
                               FloatArrayLengthValidator(3),
                               direction=Direction.Input),
            "The first Q projection axis")
        self.declareProperty(
            FloatArrayProperty('QDimension1', [0, 1, 0],
                               FloatArrayLengthValidator(3),
                               direction=Direction.Input),
            "The second Q projection axis")
        self.declareProperty(
            FloatArrayProperty('QDimension2', [0, 0, 1],
                               FloatArrayLengthValidator(3),
                               direction=Direction.Input),
            "The third Q projection axis")

        self.copyProperties(
            'MDNorm',
            ['Dimension0Binning', 'Dimension1Binning', 'Dimension2Binning'])

        self.declareProperty(
            'KeepTemporaryWorkspaces', False,
            "If True the normalization and data workspaces in addition to the normalized data will be outputted"
        )

        self.declareProperty(
            WorkspaceProperty("OutputWorkspace",
                              "",
                              optional=PropertyMode.Mandatory,
                              direction=Direction.Output),
            "Output Workspace. If background is subtracted _data and _background workspaces will also be made."
        )

        # Background
        self.setPropertyGroup("Background", "Background")
        self.setPropertyGroup("BackgroundScale", "Background")

        # Vanadium
        self.setPropertyGroup("ReuseSAFlux", "Vanadium")
        self.setPropertyGroup("SolidAngle", "Vanadium")
        self.setPropertyGroup("Flux", "Vanadium")
        self.setPropertyGroup("MomentumMin", "Vanadium")
        self.setPropertyGroup("MomentumMax", "Vanadium")

        # Goniometer
        self.setPropertyGroup("SetGoniometer", "Goniometer")
        self.setPropertyGroup("Goniometers", "Goniometer")
        self.setPropertyGroup("Axis0", "Goniometer")
        self.setPropertyGroup("Axis1", "Goniometer")
        self.setPropertyGroup("Axis2", "Goniometer")
        self.setPropertyGroup("OmegaOffset", "Goniometer")

        # Corrections
        self.setPropertyGroup("LoadInstrument", "Corrections")
        self.setPropertyGroup("ApplyCalibration", "Corrections")
        self.setPropertyGroup("DetCal", "Corrections")
        self.setPropertyGroup("CopyInstrumentParameters", "Corrections")
        self.setPropertyGroup("MaskFile", "Corrections")

        # Projection and binning
        self.setPropertyGroup("QDimension0", "Projection and binning")
        self.setPropertyGroup("QDimension1", "Projection and binning")
        self.setPropertyGroup("QDimension2", "Projection and binning")
        self.setPropertyGroup("Dimension0Binning", "Projection and binning")
        self.setPropertyGroup("Dimension1Binning", "Projection and binning")
        self.setPropertyGroup("Dimension2Binning", "Projection and binning")
示例#22
0
    def PyInit(self):

        self.declareProperty(MultipleFileProperty('Run', action=FileAction.OptionalLoad,
                                                  extensions=['nxs'], allow_empty=True),
                             doc='File path of run(s).')

        options = ['Absorber', 'Beam', 'Transmission', 'Container', 'Sample']

        self.declareProperty(name='ProcessAs',
                             defaultValue='Sample',
                             validator=StringListValidator(options),
                             doc='Choose the process type.')

        self.declareProperty(MatrixWorkspaceProperty('OutputWorkspace', '',
                                                     direction=Direction.Output),
                             doc='The output workspace based on the value of ProcessAs.')

        not_absorber = EnabledWhenProperty('ProcessAs', PropertyCriterion.IsNotEqualTo, 'Absorber')

        sample = EnabledWhenProperty('ProcessAs', PropertyCriterion.IsEqualTo, 'Sample')

        beam = EnabledWhenProperty('ProcessAs', PropertyCriterion.IsEqualTo, 'Beam')

        transmission = EnabledWhenProperty('ProcessAs', PropertyCriterion.IsEqualTo, 'Transmission')

        not_beam = EnabledWhenProperty('ProcessAs', PropertyCriterion.IsNotEqualTo, 'Beam')

        container = EnabledWhenProperty('ProcessAs', PropertyCriterion.IsEqualTo, 'Container')

        self.declareProperty(name='NormaliseBy',
                             defaultValue='Timer',
                             validator=StringListValidator(['None', 'Timer', 'Monitor']),
                             doc='Choose the normalisation type.')

        self.declareProperty('BeamRadius', 0.05, validator=FloatBoundedValidator(lower=0.),
                             doc='Beam radius [m]; used for beam center finding, transmission and flux calculations.')

        self.setPropertySettings('BeamRadius',
                                 EnabledWhenProperty(beam, transmission, LogicOperator.Or))

        self.declareProperty('BeamFinderMethod', 'DirectBeam', StringListValidator(['DirectBeam', 'ScatteredBeam']),
                             doc='Choose between direct beam or scattered beam method for beam center finding.')

        self.setPropertySettings('BeamFinderMethod', beam)

        self.declareProperty('SampleThickness', 0.1, validator=FloatBoundedValidator(lower=0.), doc='Sample thickness [cm]')

        self.setPropertySettings('SampleThickness', sample)

        self.declareProperty(MatrixWorkspaceProperty('AbsorberInputWorkspace', '',
                                                     direction=Direction.Input,
                                                     optional=PropertyMode.Optional),
                             doc='The name of the absorber workspace.')

        self.setPropertySettings('AbsorberInputWorkspace', not_absorber)

        self.declareProperty(MatrixWorkspaceProperty('BeamInputWorkspace', '',
                                                     direction=Direction.Input,
                                                     optional=PropertyMode.Optional),
                             doc='The name of the empty beam input workspace.')

        self.setPropertySettings('BeamInputWorkspace',
                                 EnabledWhenProperty(not_absorber, not_beam, LogicOperator.And))

        self.declareProperty(MatrixWorkspaceProperty('TransmissionInputWorkspace', '',
                                                     direction=Direction.Input,
                                                     optional=PropertyMode.Optional),
                             doc='The name of the transmission input workspace.')

        self.setPropertySettings('TransmissionInputWorkspace',
                                 EnabledWhenProperty(container, sample, LogicOperator.Or))

        self.declareProperty(MatrixWorkspaceProperty('ContainerInputWorkspace', '',
                                                     direction=Direction.Input,
                                                     optional=PropertyMode.Optional),
                             doc='The name of the container workspace.')

        self.setPropertySettings('ContainerInputWorkspace', sample)

        self.declareProperty(MatrixWorkspaceProperty('ReferenceInputWorkspace', '',
                                                     direction=Direction.Input,
                                                     optional=PropertyMode.Optional),
                             doc='The name of the reference workspace.')

        self.setPropertySettings('ReferenceInputWorkspace', sample)

        self.declareProperty(MatrixWorkspaceProperty('SensitivityInputWorkspace', '',
                                                     direction=Direction.Input,
                                                     optional=PropertyMode.Optional),
                             doc='The name of the input sensitivity workspace.')

        self.setPropertySettings('SensitivityInputWorkspace',
                                 EnabledWhenProperty(sample,
                                                     EnabledWhenProperty('ReferenceInputWorkspace',
                                                                         PropertyCriterion.IsEqualTo, ''),
                                                     LogicOperator.And))

        self.declareProperty(MatrixWorkspaceProperty('SensitivityOutputWorkspace', '',
                                                     direction=Direction.Output,
                                                     optional=PropertyMode.Optional),
                             doc='The name of the output sensitivity workspace.')

        self.setPropertySettings('SensitivityOutputWorkspace', sample)

        self.declareProperty(MatrixWorkspaceProperty('MaskedInputWorkspace', '',
                                                     direction=Direction.Input,
                                                     optional=PropertyMode.Optional),
                             doc='Workspace to copy the mask from; for example, the beam stop')

        self.setPropertySettings('MaskedInputWorkspace', sample)

        self.declareProperty(MatrixWorkspaceProperty('FluxInputWorkspace', '',
                                                     direction=Direction.Output,
                                                     optional=PropertyMode.Optional),
                             doc='The name of the input direct beam flux workspace.')

        self.setPropertySettings('FluxInputWorkspace', sample)

        self.declareProperty(MatrixWorkspaceProperty('FluxOutputWorkspace', '',
                                                     direction=Direction.Output,
                                                     optional=PropertyMode.Optional),
                             doc='The name of the output direct beam flux workspace.')

        self.setPropertySettings('FluxOutputWorkspace', beam)

        self.declareProperty('CacheSolidAngle', False, doc='Whether or not to cache the solid angle workspace.')

        self.declareProperty('WaterCrossSection', 1., doc='Provide water cross-section; '
                                                          'used only if the absolute scale is done by dividing to water.')

        self.declareProperty(MatrixWorkspaceProperty('DefaultMaskedInputWorkspace', '',
                                                     direction=Direction.Input,
                                                     optional=PropertyMode.Optional),
                             doc='Workspace to copy the mask from; for example, the bad detector edges.')

        self.setPropertySettings('DefaultMaskedInputWorkspace', sample)

        self.declareProperty('ThetaDependent', True,
                             doc='Whether or not to use 2theta dependent transmission correction')

        self.declareProperty(MatrixWorkspaceProperty('InputWorkspace', '', direction=Direction.Input,
                                                     optional=PropertyMode.Optional),
                             doc='Input workspace containing already loaded raw data, used for parameter scans.')
    def PyInit(self):

        self.declareProperty(MultipleFileProperty('Run', extensions=['nxs']),
                             doc='Run number(s) of sample run(s).')

        self.declareProperty(
            MultipleFileProperty('BackgroundRun',
                                 action=FileAction.OptionalLoad,
                                 extensions=['nxs']),
            doc='Run number(s) of background (empty can) run(s).')

        self.declareProperty(
            MultipleFileProperty('CalibrationRun',
                                 action=FileAction.OptionalLoad,
                                 extensions=['nxs']),
            doc='Run number(s) of vanadium calibration run(s).')

        self.declareProperty(
            MultipleFileProperty('CalibrationBackgroundRun',
                                 action=FileAction.OptionalLoad,
                                 extensions=['nxs']),
            doc=
            'Run number(s) of background (empty can) run(s) for vanadium run.')

        self.declareProperty(name='Observable',
                             defaultValue='sample.temperature',
                             doc='Scanning observable, a Sample Log entry\n')

        self.declareProperty(name='SortXAxis',
                             defaultValue=False,
                             doc='Whether or not to sort the x-axis\n')

        self.declareProperty(name='BackgroundScalingFactor',
                             defaultValue=1.,
                             validator=FloatBoundedValidator(lower=0),
                             doc='Scaling factor for background subtraction')

        self.declareProperty(
            name='CalibrationBackgroundScalingFactor',
            defaultValue=1.,
            validator=FloatBoundedValidator(lower=0),
            doc=
            'Scaling factor for background subtraction for vanadium calibration'
        )

        self.declareProperty(
            name='BackgroundOption',
            defaultValue='Sum',
            validator=StringListValidator(['Sum', 'Interpolate']),
            doc='Whether to sum or interpolate the background runs.')

        self.declareProperty(
            name='CalibrationOption',
            defaultValue='Sum',
            validator=StringListValidator(['Sum', 'Interpolate']),
            doc='Whether to sum or interpolate the calibration runs.')

        self.declareProperty(
            name='CalibrationBackgroundOption',
            defaultValue='Sum',
            validator=StringListValidator(['Sum', 'Interpolate']),
            doc=
            'Whether to sum or interpolate the background run for calibration runs.'
        )

        self.declareProperty(
            FileProperty('MapFile',
                         '',
                         action=FileAction.OptionalLoad,
                         extensions=['map', 'xml']),
            doc='Filename of the detector grouping map file to use. \n'
            'By default all the pixels will be summed per each tube. \n'
            'Use .map or .xml file (see GroupDetectors documentation) '
            'only if different range is needed for each tube.')

        self.declareProperty(
            name='ManualPSDIntegrationRange',
            defaultValue=[1, 128],
            doc='Integration range of vertical pixels in each PSD tube. \n'
            'By default all the pixels will be summed per each tube. \n'
            'Use this option if the same range (other than default) '
            'is needed for all the tubes.')

        self.declareProperty(name='Analyser',
                             defaultValue='silicon',
                             validator=StringListValidator(['silicon']),
                             doc='Analyser crystal.')

        self.declareProperty(name='Reflection',
                             defaultValue='111',
                             validator=StringListValidator(['111', '311']),
                             doc='Analyser reflection.')

        self.declareProperty(WorkspaceGroupProperty(
            'OutputWorkspace', '', direction=Direction.Output),
                             doc='Output workspace group')

        self.declareProperty(name='SpectrumAxis',
                             defaultValue='SpectrumNumber',
                             validator=StringListValidator(
                                 ['SpectrumNumber', '2Theta', 'Q', 'Q2']),
                             doc='The spectrum axis conversion target.')

        self.declareProperty(
            name='DiscardSingleDetectors',
            defaultValue=False,
            doc='Whether to discard the spectra of single detectors.')

        self.declareProperty(
            name='ManualInelasticPeakChannels',
            defaultValue=[-1, -1],
            doc=
            'The channel indices for the inelastic peak positions in the beginning '
            'and in the end of the spectra; by default the maxima of the monitor '
            'spectrum will be used for this. The intensities will be integrated symmetrically '
            'around each peak.')
示例#24
0
    def PyInit(self):

        positiveFloat = FloatBoundedValidator(0., exclusive=False)
        validRebinParams = RebinParamsValidator(AllowEmpty=True)
        orderedPairsValidator = FloatArrayOrderedPairsValidator()

        self.declareProperty(
            WorkspaceGroupProperty('OutputWorkspace',
                                   '',
                                   direction=Direction.Output),
            doc='The output workspace group containing reduced data.')

        self.declareProperty(MultipleFileProperty('Runs',
                                                  action=FileAction.Load,
                                                  extensions=['nxs']),
                             doc='Run(s) to be processed.')

        processes = ['Cadmium', 'Empty', 'Vanadium', 'Sample']
        self.declareProperty(name='ProcessAs',
                             defaultValue='Sample',
                             validator=StringListValidator(processes),
                             doc='Choose the process type.')

        reduction_options = ['Powder', 'SingleCrystal']
        self.declareProperty(
            name='ReductionType',
            defaultValue='Powder',
            validator=StringListValidator(reduction_options),
            doc='Choose the appropriate reduction type for the data to process.'
        )

        self.declareProperty(
            'VanadiumWorkspace',
            '',
            doc='File(s) or workspaces containing vanadium data.')

        self.declareProperty('EmptyContainerWorkspace',
                             '',
                             doc='Empty container workspace.')

        self.declareProperty('EmptyContainerScaling',
                             1.0,
                             doc='Scaling factor for the empty container.')

        self.declareProperty(WorkspaceGroupProperty(
            'CadmiumWorkspace',
            '',
            direction=Direction.Input,
            optional=PropertyMode.Optional),
                             doc='Cadmium absorber workspace.')

        self.copyProperties(
            'DirectILLCollectData',
            [common.PROP_FLAT_BKG, common.PROP_FLAT_BKG_WINDOW])

        self.declareProperty(
            'FlatBackgroundSource',
            "",
            doc=
            'File(s) or workspaces containing the source to calculate flat background.'
        )

        self.copyProperties(
            'DirectILLCollectData',
            [common.PROP_FLAT_BKG_SCALING, common.PROP_OUTPUT_FLAT_BKG_WS])

        self.copyProperties('DirectILLReduction', common.PROP_ABSOLUTE_UNITS)

        additional_inputs_group = 'Corrections'
        self.setPropertyGroup('VanadiumWorkspace', additional_inputs_group)
        self.setPropertyGroup('EmptyContainerWorkspace',
                              additional_inputs_group)
        self.setPropertyGroup('EmptyContainerScaling', additional_inputs_group)
        self.setPropertyGroup('CadmiumWorkspace', additional_inputs_group)
        self.setPropertyGroup(common.PROP_FLAT_BKG, additional_inputs_group)
        self.setPropertyGroup(common.PROP_FLAT_BKG_WINDOW,
                              additional_inputs_group)
        self.setPropertyGroup('FlatBackgroundSource', additional_inputs_group)
        self.setPropertyGroup(common.PROP_FLAT_BKG_SCALING,
                              additional_inputs_group)
        self.setPropertyGroup(common.PROP_OUTPUT_FLAT_BKG_WS,
                              additional_inputs_group)
        self.setPropertyGroup(common.PROP_ABSOLUTE_UNITS,
                              additional_inputs_group)

        self.copyProperties(
            'DirectILLCollectData',
            [common.PROP_NORMALISATION, common.PROP_MON_PEAK_SIGMA_MULTIPLIER])

        self.copyProperties('DirectILLCollectData',
                            common.PROP_INCIDENT_ENERGY_CALIBRATION)

        self.declareProperty(
            name='IncidentEnergy',
            defaultValue=0.0,
            validator=positiveFloat,
            doc='Value for the calibrated incident energy (meV).')

        self.copyProperties(
            'DirectILLCollectData',
            [common.PROP_ELASTIC_CHANNEL_MODE, common.PROP_EPP_METHOD])

        self.declareProperty(
            name='ElasticChannelIndex',
            defaultValue=0.0,
            validator=positiveFloat,
            doc=
            'Bin index value for the centre of the elastic peak. Can be a float.'
        )

        self.declareProperty(
            'SampleAngleOffset',
            0.0,
            doc='Value for the offset parameter in omega scan (degrees).')

        calibration_group = 'Calibration'
        self.setPropertyGroup(common.PROP_INCIDENT_ENERGY_CALIBRATION,
                              calibration_group)
        self.setPropertyGroup('IncidentEnergy', calibration_group)
        self.setPropertyGroup('ElasticChannelIndex', calibration_group)
        self.setPropertyGroup(common.PROP_ELASTIC_CHANNEL_MODE,
                              calibration_group)
        self.setPropertyGroup(common.PROP_EPP_METHOD, calibration_group)
        self.setPropertyGroup('SampleAngleOffset', calibration_group)

        # The mask workspace replaces MaskWorkspace parameter from PantherSingle and DiagnosticsWorkspace from directred
        self.declareProperty('MaskWorkspace',
                             '',
                             doc='File(s) or workspaces containing the mask.')

        self.declareProperty(IntArrayProperty(name='MaskedTubes',
                                              values=[],
                                              direction=Direction.Input),
                             doc='List of tubes to be masked.')

        self.declareProperty(
            'MaskThresholdMin',
            0.0,
            doc='Threshold level below which bins will be masked'
            ' to remove empty / background pixels.')

        self.declareProperty(
            'MaskThresholdMax',
            0.0,
            doc='Threshold level above which bins will be masked'
            ' to remove noisy pixels.')

        self.declareProperty(FloatArrayProperty(
            name='MaskedAngles', values=[], validator=orderedPairsValidator),
                             doc='Mask detectors in the given angular range.')

        self.declareProperty(
            'MaskWithVanadium',
            True,
            doc='Whether to mask using vanadium diagnostics workspace.')

        masking_group_name = 'Masking'
        self.setPropertyGroup('MaskWorkspace', masking_group_name)
        self.setPropertyGroup('MaskedTubes', masking_group_name)
        self.setPropertyGroup('MaskThresholdMin', masking_group_name)
        self.setPropertyGroup('MaskThresholdMax', masking_group_name)
        self.setPropertyGroup('MaskedAngles', masking_group_name)
        self.setPropertyGroup('MaskWithVanadium', masking_group_name)

        self.copyProperties(
            'DirectILLReduction',
            [common.PROP_REBINNING_W, common.PROP_REBINNING_PARAMS_W])

        self.declareProperty(FloatArrayProperty(name='MomentumTransferBinning',
                                                validator=validRebinParams),
                             doc='Momentum transfer binning parameters.')

        rebinning_group = 'Binning parameters'
        self.setPropertyGroup(common.PROP_REBINNING_W, rebinning_group)
        self.setPropertyGroup(common.PROP_REBINNING_PARAMS_W, rebinning_group)
        self.setPropertyGroup('MomentumTransferBinning', rebinning_group)

        self.declareProperty(
            name='AbsorptionCorrection',
            defaultValue='None',
            validator=StringListValidator(['None', 'Fast', 'Full']),
            doc='Choice of approach to absorption correction.')

        self.declareProperty(
            name='SelfAttenuationMethod',
            defaultValue='MonteCarlo',
            validator=StringListValidator(['Numerical', 'MonteCarlo']),
            doc='Choice of calculation method for the attenuation calculation.'
        )

        self.declareProperty(PropertyManagerProperty('SampleMaterial'),
                             doc='Sample material definitions.')

        self.declareProperty(PropertyManagerProperty('SampleGeometry'),
                             doc="Dictionary for the sample geometry.")

        self.declareProperty(PropertyManagerProperty('ContainerMaterial'),
                             doc='Container material definitions.')

        self.declareProperty(PropertyManagerProperty('ContainerGeometry'),
                             doc="Dictionary for the container geometry.")

        attenuation_group = 'Sample attenuation'
        self.setPropertyGroup('AbsorptionCorrection', attenuation_group)
        self.setPropertyGroup('SelfAttenuationMethod', attenuation_group)
        self.setPropertyGroup('SampleMaterial', attenuation_group)
        self.setPropertyGroup('SampleGeometry', attenuation_group)
        self.setPropertyGroup('ContainerMaterial', attenuation_group)
        self.setPropertyGroup('ContainerGeometry', attenuation_group)

        self.declareProperty(
            name=common.PROP_DET_GROUPING,
            defaultValue="",
            doc='Grouping pattern to reduce the granularity of the output.')

        self.declareProperty(
            name=common.PROP_DET_GROUPING_BY,
            defaultValue=1,
            doc=
            'Step to use when grouping detectors to reduce the granularity of the output.'
        )

        self.copyProperties(
            'DirectILLCollectData',
            [common.PROP_DET_HOR_GROUPING, common.PROP_DET_VER_GROUPING])

        self.declareProperty(
            name="ApplyGroupingBy",
            defaultValue=False,
            doc=
            'Whether to apply the pixel grouping horizontally or vertically to the data, and not'
            ' only to increase the statistics of the flat background calculation.'
        )

        self.declareProperty(
            name=common.PROP_GROUPING_ANGLE_STEP,
            defaultValue=0.0,
            validator=positiveFloat,
            doc=
            'A scattering angle step to which to group detectors, in degrees.')

        self.declareProperty(
            name='GroupingBehaviour',
            defaultValue="Sum",
            validator=StringListValidator(['Sum', 'Average']),
            doc='Defines which behaviour should be used when grouping pixels.')

        grouping_options_group = 'Grouping options'
        self.setPropertyGroup(common.PROP_DET_GROUPING, grouping_options_group)
        self.setPropertyGroup(common.PROP_DET_GROUPING_BY,
                              grouping_options_group)
        self.setPropertyGroup(common.PROP_DET_HOR_GROUPING,
                              grouping_options_group)
        self.setPropertyGroup(common.PROP_DET_VER_GROUPING,
                              grouping_options_group)
        self.setPropertyGroup('ApplyGroupingBy', grouping_options_group)
        self.setPropertyGroup(common.PROP_GROUPING_ANGLE_STEP,
                              grouping_options_group)
        self.setPropertyGroup('GroupingBehaviour', grouping_options_group)

        self.declareProperty(
            name="SaveOutput",
            defaultValue=True,
            doc="Whether to save the output directly after processing.")

        self.declareProperty(name='ClearCache',
                             defaultValue=False,
                             doc='Whether to clear intermediate workspaces.')
示例#25
0
    def PyInit(self):
        # files to reduce
        self.declareProperty(
            MultipleFileProperty(name="Filename",
                                 extensions=["_event.nxs", ".nxs.h5", ".nxs"]),
            "Files to combine in reduction")

        # background
        self.declareProperty(
            FileProperty(name="Background",
                         defaultValue="",
                         action=FileAction.OptionalLoad,
                         extensions=["_event.nxs", ".nxs.h5", ".nxs"]),
            "Background run")
        self.declareProperty(
            "BackgroundScale",
            1.0,
            doc=
            "The background will be scaled by this number before being subtracted."
        )

        # Filter by TOF
        self.copyProperties('LoadEventNexus',
                            ['FilterByTofMin', 'FilterByTofMax'])

        # Cropping
        self.declareProperty('MomentumMin',
                             Property.EMPTY_DBL,
                             doc="Minimum value in momentum.",
                             validator=FloatMandatoryValidator())
        self.declareProperty('MomentumMax',
                             Property.EMPTY_DBL,
                             doc="Maximum value in momentum.",
                             validator=FloatMandatoryValidator())

        # Grouping
        self.declareProperty(
            FileProperty(name="GroupingFile",
                         defaultValue="",
                         action=FileAction.OptionalLoad,
                         extensions=[".xml", ".map"]),
            "A file that consists of lists of spectra numbers to group. See :ref:`GroupDetectors <algm-GroupDetectors>`"
        )

        # Corrections
        self.declareProperty(
            'NormaliseByCurrent', True,
            "Normalise the Solid Angle workspace by the proton charge.")
        self.declareProperty(
            FileProperty(name="LoadInstrument",
                         defaultValue="",
                         action=FileAction.OptionalLoad,
                         extensions=[".xml"]),
            "Load a different instrument IDF onto the data from a file. See :ref:`LoadInstrument <algm-LoadInstrument>`"
        )
        self.declareProperty(
            FileProperty(name="DetCal",
                         defaultValue="",
                         action=FileAction.OptionalLoad,
                         extensions=[".detcal"]),
            "Load an ISAW DetCal calibration onto the data from a file. See :ref:`LoadIsawDetCal <algm-LoadIsawDetCal>`"
        )
        self.declareProperty(
            FileProperty(name="MaskFile",
                         defaultValue="",
                         action=FileAction.OptionalLoad,
                         extensions=[".xml", ".msk"]),
            "Masking file for masking. Supported file format is XML and ISIS ASCII. See :ref:`LoadMask <algm-LoadMask>`"
        )
        # Anvred
        self.declareProperty(
            'SphericalAbsorptionCorrection', False,
            "Apply Spherical Absorption correction using :ref:`AnvredCorrection <algm-AnvredCorrection>`"
        )
        condition = VisibleWhenProperty("SphericalAbsorptionCorrection",
                                        PropertyCriterion.IsNotDefault)
        self.copyProperties(
            'AnvredCorrection',
            ['LinearScatteringCoef', 'LinearAbsorptionCoef', 'Radius'])
        self.setPropertySettings("LinearScatteringCoef", condition)
        self.setPropertySettings("LinearAbsorptionCoef", condition)
        self.setPropertySettings("Radius", condition)

        # Output
        self.declareProperty(
            WorkspaceProperty("SolidAngleOutputWorkspace",
                              "",
                              optional=PropertyMode.Mandatory,
                              direction=Direction.Output),
            "Output Workspace for Solid Angle")

        self.declareProperty(
            WorkspaceProperty("FluxOutputWorkspace",
                              "",
                              optional=PropertyMode.Mandatory,
                              direction=Direction.Output),
            "Output Workspace for Flux")

        # Background
        self.setPropertyGroup("Background", "Background")
        self.setPropertyGroup("BackgroundScale", "Background")

        # Corrections
        self.setPropertyGroup("NormaliseByCurrent", "Corrections")
        self.setPropertyGroup("LoadInstrument", "Corrections")
        self.setPropertyGroup("DetCal", "Corrections")
        self.setPropertyGroup("MaskFile", "Corrections")
        self.setPropertyGroup("SphericalAbsorptionCorrection", "Corrections")
        self.setPropertyGroup("LinearScatteringCoef", "Corrections")
        self.setPropertyGroup("LinearAbsorptionCoef", "Corrections")
        self.setPropertyGroup("Radius", "Corrections")
示例#26
0
    def PyInit(self):

        self.declareProperty(MultipleFileProperty('Run', extensions=['nxs']),
                             doc='File path of run(s).')

        options = [
            'Absorber', 'Beam', 'Transmission', 'Container', 'Reference',
            'Sample'
        ]

        self.declareProperty(name='ProcessAs',
                             defaultValue='Sample',
                             validator=StringListValidator(options),
                             doc='Choose the process type.')

        self.declareProperty(
            MatrixWorkspaceProperty('OutputWorkspace',
                                    '',
                                    direction=Direction.Output),
            doc='The output workspace based on the value of ProcessAs.')

        not_absorber = EnabledWhenProperty('ProcessAs',
                                           PropertyCriterion.IsNotEqualTo,
                                           'Absorber')

        sample = EnabledWhenProperty('ProcessAs', PropertyCriterion.IsEqualTo,
                                     'Sample')

        beam = EnabledWhenProperty('ProcessAs', PropertyCriterion.IsEqualTo,
                                   'Beam')

        transmission = EnabledWhenProperty('ProcessAs',
                                           PropertyCriterion.IsEqualTo,
                                           'Transmission')

        not_beam = EnabledWhenProperty('ProcessAs',
                                       PropertyCriterion.IsNotEqualTo, 'Beam')

        reference = EnabledWhenProperty('ProcessAs',
                                        PropertyCriterion.IsEqualTo,
                                        'Reference')

        container = EnabledWhenProperty('ProcessAs',
                                        PropertyCriterion.IsEqualTo,
                                        'Container')

        self.declareProperty(name='NormaliseBy',
                             defaultValue='Timer',
                             validator=StringListValidator(
                                 ['None', 'Timer', 'Monitor']),
                             doc='Choose the normalisation type.')

        self.declareProperty(
            'BeamRadius',
            0.05,
            validator=FloatBoundedValidator(lower=0.),
            doc=
            'Beam raduis [m]; used for beam center finding and transmission calculations.'
        )

        self.setPropertySettings(
            'BeamRadius',
            EnabledWhenProperty(beam, transmission, LogicOperator.Or))

        self.declareProperty(
            'BeamFinderMethod',
            'DirectBeam',
            StringListValidator(['DirectBeam', 'ScatteredBeam']),
            doc=
            'Choose between direct beam or scattered beam method for beam center finding.'
        )

        self.setPropertySettings('BeamFinderMethod', beam)

        self.declareProperty('SampleThickness',
                             0.1,
                             validator=FloatBoundedValidator(lower=0.),
                             doc='Sample thickness [cm]')

        self.setPropertySettings(
            'SampleThickness',
            EnabledWhenProperty(sample, reference, LogicOperator.Or))

        self.declareProperty(MatrixWorkspaceProperty(
            'AbsorberInputWorkspace',
            '',
            direction=Direction.Input,
            optional=PropertyMode.Optional),
                             doc='The name of the absorber workspace.')

        self.setPropertySettings('AbsorberInputWorkspace', not_absorber)

        self.declareProperty(MatrixWorkspaceProperty(
            'BeamInputWorkspace',
            '',
            direction=Direction.Input,
            optional=PropertyMode.Optional),
                             doc='The name of the empty beam input workspace.')

        self.setPropertySettings(
            'BeamInputWorkspace',
            EnabledWhenProperty(not_absorber, not_beam, LogicOperator.And))

        self.declareProperty(
            MatrixWorkspaceProperty('TransmissionInputWorkspace',
                                    '',
                                    direction=Direction.Input,
                                    optional=PropertyMode.Optional),
            doc='The name of the transmission input workspace.')

        self.setPropertySettings(
            'TransmissionInputWorkspace',
            EnabledWhenProperty(
                container,
                EnabledWhenProperty(reference, sample, LogicOperator.Or),
                LogicOperator.Or))

        self.declareProperty(MatrixWorkspaceProperty(
            'ContainerInputWorkspace',
            '',
            direction=Direction.Input,
            optional=PropertyMode.Optional),
                             doc='The name of the container workspace.')

        self.setPropertySettings(
            'ContainerInputWorkspace',
            EnabledWhenProperty(sample, reference, LogicOperator.Or))

        self.declareProperty(MatrixWorkspaceProperty(
            'ReferenceInputWorkspace',
            '',
            direction=Direction.Input,
            optional=PropertyMode.Optional),
                             doc='The name of the reference workspace.')

        self.setPropertySettings('ReferenceInputWorkspace', sample)

        self.declareProperty(
            MatrixWorkspaceProperty('SensitivityInputWorkspace',
                                    '',
                                    direction=Direction.Input,
                                    optional=PropertyMode.Optional),
            doc='The name of the input sensitivity workspace.')

        self.setPropertySettings(
            'SensitivityInputWorkspace',
            EnabledWhenProperty(
                sample,
                EnabledWhenProperty('ReferenceInputWorkspace',
                                    PropertyCriterion.IsEqualTo, ''),
                LogicOperator.And))

        self.declareProperty(
            MatrixWorkspaceProperty('SensitivityOutputWorkspace',
                                    '',
                                    direction=Direction.Output,
                                    optional=PropertyMode.Optional),
            doc='The name of the output sensitivity workspace.')

        self.setPropertySettings('SensitivityOutputWorkspace', reference)

        self.declareProperty(
            MatrixWorkspaceProperty('MaskedInputWorkspace',
                                    '',
                                    direction=Direction.Input,
                                    optional=PropertyMode.Optional),
            doc='Workspace to copy the mask from; for example, the beam stop')

        self.setPropertySettings(
            'MaskedInputWorkspace',
            EnabledWhenProperty(sample, reference, LogicOperator.Or))

        self.declareProperty(
            MatrixWorkspaceProperty('FluxInputWorkspace',
                                    '',
                                    direction=Direction.Output,
                                    optional=PropertyMode.Optional),
            doc='The name of the input direct beam flux workspace.')

        self.setPropertySettings('FluxInputWorkspace', sample)

        self.declareProperty(
            MatrixWorkspaceProperty('FluxOutputWorkspace',
                                    '',
                                    direction=Direction.Output,
                                    optional=PropertyMode.Optional),
            doc='The name of the output direct beam flux workspace.')

        self.setPropertySettings('FluxOutputWorkspace', beam)
 def PyInit(self):
     """Initialize the input and output properties of the algorithm."""
     nonnegativeInt = IntBoundedValidator(lower=0)
     wsIndexRange = IntBoundedValidator(lower=0, upper=255)
     nonnegativeIntArray = IntArrayBoundedValidator(lower=0)
     maxTwoNonnegativeInts = CompositeValidator()
     maxTwoNonnegativeInts.add(IntArrayLengthValidator(lenmin=0, lenmax=2))
     maxTwoNonnegativeInts.add(nonnegativeIntArray)
     self.declareProperty(MultipleFileProperty(
         Prop.RUN, action=FileAction.OptionalLoad, extensions=['nxs']),
                          doc='A list of input run numbers/files.')
     self.declareProperty(
         MatrixWorkspaceProperty(Prop.INPUT_WS,
                                 defaultValue='',
                                 direction=Direction.Input,
                                 validator=WorkspaceUnitValidator('TOF'),
                                 optional=PropertyMode.Optional),
         doc='An input workspace (units TOF) if no Run is specified.')
     self.declareProperty(
         MatrixWorkspaceProperty(Prop.OUTPUT_WS,
                                 defaultValue='',
                                 direction=Direction.Output),
         doc=
         'The preprocessed output workspace (unit wavelength), single histogram.'
     )
     self.declareProperty(
         Prop.TWO_THETA,
         defaultValue=Property.EMPTY_DBL,
         doc='A user-defined scattering angle 2 theta (unit degrees).')
     self.declareProperty(
         name=Prop.LINE_POSITION,
         defaultValue=Property.EMPTY_DBL,
         doc=
         'A workspace index corresponding to the beam centre between 0.0 and 255.0.'
     )
     self.declareProperty(MatrixWorkspaceProperty(
         Prop.DIRECT_LINE_WORKSPACE,
         defaultValue='',
         direction=Direction.Input,
         optional=PropertyMode.Optional),
                          doc='A pre-processed direct beam workspace.')
     self.declareProperty(Prop.SUBALG_LOGGING,
                          defaultValue=SubalgLogging.OFF,
                          validator=StringListValidator(
                              [SubalgLogging.OFF, SubalgLogging.ON]),
                          doc='Enable or disable child algorithm logging.')
     self.declareProperty(
         Prop.CLEANUP,
         defaultValue=utils.Cleanup.ON,
         validator=StringListValidator(
             [utils.Cleanup.ON, utils.Cleanup.OFF]),
         doc='Enable or disable intermediate workspace cleanup.')
     self.declareProperty(MatrixWorkspaceProperty(
         Prop.WATER_REFERENCE,
         defaultValue='',
         direction=Direction.Input,
         validator=WorkspaceUnitValidator("TOF"),
         optional=PropertyMode.Optional),
                          doc='A (water) calibration workspace (unit TOF).')
     self.declareProperty(Prop.SLIT_NORM,
                          defaultValue=SlitNorm.OFF,
                          validator=StringListValidator(
                              [SlitNorm.OFF, SlitNorm.ON]),
                          doc='Enable or disable slit normalisation.')
     self.declareProperty(Prop.FLUX_NORM_METHOD,
                          defaultValue=FluxNormMethod.TIME,
                          validator=StringListValidator([
                              FluxNormMethod.TIME, FluxNormMethod.MONITOR,
                              FluxNormMethod.OFF
                          ]),
                          doc='Neutron flux normalisation method.')
     self.declareProperty(
         IntArrayProperty(Prop.FOREGROUND_HALF_WIDTH,
                          validator=maxTwoNonnegativeInts),
         doc=
         'Number of foreground pixels at lower and higher angles from the centre pixel.'
     )
     self.declareProperty(
         Prop.BKG_METHOD,
         defaultValue=BkgMethod.CONSTANT,
         validator=StringListValidator(
             [BkgMethod.CONSTANT, BkgMethod.LINEAR, BkgMethod.OFF]),
         doc='Flat background calculation method for background subtraction.'
     )
     self.declareProperty(
         Prop.LOW_BKG_OFFSET,
         defaultValue=7,
         validator=nonnegativeInt,
         doc=
         'Distance of flat background region towards smaller detector angles from the '
         + 'foreground centre, in pixels.')
     self.declareProperty(
         Prop.LOW_BKG_WIDTH,
         defaultValue=5,
         validator=nonnegativeInt,
         doc=
         'Width of flat background region towards smaller detector angles from the '
         + 'foreground centre, in pixels.')
     self.declareProperty(
         Prop.HIGH_BKG_OFFSET,
         defaultValue=7,
         validator=nonnegativeInt,
         doc=
         'Distance of flat background region towards larger detector angles from the '
         + 'foreground centre, in pixels.')
     self.declareProperty(
         Prop.HIGH_BKG_WIDTH,
         defaultValue=5,
         validator=nonnegativeInt,
         doc=
         'Width of flat background region towards larger detector angles from the '
         + 'foreground centre, in pixels.')
     self.declareProperty(
         Prop.START_WS_INDEX,
         validator=wsIndexRange,
         defaultValue=0,
         doc='Start workspace index used for peak fitting.')
     self.declareProperty(Prop.END_WS_INDEX,
                          validator=wsIndexRange,
                          defaultValue=255,
                          doc='Last workspace index used for peak fitting.')
     self.declareProperty(
         Prop.XMIN,
         defaultValue=Property.EMPTY_DBL,
         doc='Minimum x value (unit Angstrom) used for peak fitting.')
     self.declareProperty(
         Prop.XMAX,
         defaultValue=Property.EMPTY_DBL,
         doc='Maximum x value (unit Angstrom) used for peak fitting.')
示例#28
0
    def PyInit(self):
        self.declareProperty(
            MultipleFileProperty('CalibrationRun',
                                 action=FileAction.Load,
                                 extensions=['nxs']),
            doc=
            'File path of calibration runs (numors). Must be detector scans.')

        self.declareProperty(
            FileProperty('CalibrationFile',
                         '',
                         action=FileAction.OptionalLoad,
                         extensions=['nxs']),
            doc='Optional file containing previous calibration constants.')

        self.declareProperty(
            name='CalibrationMethod',
            defaultValue='Median',
            validator=StringListValidator(['Median', 'Mean',
                                           'MostLikelyMean']),
            doc='The method of how the calibration constant of a pixel '
            'is derived from the distribution of ratios.')

        self.declareProperty(
            name='DerivationMethod',
            defaultValue='SequentialSummedReference1D',
            validator=StringListValidator(
                ['SequentialSummedReference1D', 'GlobalSummedReference2D']),
            doc=
            'Choose sequential for D20 (1D detector), global for D2B (2D detector).'
        )

        self.declareProperty(
            name='InterpolateOverlappingAngles',
            defaultValue=False,
            doc=
            'Whether to interpolate scattering angle values in overlapping regions (D20 only).'
        )

        self.declareProperty(
            name='NormaliseTo',
            defaultValue='None',
            validator=StringListValidator(['None', 'Monitor', 'ROI']),
            doc=
            'Normalise to monitor or ROI counts before deriving the calibration.'
        )

        thetaRangeValidator = FloatArrayOrderedPairsValidator()

        self.declareProperty(
            FloatArrayProperty(name='ROI',
                               values=[0, 100.],
                               validator=thetaRangeValidator),
            doc=
            'Scattering angle regions of interest for normalisation [degrees].'
        )

        normaliseToROI = VisibleWhenProperty('NormaliseTo',
                                             PropertyCriterion.IsEqualTo,
                                             'ROI')
        self.setPropertySettings('ROI', normaliseToROI)

        self.declareProperty(
            FloatArrayProperty(name='ExcludedRange',
                               values=[],
                               validator=thetaRangeValidator),
            doc='Scattering angle regions to exclude from the computation of '
            'relative calibration constants; for example, the beam stop [degrees]. '
        )

        pixelRangeValidator = CompositeValidator()
        greaterThanOne = IntArrayBoundedValidator(lower=1)
        lengthTwo = IntArrayLengthValidator()
        lengthTwo.setLength(2)
        orderedPairsValidator = IntArrayOrderedPairsValidator()
        pixelRangeValidator.add(greaterThanOne)
        pixelRangeValidator.add(lengthTwo)
        pixelRangeValidator.add(orderedPairsValidator)

        self.declareProperty(
            IntArrayProperty(name='PixelRange',
                             values=[1, 3072],
                             validator=pixelRangeValidator),
            doc=
            'Range of the pixel numbers to compute the calibration factors for (D20 only); '
            'for the other pixels outside the range, the factor will be set to 1.'
        )

        self.declareProperty(
            MatrixWorkspaceProperty('OutputResponseWorkspace',
                                    '',
                                    optional=PropertyMode.Optional,
                                    direction=Direction.Output),
            doc=
            'Output workspace containing the summed diffraction patterns of all the overlapping pixels.'
        )

        self.declareProperty(
            MatrixWorkspaceProperty('OutputWorkspace',
                                    '',
                                    direction=Direction.Output),
            doc=
            'Output workspace containing the calibration constants (inverse of efficiency) for each pixel.'
        )

        self.declareProperty(
            name='NumberOfIterations',
            defaultValue=1,
            validator=IntBoundedValidator(lower=0, upper=10),
            doc=
            'Number of iterations to perform (D2B only): 0 means auto; that is, the '
            'iterations will terminate after reaching some Chi2/NdoF.')

        maskCriterionValidator = CompositeValidator()
        arrayLengthTwo = FloatArrayLengthValidator()
        arrayLengthTwo.setLengthMax(2)
        orderedPairs = FloatArrayOrderedPairsValidator()
        maskCriterionValidator.add(arrayLengthTwo)
        maskCriterionValidator.add(orderedPairs)

        self.declareProperty(
            FloatArrayProperty(name='MaskCriterion',
                               values=[],
                               validator=maskCriterionValidator),
            doc='Efficiency constants outside this range will be set to zero.')

        self.declareProperty(
            name='UseCalibratedData',
            defaultValue=False,
            doc=
            'Whether or not to use the calibrated data in the NeXus files (D2B only).'
        )
示例#29
0
    def PyInit(self):
        validator = IntArrayBoundedValidator()
        validator.setLower(0)
        self.declareProperty(
            IntArrayProperty("RunNumbers",
                             values=[0],
                             direction=Direction.Input,
                             validator=validator),
            "Run numbers to process, comma separated")

        self.declareProperty(
            "LiveData", False,
            "Read live data - requires a saved run in the current IPTS " +
            "with the same Instrument configuration as the live run")

        mask = [
            "None", "Horizontal", "Vertical", "Masking Workspace",
            "Custom - xml masking file"
        ]
        self.declareProperty("Masking", "None", StringListValidator(mask),
                             "Mask to be applied to the data")

        self.declareProperty(
            WorkspaceProperty("MaskingWorkspace", "", Direction.Input,
                              PropertyMode.Optional),
            "The workspace containing the mask.")

        self.declareProperty(FileProperty(name="MaskingFilename",
                                          defaultValue="",
                                          direction=Direction.Input,
                                          action=FileAction.OptionalLoad),
                             doc="The file containing the xml mask.")

        self.declareProperty(
            name="Calibration",
            defaultValue="Convert Units",
            validator=StringListValidator(
                ['Convert Units', 'Calibration File', 'DetCal File']),
            direction=Direction.Input,
            doc="The type of conversion to d_spacing to be used.")

        self.declareProperty(
            FileProperty(name="CalibrationFilename",
                         defaultValue="",
                         direction=Direction.Input,
                         action=FileAction.OptionalLoad),
            doc="The calibration file to convert to d_spacing.")

        self.declareProperty(
            MultipleFileProperty(name='DetCalFilename',
                                 extensions=['.detcal'],
                                 action=FileAction.OptionalLoad),
            'ISAW DetCal file')

        self.declareProperty(
            FloatArrayProperty("Binning", [0.5, -0.004, 7.0]),
            "Min, Step, and Max of d-space bins.  Logarithmic binning is used if Step is negative."
        )

        nor_corr = [
            "None", "From Workspace", "From Processed Nexus",
            "Extracted from Data"
        ]
        self.declareProperty(
            "Normalization", "None", StringListValidator(nor_corr),
            "If needed what type of input to use as normalization, Extracted from "
            +
            "Data uses a background determination that is peak independent.This "
            +
            "implemantation can be tested in algorithm SNAP Peak Clipping Background"
        )

        self.declareProperty(
            FileProperty(name="NormalizationFilename",
                         defaultValue="",
                         direction=Direction.Input,
                         action=FileAction.OptionalLoad),
            doc="The file containing the processed nexus for normalization.")

        self.declareProperty(
            WorkspaceProperty("NormalizationWorkspace", "", Direction.Input,
                              PropertyMode.Optional),
            "The workspace containing the normalization data.")

        self.declareProperty(
            "PeakClippingWindowSize", 10,
            "Read live data - requires a saved run in the current " +
            "IPTS with the same Instrumnet configuration")

        self.declareProperty(
            "SmoothingRange", 10,
            "Read live data - requires a saved run in the " +
            "current IPTS with the same Instrumnet configuration")

        grouping = ["All", "Column", "Banks", "Modules", "2_4 Grouping"]
        self.declareProperty(
            "GroupDetectorsBy", "All", StringListValidator(grouping),
            "Detector groups to use for future focussing: " +
            "All detectors as one group, Groups (East,West for " +
            "SNAP), Columns for SNAP, detector banks")

        mode = ["Set-Up", "Production"]
        self.declareProperty(
            "ProcessingMode", "Production", StringListValidator(mode),
            "Set-Up Mode is used for establishing correct parameters. Production "
            + "Mode only Normalized workspace is kept for each run.")

        self.declareProperty(
            name="OptionalPrefix",
            defaultValue="",
            direction=Direction.Input,
            doc="Optional Prefix to be added to workspaces and output filenames"
        )

        self.declareProperty(
            "SaveData", False, "Save data in the following formats: Ascii- " +
            "d-spacing ,Nexus Processed,GSAS and Fullprof")

        self.declareProperty(FileProperty(name="OutputDirectory",
                                          defaultValue="",
                                          action=FileAction.OptionalDirectory),
                             doc='Default value is proposal shared directory')
示例#30
0
    def PyInit(self):
        # files to reduce
        self.declareProperty(
            MultipleFileProperty(name="Filename",
                                 extensions=["_event.nxs", ".nxs.h5", ".nxs"]),
            "Files to combine in reduction")

        # background
        self.declareProperty(
            FileProperty(name="Background",
                         defaultValue="",
                         action=FileAction.OptionalLoad,
                         extensions=["_event.nxs", ".nxs.h5", ".nxs"]),
            "Background run")
        self.declareProperty(
            "BackgroundScale",
            1.0,
            doc=
            "The background will be scaled by this number before being subtracted."
        )

        # Filter by TOF
        self.copyProperties('LoadEventNexus',
                            ['FilterByTofMin', 'FilterByTofMax'])

        # Vanadium SA and flux
        self.declareProperty(
            FileProperty(name="SolidAngle",
                         defaultValue="",
                         action=FileAction.Load,
                         extensions=[".nxs"]),
            doc=
            "An input workspace containing momentum integrated vanadium (a measure"
            "of the solid angle). See :ref:`MDnormSCD <algm-MDnormSCD>` for details"
        )
        self.declareProperty(
            FileProperty(name="Flux",
                         defaultValue="",
                         action=FileAction.Load,
                         extensions=[".nxs"]),
            "An input workspace containing momentum dependent flux. See :ref:`MDnormSCD <algm-MDnormSCD>` for details"
        )

        # UBMatrix
        self.declareProperty(
            FileProperty(name="UBMatrix",
                         defaultValue="",
                         action=FileAction.Load,
                         extensions=[".mat", ".ub", ".txt"]),
            doc=
            "Path to an ISAW-style UB matrix text file. See :ref:`LoadIsawUB <algm-LoadIsawUB>`"
        )
        # Goniometer
        self.declareProperty(
            'SetGoniometer', False,
            "Set which Goniometer to use. See :ref:`SetGoniometer <algm-SetGoniometer>`"
        )
        condition = VisibleWhenProperty("SetGoniometer",
                                        PropertyCriterion.IsNotDefault)
        self.copyProperties('SetGoniometer',
                            ['Goniometers', 'Axis0', 'Axis1', 'Axis2'])
        self.setPropertySettings("Goniometers", condition)
        self.setPropertySettings('Axis0', condition)
        self.setPropertySettings('Axis1', condition)
        self.setPropertySettings('Axis2', condition)

        # Corrections
        self.declareProperty(
            FileProperty(name="LoadInstrument",
                         defaultValue="",
                         action=FileAction.OptionalLoad,
                         extensions=[".xml"]),
            "Load a different instrument IDF onto the data from a file. See :ref:`LoadInstrument <algm-LoadInstrument>`"
        )
        self.declareProperty(
            FileProperty(name="DetCal",
                         defaultValue="",
                         action=FileAction.OptionalLoad,
                         extensions=[".detcal"]),
            "Load an ISAW DetCal calibration onto the data from a file. See :ref:`LoadIsawDetCal <algm-LoadIsawDetCal>`"
        )
        self.declareProperty(
            FileProperty(name="MaskFile",
                         defaultValue="",
                         action=FileAction.OptionalLoad,
                         extensions=[".xml", ".msk"]),
            "Masking file for masking. Supported file format is XML and ISIS ASCII. See :ref:`LoadMask <algm-LoadMask>`"
        )

        # SymmetryOps, name, group unmber or list symmetries
        self.declareProperty(
            "SymmetryOps", "",
            "If specified the symmetry will be applied, can be space group name or number, or list individual symmetries."
        )

        # Binning output
        self.copyProperties('ConvertToMD', ['Uproj', 'Vproj', 'Wproj'])
        self.declareProperty(
            FloatArrayProperty("BinningDim0", [-5.05, 5.05, 101],
                               FloatArrayLengthValidator(3),
                               direction=Direction.Input),
            "Binning parameters for the 0th dimension. Enter it as a"
            "comma-separated list of values with the"
            "format: 'minimum,maximum,number_of_bins'.")
        self.declareProperty(
            FloatArrayProperty("BinningDim1", [-5.05, 5.05, 101],
                               FloatArrayLengthValidator(3),
                               direction=Direction.Input),
            "Binning parameters for the 1st dimension. Enter it as a"
            "comma-separated list of values with the"
            "format: 'minimum,maximum,number_of_bins'.")
        self.declareProperty(
            FloatArrayProperty("BinningDim2", [-5.05, 5.05, 101],
                               FloatArrayLengthValidator(3),
                               direction=Direction.Input),
            "Binning parameters for the 2nd dimension. Enter it as a"
            "comma-separated list of values with the"
            "format: 'minimum,maximum,number_of_bins'.")

        self.declareProperty(
            'KeepTemporaryWorkspaces', False,
            "If True the normalization and data workspaces in addition to the normalized data will be outputted"
        )

        self.declareProperty(
            WorkspaceProperty("OutputWorkspace",
                              "",
                              optional=PropertyMode.Mandatory,
                              direction=Direction.Output),
            "Output Workspace. If background is subtracted _data and _background workspaces will also be made."
        )

        # Background
        self.setPropertyGroup("Background", "Background")
        self.setPropertyGroup("BackgroundScale", "Background")

        # Vanadium
        self.setPropertyGroup("SolidAngle", "Vanadium")
        self.setPropertyGroup("Flux", "Vanadium")

        # Goniometer
        self.setPropertyGroup("SetGoniometer", "Goniometer")
        self.setPropertyGroup("Goniometers", "Goniometer")
        self.setPropertyGroup("Axis0", "Goniometer")
        self.setPropertyGroup("Axis1", "Goniometer")
        self.setPropertyGroup("Axis2", "Goniometer")

        # Corrections
        self.setPropertyGroup("LoadInstrument", "Corrections")
        self.setPropertyGroup("DetCal", "Corrections")
        self.setPropertyGroup("MaskFile", "Corrections")

        # Projection and binning
        self.setPropertyGroup("Uproj", "Projection and binning")
        self.setPropertyGroup("Vproj", "Projection and binning")
        self.setPropertyGroup("Wproj", "Projection and binning")
        self.setPropertyGroup("BinningDim0", "Projection and binning")
        self.setPropertyGroup("BinningDim1", "Projection and binning")
        self.setPropertyGroup("BinningDim2", "Projection and binning")