Ignore:
Timestamp:
Nov 16, 2011, 3:11:06 PM (13 years ago)
Author:
acolaitis
Message:

PYTHON. Corrected the way missing values are handled for 2D plots. They now don't affect plot boundary computations, do not provok color gradient near plot boundary edges. Moreover, mean function has been modified to return a value when averaging over a missing value and a real value.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UTIL/PYTHON/myplot.py

    r385 r391  
    128128    from scipy import integrate
    129129    if yint:
    130        output = integrate.trapz(input,x=vert,axis=ax)
     130       if type(input).__name__=='MaskedArray':
     131          input.set_fill_value([np.NaN])
     132          output = integrate.trapz(input.filled(),x=vert,axis=ax)
     133       else:
     134          output = integrate.trapz(input.filled(),x=vert,axis=ax)
    131135    else:
    132136       output = mean(input,axis=ax)
Note: See TracChangeset for help on using the changeset viewer.