Changeset 9150036 in sasmodels for sasmodels/direct_model.py
- Timestamp:
- Mar 6, 2019 4:05:28 PM (6 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- f64b154, bd91e8f, c11d09f, 02226a2
- Parents:
- e589e9a (diff), 37f38ff (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/direct_model.py
rc1799d3 r9150036 224 224 else: 225 225 Iq, dIq = None, None 226 #self._theory = np.zeros_like(q)227 q_vectors = [res.q_calc]228 226 elif self.data_type == 'Iqxy': 229 227 #if not model.info.parameters.has_2d: … … 242 240 res = resolution2d.Pinhole2D(data=data, index=index, 243 241 nsigma=3.0, accuracy=accuracy) 244 #self._theory = np.zeros_like(self.Iq)245 q_vectors = res.q_calc246 242 elif self.data_type == 'Iq': 247 243 index = (data.x >= data.qmin) & (data.x <= data.qmax) … … 268 264 else: 269 265 res = resolution.Perfect1D(data.x[index]) 270 271 #self._theory = np.zeros_like(self.Iq)272 q_vectors = [res.q_calc]273 266 elif self.data_type == 'Iq-oriented': 274 267 index = (data.x >= data.qmin) & (data.x <= data.qmax) … … 286 279 qx_width=data.dxw[index], 287 280 qy_width=data.dxl[index]) 288 q_vectors = res.q_calc289 281 else: 290 282 raise ValueError("Unknown data type") # never gets here … … 292 284 # Remember function inputs so we can delay loading the function and 293 285 # so we can save/restore state 294 self._kernel_inputs = q_vectors295 286 self._kernel = None 296 287 self.Iq, self.dIq, self.index = Iq, dIq, index … … 329 320 # type: (ParameterSet, float) -> np.ndarray 330 321 if self._kernel is None: 331 self._kernel = self._model.make_kernel(self._kernel_inputs) 322 # TODO: change interfaces so that resolution returns kernel inputs 323 # Maybe have resolution always return a tuple, or maybe have 324 # make_kernel accept either an ndarray or a pair of ndarrays. 325 kernel_inputs = self.resolution.q_calc 326 if isinstance(kernel_inputs, np.ndarray): 327 kernel_inputs = (kernel_inputs,) 328 self._kernel = self._model.make_kernel(kernel_inputs) 332 329 333 330 # Need to pull background out of resolution for multiple scattering
Note: See TracChangeset
for help on using the changeset viewer.