- Timestamp:
- Apr 17, 2017 3:16:39 PM (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:
- da8bb53
- Parents:
- b09095a
- git-author:
- Jeff Krzywon <krzywon@…> (04/17/17 15:16:39)
- git-committer:
- krzywon <krzywon@…> (04/17/17 15:16:39)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sascalc/dataloader/readers/ascii_reader.py
rb09095a r8ffafd1 85 85 self.reset_data_list(len(lines) - line_no) 86 86 87 candidate_lines += 1 88 # If 5 or more lines, this is considering the set data 89 if candidate_lines >= self.min_data_pts: 90 is_data = True 91 92 self.current_dataset.x[candidate_lines - 1] = float(toks[0]) 93 self.current_dataset.y[candidate_lines - 1] = float(toks[1]) 87 self.current_dataset.x[candidate_lines] = float(toks[0]) 88 self.current_dataset.y[candidate_lines] = float(toks[1]) 94 89 95 90 # If a 3rd row is present, consider it dy 96 91 if new_lentoks > 2: 97 self.current_dataset.dy[candidate_lines - 1] = \92 self.current_dataset.dy[candidate_lines] = \ 98 93 float(toks[2]) 99 94 has_error_dy = True … … 101 96 # If a 4th row is present, consider it dx 102 97 if new_lentoks > 3: 103 self.current_dataset.dx[candidate_lines - 1] = \98 self.current_dataset.dx[candidate_lines] = \ 104 99 float(toks[3]) 105 100 has_error_dx = True 101 102 candidate_lines += 1 103 # If 5 or more lines, this is considering the set data 104 if candidate_lines >= self.min_data_pts: 105 is_data = True 106 106 107 107 # To remember the # of columns on the current line … … 143 143 if len(self.current_dataset.x) < 1: 144 144 raise RuntimeError("ascii_reader: could not load file") 145 return None146 145 147 146 # Data 148 self.current_dataset.x = \ 149 self.current_dataset.x[self.current_dataset.x != 0] 150 self.current_dataset.y = \ 151 self.current_dataset.y[self.current_dataset.x != 0] 152 self.current_dataset.dy = \ 153 self.current_dataset.dy[self.current_dataset.x != 0] if \ 154 has_error_dy else np.zeros(len(self.current_dataset.y)) 155 self.current_dataset.dx = \ 156 self.current_dataset.dx[self.current_dataset.x != 0] if \ 157 has_error_dx else np.zeros(len(self.current_dataset.x)) 147 x = self.current_dataset.x 148 self.current_dataset.x = self.current_dataset.x[x != 0] 149 self.current_dataset.y = self.current_dataset.y[x != 0] 150 self.current_dataset.dy = self.current_dataset.dy[x != 0] if \ 151 has_error_dy else np.zeros(len(self.current_dataset.y)) 152 self.current_dataset.dx = self.current_dataset.dx[x != 0] if \ 153 has_error_dx else np.zeros(len(self.current_dataset.x)) 158 154 159 155 self.current_dataset.xaxis("\\rm{Q}", 'A^{-1}')
Note: See TracChangeset
for help on using the changeset viewer.