Changes in sasmodels/data.py [c036ddb:bd7630d] in sasmodels
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/data.py
rc036ddb rbd7630d 183 183 *x* is spin echo length and *y* is polarization (P/P0). 184 184 """ 185 isSesans = True 185 186 def __init__(self, **kw): 186 187 Data1D.__init__(self, **kw) … … 301 302 self.wavelength_unit = "A" 302 303 304 class Sample(object): 305 """ 306 Sample attributes. 307 """ 308 def __init__(self): 309 # type: () -> None 310 pass 303 311 304 312 def empty_data1D(q, resolution=0.0, L=0., dL=0.): … … 329 337 else: 330 338 dq = resolution * q 339 331 340 data = Data1D(q, Iq, dx=dq, dy=dIq) 332 341 data.filename = "fake data" … … 502 511 # Note: masks merge, so any masked theory points will stay masked, 503 512 # and the data mask will be added to it. 504 mtheory = masked_array(theory, data.mask.copy()) 513 #mtheory = masked_array(theory, data.mask.copy()) 514 theory_x = data.x[data.mask == 0] 515 mtheory = masked_array(theory) 505 516 mtheory[~np.isfinite(mtheory)] = masked 506 517 if view is 'log': 507 518 mtheory[mtheory <= 0] = masked 508 plt.plot( data.x, scale*mtheory, '-')519 plt.plot(theory_x, scale*mtheory, '-') 509 520 all_positive = all_positive and (mtheory > 0).all() 510 521 some_present = some_present or (mtheory.count() > 0) … … 542 553 543 554 if use_resid: 544 mresid = masked_array(resid, data.mask.copy()) 555 theory_x = data.x[data.mask == 0] 556 mresid = masked_array(resid) 545 557 mresid[~np.isfinite(mresid)] = masked 546 558 some_present = (mresid.count() > 0) … … 548 560 if num_plots > 1: 549 561 plt.subplot(1, num_plots, use_calc + 2) 550 plt.plot( data.x, mresid, '.')562 plt.plot(theory_x, mresid, '.') 551 563 plt.xlabel("$q$/A$^{-1}$") 552 564 plt.ylabel('residuals')
Note: See TracChangeset
for help on using the changeset viewer.