Changeset 1a8c11c in sasmodels
- Timestamp:
- Jul 19, 2018 9:56:00 AM (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:
- 58a34f1
- Parents:
- 4341dd4
- Location:
- sasmodels
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/data.py
r65fbf7c r1a8c11c 503 503 # Note: masks merge, so any masked theory points will stay masked, 504 504 # and the data mask will be added to it. 505 mtheory = masked_array(theory, data.mask.copy()) 505 #mtheory = masked_array(theory, data.mask.copy()) 506 theory_x = data.x[~data.mask] 507 mtheory = masked_array(theory) 506 508 mtheory[~np.isfinite(mtheory)] = masked 507 509 if view is 'log': 508 510 mtheory[mtheory <= 0] = masked 509 plt.plot( data.x, scale*mtheory, '-')511 plt.plot(theory_x, scale*mtheory, '-') 510 512 all_positive = all_positive and (mtheory > 0).all() 511 513 some_present = some_present or (mtheory.count() > 0) … … 543 545 544 546 if use_resid: 545 mresid = masked_array(resid, data.mask.copy()) 547 theory_x = data.x[~data.mask] 548 mresid = masked_array(resid) 546 549 mresid[~np.isfinite(mresid)] = masked 547 550 some_present = (mresid.count() > 0) … … 549 552 if num_plots > 1: 550 553 plt.subplot(1, num_plots, use_calc + 2) 551 plt.plot( data.x, mresid, '.')554 plt.plot(theory_x, mresid, '.') 552 555 plt.xlabel("$q$/A$^{-1}$") 553 556 plt.ylabel('residuals') -
sasmodels/direct_model.py
rb9c19aa2 r1a8c11c 250 250 qmax = getattr(data, 'qmax', np.inf) 251 251 accuracy = getattr(data, 'accuracy', 'Low') 252 index = ~data.mask& (q >= qmin) & (q <= qmax)252 index = (data.mask == 0) & (q >= qmin) & (q <= qmax) 253 253 if data.data is not None: 254 254 index &= ~np.isnan(data.data) … … 265 265 mask = getattr(data, 'mask', None) 266 266 if mask is not None: 267 index &= ~mask267 index &= (mask == 0) 268 268 if data.y is not None: 269 269 index &= ~np.isnan(data.y)
Note: See TracChangeset
for help on using the changeset viewer.