Changeset 5134b2c in sasmodels


Ignore:
Timestamp:
Feb 24, 2015 2:04:29 PM (10 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:
8b81801
Parents:
02dfcab
Message:

fix compare plots so they show both positive and negative error

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • compare.py

    r29f5536 r5134b2c  
    234234        plt.subplot(133) 
    235235        if '-abs' in opts: 
    236             err,errstr = resid, "abs err" 
     236            err,errstr,scale = resid, "abs err", "linear" 
    237237        else: 
    238             err,errstr = relerr, "rel err" 
     238            err,errstr,scale = abs(relerr), "rel err", "log" 
    239239        #err,errstr = ocl/cpu,"ratio" 
    240         plot_data(data, err, scale='log') #'linear') 
     240        plot_data(data, err, scale=scale) 
    241241        plt.title("max %s = %.3g"%(errstr, max(abs(err[index])))) 
    242         cbar_title = "log "+errstr 
     242        cbar_title = errstr if scale=="linear" else "log "+errstr 
    243243    if is2D: 
    244244        h = plt.colorbar() 
  • compare.sh

    • Property mode changed from 100644 to 100755
    r8a3e0af r5134b2c  
    55#PYOPENCL_CTX=${CTX:-1} 
    66PYTHONPATH=../bumps:../periodictable:$SASVIEW 
    7 export PYOPENCL_CTX PYTHONPATH 
     7export PYTHONPATH 
    88 
    9 echo PYTHONPATH=$PYTHONPATH 
    109set -x 
    1110 
  • compare_all.sh

    r34d49af r5134b2c  
    22 
    33SASVIEW=$(ls -d ../sasview/build/lib.*) 
    4 PYOPENCL_CTX=1 
    54PYTHONPATH=../bumps:../periodictable:$SASVIEW 
    6 export PYOPENCL_CTX PYTHONPATH 
     5export PYTHONPATH 
    76 
    87echo PYTHONPATH=$PYTHONPATH 
  • sasmodels/bumps_model.py

    rf1ecfa92 r5134b2c  
    175175        xmin, xmax = min(data.qx_data), max(data.qx_data) 
    176176        ymin, ymax = min(data.qy_data), max(data.qy_data) 
    177         if vmin is None: vmin = iq[valid&~data.mask].min() 
    178         if vmax is None: vmax = iq[valid&~data.mask].max() 
     177        try: 
     178            if vmin is None: vmin = iq[valid&~data.mask].min() 
     179            if vmax is None: vmax = iq[valid&~data.mask].max() 
     180        except: 
     181            vmin, vmax = 0, 1 
    179182        plt.imshow(plottable.reshape(128,128), 
    180183                   interpolation='nearest', aspect=1, origin='upper', 
Note: See TracChangeset for help on using the changeset viewer.