Changeset a769b54 in sasmodels for sasmodels/data.py


Ignore:
Timestamp:
Feb 8, 2017 2:58:46 PM (7 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
3a45c2c
Parents:
1105286
Message:

allow sascomp with -data=filename to set q,dq from file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/data.py

    r40a87fa ra769b54  
    5454    if data is None: 
    5555        raise IOError("Data %r could not be loaded" % filename) 
     56    if hasattr(data, 'x'): 
     57        data.qmin, data.qmax = data.x.min(), data.x.max() 
     58        data.mask = (np.isnan(data.y) if data.y is not None 
     59                     else np.zeros_like(data.x, dtype='bool')) 
    5660    return data 
    5761 
     
    348352    # data, but they already handle the masking and graph markup already, so 
    349353    # do not repeat. 
    350     if hasattr(data, 'lam'): 
     354    if hasattr(data, 'isSesans') and data.isSesans: 
    351355        _plot_result_sesans(data, None, None, use_data=True, limits=limits) 
    352356    elif hasattr(data, 'qx_data'): 
     
    376380    *Iq_calc* is the raw theory values without resolution smearing 
    377381    """ 
    378     if hasattr(data, 'lam'): 
     382    if hasattr(data, 'isSesans') and data.isSesans: 
    379383        _plot_result_sesans(data, theory, resid, use_data=True, limits=limits) 
    380384    elif hasattr(data, 'qx_data'): 
Note: See TracChangeset for help on using the changeset viewer.