Changes in / [4abcc93a:5f26aa4] in sasview
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sasview/sasview.py
rcde6e52 re68c9bf 100 100 101 101 from matplotlib import backend_bases 102 backend_bases. FigureCanvasBase.filetypes.pop('pgf', None)102 backend_bases._default_filetypes.pop('pgf', None) 103 103 104 104 class SasView(): -
src/sas/sascalc/dataloader/data_info.py
ra4deca6 rd72567e 445 445 return len(self.name) == 0 and len(self.date) == 0 and len(self.description) == 0 \ 446 446 and len(self.term) == 0 and len(self.notes) == 0 447 447 448 448 def single_line_desc(self): 449 449 """ … … 451 451 """ 452 452 return "%s %s %s" % (self.name, self.date, self.description) 453 453 454 454 def __str__(self): 455 455 _str = "Process:\n" … … 1220 1220 result.mask = numpy.append(self.mask, other.mask) 1221 1221 if result.err_data is not None: 1222 result.err_data = numpy.append(self.err_data, other.err_data) 1222 result.err_data = numpy.append(self.err_data, other.err_data) 1223 1223 if self.dqx_data is not None: 1224 1224 result.dqx_data = numpy.append(self.dqx_data, other.dqx_data) … … 1252 1252 final_dataset.yaxis(data._yaxis, data._yunit) 1253 1253 final_dataset.zaxis(data._zaxis, data._zunit) 1254 final_dataset.x_bins = data.x_bins1255 final_dataset.y_bins = data.y_bins1256 1254 else: 1257 1255 return_string = "Should Never Happen: _combine_data_info_with_plottable input is not a plottable1d or " + \ -
src/sas/sascalc/dataloader/readers/cansas_reader_HDF5.py
ra4deca6 rd72567e 62 62 :return: List of Data1D/2D objects and/or a list of errors. 63 63 """ 64 64 65 ## Reinitialize the class when loading a new data file to reset all class variables 65 66 self.reset_class_variables() … … 135 136 ## If this is a dataset, store the data appropriately 136 137 data_set = data[key][:] 137 unit = self._get_unit(value)138 139 ## I and Q Data140 if key == u'I':141 if type(self.current_dataset) is plottable_2D:142 self.current_dataset.data = data_set143 self.current_dataset.zaxis("Intensity", unit)144 else:145 self.current_dataset.y = data_set.flatten()146 self.current_dataset.yaxis("Intensity", unit)147 continue148 elif key == u'Idev':149 if type(self.current_dataset) is plottable_2D:150 self.current_dataset.err_data = data_set.flatten()151 else:152 self.current_dataset.dy = data_set.flatten()153 continue154 elif key == u'Q':155 self.current_dataset.xaxis("Q", unit)156 if type(self.current_dataset) is plottable_2D:157 self.current_dataset.q = data_set.flatten()158 else:159 self.current_dataset.x = data_set.flatten()160 continue161 elif key == u'Qy':162 self.current_dataset.yaxis("Q_y", unit)163 self.current_dataset.qy_data = data_set.flatten()164 continue165 elif key == u'Qydev':166 self.current_dataset.dqy_data = data_set.flatten()167 continue168 elif key == u'Qx':169 self.current_dataset.xaxis("Q_x", unit)170 self.current_dataset.qx_data = data_set.flatten()171 continue172 elif key == u'Qxdev':173 self.current_dataset.dqx_data = data_set.flatten()174 continue175 elif key == u'Mask':176 self.current_dataset.mask = data_set.flatten()177 continue178 138 179 139 for data_point in data_set: 180 140 ## Top Level Meta Data 141 unit = self._get_unit(value) 181 142 if key == u'definition': 182 143 self.current_datainfo.meta_data['reader'] = data_point … … 187 148 elif key == u'SASnote': 188 149 self.current_datainfo.notes.append(data_point) 150 151 ## I and Q Data 152 elif key == u'I': 153 if type(self.current_dataset) is plottable_2D: 154 self.current_dataset.data = np.append(self.current_dataset.data, data_point) 155 self.current_dataset.zaxis("Intensity", unit) 156 else: 157 self.current_dataset.y = np.append(self.current_dataset.y, data_point) 158 self.current_dataset.yaxis("Intensity", unit) 159 elif key == u'Idev': 160 if type(self.current_dataset) is plottable_2D: 161 self.current_dataset.err_data = np.append(self.current_dataset.err_data, data_point) 162 else: 163 self.current_dataset.dy = np.append(self.current_dataset.dy, data_point) 164 elif key == u'Q': 165 self.current_dataset.xaxis("Q", unit) 166 if type(self.current_dataset) is plottable_2D: 167 self.current_dataset.q = np.append(self.current_dataset.q, data_point) 168 else: 169 self.current_dataset.x = np.append(self.current_dataset.x, data_point) 170 elif key == u'Qy': 171 self.current_dataset.yaxis("Q_y", unit) 172 self.current_dataset.qy_data = np.append(self.current_dataset.qy_data, data_point) 173 elif key == u'Qydev': 174 self.current_dataset.dqy_data = np.append(self.current_dataset.dqy_data, data_point) 175 elif key == u'Qx': 176 self.current_dataset.xaxis("Q_x", unit) 177 self.current_dataset.qx_data = np.append(self.current_dataset.qx_data, data_point) 178 elif key == u'Qxdev': 179 self.current_dataset.dqx_data = np.append(self.current_dataset.dqx_data, data_point) 180 elif key == u'Mask': 181 self.current_dataset.mask = np.append(self.current_dataset.mask, data_point) 189 182 190 183 ## Sample Information … … 303 296 ## Type cast data arrays to float64 and find min/max as appropriate 304 297 for dataset in self.data2d: 298 dataset.data = np.delete(dataset.data, [0]) 305 299 dataset.data = dataset.data.astype(np.float64) 300 dataset.err_data = np.delete(dataset.err_data, [0]) 306 301 dataset.err_data = dataset.err_data.astype(np.float64) 302 dataset.mask = np.delete(dataset.mask, [0]) 307 303 if dataset.qx_data is not None: 304 dataset.qx_data = np.delete(dataset.qx_data, [0]) 308 305 dataset.xmin = np.min(dataset.qx_data) 309 306 dataset.xmax = np.max(dataset.qx_data) 310 307 dataset.qx_data = dataset.qx_data.astype(np.float64) 311 308 if dataset.dqx_data is not None: 309 dataset.dqx_data = np.delete(dataset.dqx_data, [0]) 312 310 dataset.dqx_data = dataset.dqx_data.astype(np.float64) 313 311 if dataset.qy_data is not None: 312 dataset.qy_data = np.delete(dataset.qy_data, [0]) 314 313 dataset.ymin = np.min(dataset.qy_data) 315 314 dataset.ymax = np.max(dataset.qy_data) 316 315 dataset.qy_data = dataset.qy_data.astype(np.float64) 317 316 if dataset.dqy_data is not None: 317 dataset.dqy_data = np.delete(dataset.dqy_data, [0]) 318 318 dataset.dqy_data = dataset.dqy_data.astype(np.float64) 319 319 if dataset.q_data is not None: 320 dataset.q_data = np.delete(dataset.q_data, [0]) 320 321 dataset.q_data = dataset.q_data.astype(np.float64) 321 322 zeros = np.ones(dataset.data.size, dtype=bool) … … 332 333 except: 333 334 dataset.q_data = None 334 335 if dataset.data.ndim == 2:336 (n_rows, n_cols) = dataset.data.shape337 dataset.y_bins = dataset.qy_data[0::n_rows]338 dataset.x_bins = dataset.qx_data[:n_cols]339 dataset.data = dataset.data.flatten()340 341 335 final_dataset = combine_data_info_with_plottable(dataset, self.current_datainfo) 342 336 self.output.append(final_dataset) … … 344 338 for dataset in self.data1d: 345 339 if dataset.x is not None: 340 dataset.x = np.delete(dataset.x, [0]) 346 341 dataset.x = dataset.x.astype(np.float64) 347 342 dataset.xmin = np.min(dataset.x) 348 343 dataset.xmax = np.max(dataset.x) 349 344 if dataset.y is not None: 345 dataset.y = np.delete(dataset.y, [0]) 350 346 dataset.y = dataset.y.astype(np.float64) 351 347 dataset.ymin = np.min(dataset.y) 352 348 dataset.ymax = np.max(dataset.y) 353 349 if dataset.dx is not None: 350 dataset.dx = np.delete(dataset.dx, [0]) 354 351 dataset.dx = dataset.dx.astype(np.float64) 355 352 if dataset.dxl is not None: 353 dataset.dxl = np.delete(dataset.dxl, [0]) 356 354 dataset.dxl = dataset.dxl.astype(np.float64) 357 355 if dataset.dxw is not None: 356 dataset.dxw = np.delete(dataset.dxw, [0]) 358 357 dataset.dxw = dataset.dxw.astype(np.float64) 359 358 if dataset.dy is not None: 359 dataset.dy = np.delete(dataset.dy, [0]) 360 360 dataset.dy = dataset.dy.astype(np.float64) 361 361 final_dataset = combine_data_info_with_plottable(dataset, self.current_datainfo)
Note: See TracChangeset
for help on using the changeset viewer.