def test_that_gets_facility(self): self.assertEqual(get_facility(SANSInstrument.SANS2D), SANSFacility.ISIS) self.assertEqual(get_facility(SANSInstrument.LOQ), SANSFacility.ISIS) self.assertEqual(get_facility(SANSInstrument.LARMOR), SANSFacility.ISIS) self.assertEqual(get_facility(SANSInstrument.ZOOM), SANSFacility.ISIS) self.assertEqual(get_facility(SANSInstrument.NoInstrument), SANSFacility.NoFacility)
def test_that_gets_facility(self): self.assertEqual(get_facility(SANSInstrument.SANS2D), SANSFacility.ISIS) self.assertEqual(get_facility(SANSInstrument.LOQ), SANSFacility.ISIS) self.assertEqual(get_facility(SANSInstrument.LARMOR), SANSFacility.ISIS) self.assertEqual(get_facility(SANSInstrument.ZOOM), SANSFacility.ISIS) self.assertEqual(get_facility(SANSInstrument.NO_INSTRUMENT), SANSFacility.NO_FACILITY)
def test_that_gets_facility(self): self.assertTrue( get_facility(SANSInstrument.SANS2D) is SANSFacility.ISIS) self.assertTrue(get_facility(SANSInstrument.LOQ) is SANSFacility.ISIS) self.assertTrue( get_facility(SANSInstrument.LARMOR) is SANSFacility.ISIS) self.assertTrue(get_facility(SANSInstrument.ZOOM) is SANSFacility.ISIS) self.assertTrue( get_facility(SANSInstrument.NoInstrument) is SANSFacility.NoFacility)
def __init__(self, file_name): super(SANSFileInformationISISAdded, self).__init__(file_name) # Setup instrument name instrument_name = get_instrument_name_for_isis_nexus( self._full_file_name) self._instrument = get_instrument(instrument_name) # Setup the facility self._facility = get_facility(self._instrument) self._date, _ = self._get_date_and_run_number_added_nexus( self._full_file_name) _, number_of_periods, is_event = get_added_nexus_information( self._full_file_name) self._number_of_periods = number_of_periods self._is_event_mode = is_event # Get geometry details height, width, thickness, shape = get_geometry_information_isis_added_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(SANSFileInformationISISNexus, self).__init__(file_name) # Setup instrument name instrument_name = get_instrument_name_for_isis_nexus( self._full_file_name) self._instrument = SANSInstrument[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 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(SANSFileInformationISISAdded, self).__init__(file_name) # Setup instrument name instrument_name = get_instrument_name_for_isis_nexus(self._full_file_name) self._instrument = get_instrument(instrument_name) # Setup the facility self._facility = get_facility(self._instrument) date, run_number = get_date_and_run_number_added_nexus(self._full_file_name) self._date = date self._run_number = run_number _, number_of_periods, is_event = get_added_nexus_information(self._full_file_name) self._number_of_periods = number_of_periods self._is_event_mode = is_event # Get geometry details height, width, thickness, shape = get_geometry_information_isis_added_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 test_that_gets_facility(self): self.assertTrue(get_facility(SANSInstrument.SANS2D) is SANSFacility.ISIS) self.assertTrue(get_facility(SANSInstrument.LOQ) is SANSFacility.ISIS) self.assertTrue(get_facility(SANSInstrument.LARMOR) is SANSFacility.ISIS) self.assertTrue(get_facility(SANSInstrument.ZOOM) is SANSFacility.ISIS) self.assertTrue(get_facility(SANSInstrument.NoInstrument) is SANSFacility.NoFacility)