Changes in sasmodels/data.py [c036ddb:bd7630d] in sasmodels


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/data.py

    rc036ddb rbd7630d  
    183183    *x* is spin echo length and *y* is polarization (P/P0). 
    184184    """ 
     185    isSesans = True 
    185186    def __init__(self, **kw): 
    186187        Data1D.__init__(self, **kw) 
     
    301302        self.wavelength_unit = "A" 
    302303 
     304class Sample(object): 
     305    """ 
     306    Sample attributes. 
     307    """ 
     308    def __init__(self): 
     309        # type: () -> None 
     310        pass 
    303311 
    304312def empty_data1D(q, resolution=0.0, L=0., dL=0.): 
     
    329337    else: 
    330338        dq = resolution * q 
     339 
    331340    data = Data1D(q, Iq, dx=dq, dy=dIq) 
    332341    data.filename = "fake data" 
     
    502511            # Note: masks merge, so any masked theory points will stay masked, 
    503512            # 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) 
    505516            mtheory[~np.isfinite(mtheory)] = masked 
    506517            if view is 'log': 
    507518                mtheory[mtheory <= 0] = masked 
    508             plt.plot(data.x, scale*mtheory, '-') 
     519            plt.plot(theory_x, scale*mtheory, '-') 
    509520            all_positive = all_positive and (mtheory > 0).all() 
    510521            some_present = some_present or (mtheory.count() > 0) 
     
    542553 
    543554    if use_resid: 
    544         mresid = masked_array(resid, data.mask.copy()) 
     555        theory_x = data.x[data.mask == 0] 
     556        mresid = masked_array(resid) 
    545557        mresid[~np.isfinite(mresid)] = masked 
    546558        some_present = (mresid.count() > 0) 
     
    548560        if num_plots > 1: 
    549561            plt.subplot(1, num_plots, use_calc + 2) 
    550         plt.plot(data.x, mresid, '.') 
     562        plt.plot(theory_x, mresid, '.') 
    551563        plt.xlabel("$q$/A$^{-1}$") 
    552564        plt.ylabel('residuals') 
Note: See TracChangeset for help on using the changeset viewer.