Changeset e801a4e in sasview
- Timestamp:
- Apr 9, 2017 5:24:21 AM (8 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 35cf5c0
- Parents:
- a81af92
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/dataloader/readers/sesans_reader.py
ra81af92 re801a4e 86 86 headers = input_f.readline().split() 87 87 88 self._insist_header(headers, "SpinEchoLength") 89 self._insist_header(headers, "Depolarisation") 90 self._insist_header(headers, "Depolarisation_error") 91 self._insist_header(headers, "Wavelength") 92 88 93 data = np.loadtxt(input_f) 89 94 if data.size < 1: … … 141 146 142 147 @staticmethod 148 def _insist_header(headers, name): 149 if name not in headers: 150 raise RuntimeError( 151 "Missing {} column in spin echo data".format(name)) 152 153 @staticmethod 143 154 def _unit_conversion(value, value_unit, default_unit): 144 155 """ -
test/sasdataloader/test/utest_sesans.py
ra81af92 re801a4e 78 78 self.loader, 79 79 "sesans_examples/next_gen.ses") 80 81 def test_sesans_mandatory_headers(self): 82 """ 83 Confirm that sesans files throw an exception if one of the mandator headers is missing. 84 """ 85 self.assertRaises( 86 RuntimeError, 87 self.loader, 88 "sesans_examples/no_wavelength.ses") 89 80 90 if __name__ == "__main__": 81 91 unittest.main()
Note: See TracChangeset
for help on using the changeset viewer.