Changeset 84db7a5 in sasmodels for sasmodels/data.py


Ignore:
Timestamp:
Mar 17, 2016 10:47:47 AM (8 years ago)
Author:
krzywon
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:
6824af5
Parents:
4373d62
Message:

Updated sesans scripting to be more command line focused AND modified hardsphere to effect_radius.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/data.py

    r7824276 r84db7a5  
    440440 
    441441    if use_data or use_theory: 
     442        is_tof = np.any(data.lam!=data.lam[0]) 
    442443        if num_plots > 1: 
    443444            plt.subplot(1, num_plots, 1) 
    444445        if use_data: 
    445             plt.errorbar(data.x, data.y, yerr=data.dy) 
     446            if is_tof: 
     447                plt.errorbar(data.x, np.log(data.y)/(data.lam*data.lam), yerr=data.dy/data.y/(data.lam*data.lam)) 
     448            else: 
     449                plt.errorbar(data.x, data.y, yerr=data.dy) 
    446450        if theory is not None: 
    447             plt.plot(data.x, theory, '-', hold=True) 
     451            if is_tof: 
     452                plt.plot(data.x, np.log(theory)/(data.lam*data.lam), '-', hold=True) 
     453            else: 
     454                plt.plot(data.x, theory, '-', hold=True) 
    448455        if limits is not None: 
    449456            plt.ylim(*limits) 
    450         plt.xlabel('spin echo length (nm)') 
    451         plt.ylabel('polarization (P/P0)') 
     457 
     458        plt.xlabel('spin echo length ({})'.format(data._xunit)) 
     459        if is_tof: 
     460            plt.ylabel('(Log (P/P$_0$))/$\lambda^2$') 
     461        else: 
     462            plt.ylabel('polarization (P/P0)') 
     463 
    452464 
    453465    if resid is not None: 
     
    455467            plt.subplot(1, num_plots, (use_data or use_theory) + 1) 
    456468        plt.plot(data.x, resid, 'x') 
    457         plt.xlabel('spin echo length (nm)') 
     469        plt.xlabel('spin echo length ({})'.format(data._xunit)) 
    458470        plt.ylabel('residuals (P/P0)') 
    459471 
Note: See TracChangeset for help on using the changeset viewer.