예제 #1
0
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))
예제 #2
0
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))
예제 #3
0
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)
    )
예제 #4
0
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))
예제 #5
0
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))
예제 #6
0
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))
예제 #7
0
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,
        )
    )
예제 #8
0
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(),
    )
예제 #9
0
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))
예제 #10
0
파일: reducer.py 프로젝트: nimgould/mantid
    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)
예제 #11
0
파일: reducer.py 프로젝트: mcvine/mantid
    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)
예제 #12
0
def TransmissionDarkCurrent(dark_current=None):
    find_data(dark_current, instrument=ReductionSingleton().instrument.name())
    ReductionSingleton().get_transmission().set_dark_current(dark_current)
예제 #13
0
def Background(datafile):
    find_data(datafile, instrument=ReductionSingleton().instrument.name())
    ReductionSingleton().set_background(datafile) 
예제 #14
0
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))
예제 #15
0
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)
예제 #16
0
def SensitivityDirectBeamCenter(datafile):
    find_data(datafile, instrument=ReductionSingleton().instrument.name())
    ReductionSingleton().set_sensitivity_beam_center(
        sans_reduction_steps.DirectBeamCenter(datafile).set_persistent(False)
    )
예제 #17
0
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))
예제 #18
0
def DirectBeamCenter(datafile):
    find_data(datafile, instrument=ReductionSingleton().instrument.name())
    ReductionSingleton().set_beam_finder(sans_reduction_steps.DirectBeamCenter(datafile))
예제 #19
0
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)
예제 #20
0
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())
예제 #21
0
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
예제 #22
0
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))