コード例 #1
0
def get_component_name(workspace, detector_type):
    instrument = workspace.getInstrument()
    instrument_name = instrument.getName().strip()
    instrument_name = instrument_name.upper()
    instrument = SANSInstrument.from_string(instrument_name)
    return convert_instrument_and_detector_type_to_bank_name(
        instrument, detector_type)
コード例 #2
0
    def __init__(self, file_name):
        super(SANSFileInformationISISNexus, self).__init__(file_name)
        # Setup instrument name
        instrument_name = get_instrument_name_for_isis_nexus(
            self._full_file_name)
        self._instrument = SANSInstrument.from_string(instrument_name)

        # Setup the facility
        self._facility = get_facility(self._instrument)

        # Setup date
        self._date = get_date_for_isis_nexus(self._full_file_name)

        # Setup number of periods
        self._number_of_periods = get_number_of_periods_for_isis_nexus(
            self._full_file_name)

        # Setup run number
        self._run_number = get_run_number_for_isis_nexus(self._full_file_name)

        # Setup event mode check
        self._is_event_mode = get_event_mode_information(self._full_file_name)

        # Get geometry details
        height, width, thickness, shape = get_geometry_information_isis_nexus(
            self._full_file_name)
        self._height = height if height is not None else 1.
        self._width = width if width is not None else 1.
        self._thickness = thickness if thickness is not None else 1.
        self._shape = shape if shape is not None else SampleShape.Disc
コード例 #3
0
    def __init__(self, file_name):
        super(SANSFileInformationRaw, self).__init__(file_name)
        # Setup instrument name
        instrument_name = get_instrument_name_for_raw(self._full_file_name)
        self._instrument = SANSInstrument.from_string(instrument_name)

        # Setup the facility
        self._facility = get_facility(self._instrument)

        # Setup date
        self._date = get_date_for_raw(self._full_file_name)

        # Setup number of periods
        self._number_of_periods = get_number_of_periods_for_raw(
            self._full_file_name)

        # Setup run number
        self._run_number = get_run_number_for_raw(self._full_file_name)

        # Set geometry
        # Raw files don't have the sample information, so set to default
        height, width, thickness, shape = get_geometry_information_raw(
            self._full_file_name)
        self._height = height if height is not None else 1.
        self._width = width if width is not None else 1.
        self._thickness = thickness if thickness is not None else 1.
        self._shape = shape if shape is not None else SampleShape.Disc
コード例 #4
0
    def __init__(self, file_name):
        super(SANSFileInformationRaw, self).__init__(file_name)
        # Setup instrument name
        instrument_name = get_instrument_name_for_raw(self._full_file_name)
        self._instrument = SANSInstrument.from_string(instrument_name)

        # Setup the facility
        self._facility = get_facility(self._instrument)

        # Setup date
        self._date = get_date_for_raw(self._full_file_name)

        # Setup number of periods
        self._number_of_periods = get_number_of_periods_for_raw(self._full_file_name)

        # Setup run number
        self._run_number = get_run_number_for_raw(self._full_file_name)

        # Set geometry
        # Raw files don't have the sample information, so set to default
        height, width, thickness, shape = get_geometry_information_raw(self._full_file_name)
        self._height = height if height is not None else 1.
        self._width = width if width is not None else 1.
        self._thickness = thickness if thickness is not None else 1.
        self._shape = shape if shape is not None else SampleShape.Disc
コード例 #5
0
    def __init__(self, file_name):
        super(SANSFileInformationISISNexus, self).__init__(file_name)
        # Setup instrument name
        instrument_name = get_instrument_name_for_isis_nexus(self._full_file_name)
        self._instrument = SANSInstrument.from_string(instrument_name)

        # Setup the facility
        self._facility = get_facility(self._instrument)

        # Setup date
        self._date = get_date_for_isis_nexus(self._full_file_name)

        # Setup number of periods
        self._number_of_periods = get_number_of_periods_for_isis_nexus(self._full_file_name)

        # Setup run number
        self._run_number = get_run_number_for_isis_nexus(self._full_file_name)

        # Setup event mode check
        self._is_event_mode = get_event_mode_information(self._full_file_name)

        # Get geometry details
        height, width, thickness, shape = get_geometry_information_isis_nexus(self._full_file_name)
        self._height = height if height is not None else 1.
        self._width = width if width is not None else 1.
        self._thickness = thickness if thickness is not None else 1.
        self._shape = shape if shape is not None else SampleShape.Disc
