Changeset 2c4a190 in sasmodels for sasmodels/direct_model.py
- Timestamp:
- Dec 13, 2018 11:08:26 AM (5 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 8803a38
- Parents:
- c6084f1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/direct_model.py
r7b9e4dd r2c4a190 242 242 else: 243 243 Iq, dIq = None, None 244 #self._theory = np.zeros_like(q)245 q_vectors = [res.q_calc]246 244 elif self.data_type == 'Iqxy': 247 245 #if not model.info.parameters.has_2d: … … 260 258 res = resolution2d.Pinhole2D(data=data, index=index, 261 259 nsigma=3.0, accuracy=accuracy) 262 #self._theory = np.zeros_like(self.Iq)263 q_vectors = res.q_calc264 260 elif self.data_type == 'Iq': 265 261 index = (data.x >= data.qmin) & (data.x <= data.qmax) … … 286 282 else: 287 283 res = resolution.Perfect1D(data.x[index]) 288 289 #self._theory = np.zeros_like(self.Iq)290 q_vectors = [res.q_calc]291 284 elif self.data_type == 'Iq-oriented': 292 285 index = (data.x >= data.qmin) & (data.x <= data.qmax) … … 304 297 qx_width=data.dxw[index], 305 298 qy_width=data.dxl[index]) 306 q_vectors = res.q_calc307 299 else: 308 300 raise ValueError("Unknown data type") # never gets here … … 310 302 # Remember function inputs so we can delay loading the function and 311 303 # so we can save/restore state 312 self._kernel_inputs = q_vectors313 304 self._kernel = None 314 305 self.Iq, self.dIq, self.index = Iq, dIq, index … … 347 338 # type: (ParameterSet, float) -> np.ndarray 348 339 if self._kernel is None: 349 self._kernel = self._model.make_kernel(self._kernel_inputs) 340 # TODO: change interfaces so that resolution returns kernel inputs 341 # Maybe have resolution always return a tuple, or maybe have 342 # make_kernel accept either an ndarray or a pair of ndarrays. 343 kernel_inputs = self.resolution.q_calc 344 if isinstance(kernel_inputs, np.ndarray): 345 kernel_inputs = (kernel_inputs,) 346 self._kernel = self._model.make_kernel(kernel_inputs) 350 347 351 348 # Need to pull background out of resolution for multiple scattering
Note: See TracChangeset
for help on using the changeset viewer.