Changeset e78edc4 in sasmodels for sasmodels/data.py


Ignore:
Timestamp:
Apr 14, 2016 8:41:17 AM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
7abcc59
Parents:
62cf915
git-author:
Paul Kienzle <pkienzle@…> (04/14/16 08:37:03)
git-committer:
Paul Kienzle <pkienzle@…> (04/14/16 08:41:17)
Message:

add -zero option to test q=0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/data.py

    rd6f5da6 re78edc4  
    380380    use_calc = use_theory and Iq_calc is not None 
    381381    num_plots = (use_data or use_theory) + use_calc + use_resid 
    382  
     382    non_positive_x = (data.x<=0.0).any() 
    383383 
    384384    scale = data.x**4 if view == 'q4' else 1.0 
     
    402402 
    403403        if use_theory: 
     404            # Note: masks merge, so any masked theory points will stay masked, 
     405            # and the data mask will be added to it. 
    404406            mtheory = masked_array(theory, data.mask.copy()) 
    405407            mtheory[~np.isfinite(mtheory)] = masked 
     
    413415            plt.ylim(*limits) 
    414416 
    415         plt.xscale('linear' if not some_present else view) 
     417        plt.xscale('linear' if not some_present or non_positive_x  else view) 
    416418        plt.yscale('linear' 
    417419                   if view == 'q4' or not some_present or not all_positive 
     
    441443        plt.xlabel("$q$/A$^{-1}$") 
    442444        plt.ylabel('residuals') 
    443         plt.xscale('linear' if not some_present else view) 
     445        plt.xscale('linear' if not some_present or non_positive_x else view) 
    444446 
    445447 
Note: See TracChangeset for help on using the changeset viewer.