def PyInit(self):
     validators = CompositeValidator()
     validators.add(HistogramValidator(True))
     validators.add(CommonBinsValidator())
     self.declareProperty(
         MatrixWorkspaceProperty(name='InputWorkspace',
                                 defaultValue='',
                                 direction=Direction.Input,
                                 validator=validators),
         doc=
         'Input MatrixWorkspace containing the reduced inelastic neutron spectrum in (Q,E) or (2theta,E) space.'
     )
     self.declareProperty(name='Temperature',
                          defaultValue=300.,
                          validator=FloatBoundedValidator(lower=0),
                          doc='Sample temperature in Kelvin.')
     self.declareProperty(
         name='MeanSquareDisplacement',
         defaultValue=0.,
         validator=FloatBoundedValidator(lower=0),
         doc='Average mean square displacement in Angstrom^2.')
     self.declareProperty(
         name='QSumRange',
         defaultValue='0,Qmax',
         doc='Range in Q (in Angstroms^-1) to sum data over.')
     self.declareProperty(
         name='EnergyBinning',
         defaultValue='0,Emax/50,Emax*0.9',
         doc=
         'Energy binning parameters [Emin, Emax] or [Emin, Estep, Emax] in meV.'
     )
     self.declareProperty(
         name='Wavenumbers',
         defaultValue=False,
         doc='Should the output be in Wavenumbers (cm^-1)?')
     self.declareProperty(
         name='StatesPerEnergy',
         defaultValue=False,
         doc=
         'Should the output be in states per unit energy rather than mb/sr/fu/energy?\n'
         +
         '(Only for pure elements, need to set the sample material information)'
     )
     self.declareProperty(MatrixWorkspaceProperty(
         name='OutputWorkspace',
         defaultValue='',
         direction=Direction.Output),
                          doc='Output workspace name.')
     self.declareProperty(
         name='TwoThetaSumRange',
         defaultValue='Twothetamin, Twothetamax',
         doc='Range in 2theta (in degrees) to sum data over.')
示例#2
0
 def PyInit(self):
     '''
     Declares algorithm's properties.
     '''
     self.declareProperty(MatrixWorkspaceProperty(
         name=self._PROP_INPUT_WS,
         defaultValue='',
         validator=HistogramValidator(),
         direction=Direction.Input),
                          doc='The workspace containing the input data')
     roundinghelper.declare_rounding_property(self)
     self.declareProperty(self._PROP_BIN_WIDTH,
                          defaultValue=0.0,
                          direction=Direction.Output,
                          doc='The averaged median bin width')
示例#3
0
    def PyInit(self):
        validator = CompositeValidator()
        validator.add(WorkspaceUnitValidator('Wavelength'))
        validator.add(HistogramValidator())
        validator.add(InstrumentValidator())

        self.declareProperty(MatrixWorkspaceProperty('InputWorkspace', defaultValue='',
                                                     validator = validator,
                                                     direction = Direction.Input),
                             doc='The input workspace in wavelength')

        self.declareProperty('BeamRadius', 0.1, FloatBoundedValidator(lower=0.), 'The radius of the beam [m]')

        self.declareProperty(MatrixWorkspaceProperty('OutputWorkspace',
                                                     defaultValue='',
                                                     direction = Direction.Output),
                             doc='The output workspace')