Changeset ae69c690 in sasview
- Timestamp:
- Sep 15, 2017 2:48:18 PM (7 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, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 6d62b7f
- Parents:
- da9b239
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/dataloader/file_reader_base_class.py
r4660990 rae69c690 191 191 self.output = [] 192 192 193 def remove_empty_q_values(self, has_error_dx=False, has_error_dy=False): 193 def remove_empty_q_values(self, has_error_dx=False, has_error_dy=False, 194 has_error_dxl=False, has_error_dxw=False): 194 195 """ 195 196 Remove any point where Q == 0 … … 198 199 self.current_dataset.x = self.current_dataset.x[x != 0] 199 200 self.current_dataset.y = self.current_dataset.y[x != 0] 200 self.current_dataset.dy = self.current_dataset.dy[x != 0] if \ 201 has_error_dy else np.zeros(len(self.current_dataset.y)) 202 self.current_dataset.dx = self.current_dataset.dx[x != 0] if \ 203 has_error_dx else np.zeros(len(self.current_dataset.x)) 201 if has_error_dy: 202 self.current_dataset.dy = self.current_dataset.dy[x != 0] 203 if has_error_dx: 204 self.current_dataset.dx = self.current_dataset.dx[x != 0] 205 if has_error_dxl: 206 self.current_dataset.dxl = self.current_dataset.dxl[x != 0] 207 if has_error_dxw: 208 self.current_dataset.dxw = self.current_dataset.dxw[x != 0] 204 209 205 210 def reset_data_list(self, no_lines=0): -
src/sas/sascalc/dataloader/readers/cansas_reader.py
r590b5c2 rae69c690 511 511 """ 512 512 has_error_dx = self.current_dataset.dx is not None 513 has_error_dxl = self.current_dataset.dxl is not None 514 has_error_dxw = self.current_dataset.dxw is not None 513 515 has_error_dy = self.current_dataset.dy is not None 514 516 self.remove_empty_q_values(has_error_dx=has_error_dx, 517 has_error_dxl=has_error_dxl, 518 has_error_dxw=has_error_dxw, 515 519 has_error_dy=has_error_dy) 516 520 self.send_to_output() # Combine datasets with DataInfo … … 678 682 di_exists = True 679 683 if dqw_exists and not dql_exists: 680 array_size = self.current_dataset.dxw.size - 1 681 self.current_dataset.dxl = np.append(self.current_dataset.dxl, 682 np.zeros([array_size])) 684 array_size = self.current_dataset.dxw.size 685 self.current_dataset.dxl = np.zeros(array_size) 683 686 elif dql_exists and not dqw_exists: 684 array_size = self.current_dataset.dxl.size - 1 685 self.current_dataset.dxw = np.append(self.current_dataset.dxw, 686 np.zeros([array_size])) 687 array_size = self.current_dataset.dxl.size 688 self.current_dataset.dxw = np.zeros(array_size) 687 689 elif not dql_exists and not dqw_exists and not dq_exists: 688 array_size = self.current_dataset.x.size - 1690 array_size = self.current_dataset.x.size 689 691 self.current_dataset.dx = np.append(self.current_dataset.dx, 690 692 np.zeros([array_size])) 691 693 if not di_exists: 692 array_size = self.current_dataset.y.size - 1694 array_size = self.current_dataset.y.size 693 695 self.current_dataset.dy = np.append(self.current_dataset.dy, 694 696 np.zeros([array_size])) -
test/sasdataloader/test/utest_abs_reader.py
ra78a02f rae69c690 333 333 self.assertEqual(self.data.x[1], 0.03) 334 334 self.assertAlmostEquals(self.data.y[1], 1001.0) 335 self.assertEqual(self.data.dx[0], 0.0)336 335 self.assertEqual(self.data.dxl[1], 0.005) 337 336 self.assertEqual(self.data.dxw[1], 0.001)
Note: See TracChangeset
for help on using the changeset viewer.