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)
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
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
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
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
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)
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)
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
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
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)