def DirectBeamTransmission(sample_file, empty_file, beam_radius=3.0, theta_dependent=True): find_data(sample_file, instrument=ReductionSingleton().instrument.name()) find_data(empty_file, instrument=ReductionSingleton().instrument.name()) ReductionSingleton().set_transmission(sans_reduction_steps.DirectBeamTransmission(sample_file=sample_file, empty_file=empty_file, beam_radius=beam_radius, theta_dependent=theta_dependent))
def BckTransmissionDirectBeamCenter(datafile): find_data(datafile, instrument=ReductionSingleton().instrument.name()) if ReductionSingleton().get_background() is None: raise RuntimeError, "A background hasn't been defined." if ReductionSingleton().get_background().get_transmission() is None: raise RuntimeError, "A transmission algorithm must be selected before setting the transmission beam center." ReductionSingleton().get_background().get_transmission().set_beam_finder(sans_reduction_steps.DirectBeamCenter(datafile).set_masked_edges(1,1,1,1))
def TransmissionDirectBeamCenter(datafile): find_data(datafile, instrument=ReductionSingleton().instrument.name()) if ReductionSingleton().get_transmission() is None: raise RuntimeError, "A transmission algorithm must be selected before setting the transmission beam center." ReductionSingleton().get_transmission().set_beam_finder( sans_reduction_steps.DirectBeamCenter(datafile).set_persistent(False) )
def SetDirectBeamAbsoluteScale(direct_beam, beamstop_diameter=None, attenuator_trans=1.0, sample_thickness=None, apply_sensitivity=False): if sample_thickness is not None: print "sample_thickness is no longer used with SetDirectBeamAbsoluteScale: use DivideByThickness" find_data(direct_beam, instrument=ReductionSingleton().instrument.name()) ReductionSingleton().set_absolute_scale(absolute_scale.AbsoluteScale(data_file=direct_beam, beamstop_diameter=beamstop_diameter, attenuator_trans=attenuator_trans, apply_sensitivity=apply_sensitivity))
def BckDirectBeamTransmission(sample_file, empty_file, beam_radius=3.0, theta_dependent=True): if ReductionSingleton().get_background() is None: raise RuntimeError, "A background hasn't been defined." find_data(sample_file, instrument=ReductionSingleton().instrument.name()) find_data(empty_file, instrument=ReductionSingleton().instrument.name()) ReductionSingleton().get_background().set_transmission(sans_reduction_steps.DirectBeamTransmission(sample_file=sample_file, empty_file=empty_file, beam_radius=beam_radius, theta_dependent=theta_dependent))
def SensitivityCorrection(flood_data, min_sensitivity=0.5, max_sensitivity=1.5, dark_current=None, use_sample_dc=False): find_data(flood_data, instrument=ReductionSingleton().instrument.name()) if dark_current is not None: find_data(dark_current, instrument=ReductionSingleton().instrument.name()) ReductionSingleton().set_sensitivity_correcter(sans_reduction_steps.SensitivityCorrection(flood_data, min_sensitivity, max_sensitivity, dark_current=dark_current, use_sample_dc=use_sample_dc))
def BckBeamSpreaderTransmission( sample_spreader, direct_spreader, sample_scattering, direct_scattering, spreader_transmission=1.0, spreader_transmission_err=0.0, theta_dependent=True, ): if ReductionSingleton().get_background() is None: raise RuntimeError, "A background hasn't been defined." find_data(sample_spreader, instrument=ReductionSingleton().instrument.name()) find_data(direct_spreader, instrument=ReductionSingleton().instrument.name()) find_data(sample_scattering, instrument=ReductionSingleton().instrument.name()) find_data(direct_scattering, instrument=ReductionSingleton().instrument.name()) ReductionSingleton().get_background().set_transmission( sans_reduction_steps.BeamSpreaderTransmission( sample_spreader=sample_spreader, direct_spreader=direct_spreader, sample_scattering=sample_scattering, direct_scattering=direct_scattering, spreader_transmission=spreader_transmission, spreader_transmission_err=spreader_transmission_err, theta_dependent=theta_dependent, ) )
def DarkCurrent(datafile): datafile = find_data(datafile, instrument=ReductionSingleton().instrument.name()) ReductionSingleton().set_dark_current_subtracter( mantidsimple.HFIRDarkCurrentSubtraction, InputWorkspace=None, Filename=datafile, OutputWorkspace=None, ReductionProperties=ReductionSingleton().get_reduction_table_name(), )
def BeamSpreaderTransmission(sample_spreader, direct_spreader, sample_scattering, direct_scattering, spreader_transmission=1.0, spreader_transmission_err=0.0, theta_dependent=True ): find_data(sample_spreader, instrument=ReductionSingleton().instrument.name()) find_data(direct_spreader, instrument=ReductionSingleton().instrument.name()) find_data(sample_scattering, instrument=ReductionSingleton().instrument.name()) find_data(direct_scattering, instrument=ReductionSingleton().instrument.name()) ReductionSingleton().set_transmission(sans_reduction_steps.BeamSpreaderTransmission(sample_spreader=sample_spreader, direct_spreader=direct_spreader, sample_scattering=sample_scattering, direct_scattering=direct_scattering, spreader_transmission=spreader_transmission, spreader_transmission_err=spreader_transmission_err, theta_dependent=theta_dependent))
def _full_file_path(self, filename): """ Prepends the data folder path and returns a full path to the given file. Raises an exception if the file doesn't exist. @param filename: name of the file to create the full path for """ lineno = inspect.currentframe().f_code.co_firstlineno warnings.warn_explicit("Reducer._full_file_path is deprecated: use find_data instead", DeprecationWarning, __file__, lineno) instrument_name = '' if self.instrument is not None: instrument_name = self.instrument.name() return find_data(filename, instrument=instrument_name)
def _full_file_path(self, filename): """ Prepends the data folder path and returns a full path to the given file. Raises an exception if the file doesn't exist. @param filename: name of the file to create the full path for """ lineno = inspect.currentframe().f_code.co_firstlineno warnings.warn_explicit("Reducer._full_file_path is deprecated: use find_data instead", DeprecationWarning, __file__, lineno) instrument_name = '' if self.instrument is not None: instrument_name = self.instrument.name() return find_data(filename, instrument=instrument_name)
def TransmissionDarkCurrent(dark_current=None): find_data(dark_current, instrument=ReductionSingleton().instrument.name()) ReductionSingleton().get_transmission().set_dark_current(dark_current)
def Background(datafile): find_data(datafile, instrument=ReductionSingleton().instrument.name()) ReductionSingleton().set_background(datafile)
def SensitivityScatteringBeamCenter(datafile, beam_radius=3.0): find_data(datafile, instrument=ReductionSingleton().instrument.name()) ReductionSingleton().set_sensitivity_beam_center(sans_reduction_steps.ScatteringBeamCenter(datafile, beam_radius=beam_radius).set_masked_edges(1,1,1,1))
def Background(datafile): if type(datafile) == list: datafile = ",".join(datafile) datafile = find_data(datafile, instrument=ReductionSingleton().instrument.name(), allow_multiple=True) ReductionSingleton().set_background(datafile)
def SensitivityDirectBeamCenter(datafile): find_data(datafile, instrument=ReductionSingleton().instrument.name()) ReductionSingleton().set_sensitivity_beam_center( sans_reduction_steps.DirectBeamCenter(datafile).set_persistent(False) )
def SensitivityDirectBeamCenter(datafile): find_data(datafile, instrument=ReductionSingleton().instrument.name()) ReductionSingleton().set_sensitivity_beam_center(sans_reduction_steps.DirectBeamCenter(datafile).set_masked_edges(1,1,1,1))
def DirectBeamCenter(datafile): find_data(datafile, instrument=ReductionSingleton().instrument.name()) ReductionSingleton().set_beam_finder(sans_reduction_steps.DirectBeamCenter(datafile))
def BckTransmissionDarkCurrent(dark_current=None): if ReductionSingleton().get_background() is None: raise RuntimeError, "A background hasn't been defined." find_data(dark_current, instrument=ReductionSingleton().instrument.name()) ReductionSingleton().get_background().set_trans_dark_current(dark_current)
def DarkCurrent(datafile): find_data(datafile, instrument=ReductionSingleton().instrument.name()) ReductionSingleton().set_dark_current_subtracter(mantidsimple.EQSANSDarkCurrentSubtraction, InputWorkspace=None, Filename=datafile, OutputWorkspace=None, ReductionTableWorkspace=ReductionSingleton().get_reduction_table_name())
def BeamMonitorNormalization(reference_flux_file): find_data(reference_flux_file, instrument=ReductionSingleton().get_instrument()) ReductionSingleton().reduction_properties["Normalisation"]="Monitor" ReductionSingleton().reduction_properties["MonitorReferenceFile"]=reference_flux_file
def ScatteringBeamCenter(datafile, beam_radius=3.0): find_data(datafile, instrument=ReductionSingleton().instrument.name()) ReductionSingleton().set_beam_finder(sans_reduction_steps.ScatteringBeamCenter(datafile, beam_radius=beam_radius))