コード例 #6
0
    def __init__(self, file_name):
        super(SANSFileInformationRaw, self).__init__(file_name)
        # Setup instrument name
        self._full_file_name = SANSFileInformation.get_full_file_name(self._file_name)
        instrument_name = get_instrument_name_for_raw(self._full_file_name)
        self._instrument = SANSInstrument.from_string(instrument_name)

        # Setup date
        self._date = get_date_for_raw(self._full_file_name)

        # Setup number of periods
        self._number_of_periods = get_number_of_periods_for_raw(self._full_file_name)

        # Setup run number
        self._run_number = get_run_number_for_raw(self._full_file_name)
コード例 #7
0
    def __init__(self, file_name):
        super(SANSFileInformationISISNexus, self).__init__(file_name)
        # Setup instrument name
        self._full_file_name = SANSFileInformation.get_full_file_name(self._file_name)
        instrument_name = get_instrument_name_for_isis_nexus(self._full_file_name)
        self._instrument = SANSInstrument.from_string(instrument_name)

        # Setup date
        self._date = get_date_for_isis_nexus(self._full_file_name)

        # Setup number of periods
        self._number_of_periods = get_number_of_periods_for_isis_nexus(self._full_file_name)

        # Setup run number
        self._run_number = get_run_number_for_isis_nexus(self._full_file_name)

        # Setup event mode check
        self._is_event_mode = get_event_mode_information(self._full_file_name)
コード例 #8
0
 def create_mover(workspace):
     # Get selection
     run_number = workspace.getRunNumber()
     instrument = workspace.getInstrument()
     instrument_name = instrument.getName()
     instrument_name = sanitise_instrument_name(instrument_name)
     instrument_type = SANSInstrument.from_string(instrument_name)
     if SANSMoveLOQ.is_correct(instrument_type, run_number):
         mover = SANSMoveLOQ()
     elif SANSMoveSANS2D.is_correct(instrument_type, run_number):
         mover = SANSMoveSANS2D()
     elif SANSMoveLARMOROldStyle.is_correct(instrument_type, run_number):
         mover = SANSMoveLARMOROldStyle()
     elif SANSMoveLARMORNewStyle.is_correct(instrument_type, run_number):
         mover = SANSMoveLARMORNewStyle()
     else:
         mover = None
         NotImplementedError("SANSLoaderFactory: Other instruments are not implemented yet.")
     return mover
コード例 #9
0
ファイル: move_workspaces.py プロジェクト: DanNixon/mantid
 def create_mover(workspace):
     # Get selection
     run_number = workspace.getRunNumber()
     instrument = workspace.getInstrument()
     instrument_name = instrument.getName()
     instrument_name = sanitise_instrument_name(instrument_name)
     instrument_type = SANSInstrument.from_string(instrument_name)
     if SANSMoveLOQ.is_correct(instrument_type, run_number):
         mover = SANSMoveLOQ()
     elif SANSMoveSANS2D.is_correct(instrument_type, run_number):
         mover = SANSMoveSANS2D()
     elif SANSMoveLARMOROldStyle.is_correct(instrument_type, run_number):
         mover = SANSMoveLARMOROldStyle()
     elif SANSMoveLARMORNewStyle.is_correct(instrument_type, run_number):
         mover = SANSMoveLARMORNewStyle()
     elif SANSMoveZOOM.is_correct(instrument_type, run_number):
         mover = SANSMoveZOOM()
     else:
         mover = None
         NotImplementedError("SANSLoaderFactory: Other instruments are not implemented yet.")
     return mover
コード例 #10
0
ファイル: crop_helper.py プロジェクト: mantidproject/mantid
def get_component_name(workspace, detector_type):
    instrument = workspace.getInstrument()
    instrument_name = instrument.getName().strip()
    instrument_name = instrument_name.upper()
    instrument = SANSInstrument.from_string(instrument_name)
    return convert_instrument_and_detector_type_to_bank_name(instrument, detector_type)