Changeset 717 for trunk/UTIL


Ignore:
Timestamp:
Jul 4, 2012, 12:46:05 PM (12 years ago)
Author:
acolaitis
Message:

Python. Bug correction for 1D plots. This bug was leading to completely wrong profiles when asking for a unidim plot from a testphys1d output file.

Location:
trunk/UTIL/PYTHON
Files:
2 edited

Legend:

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

    r702 r717  
    204204
    205205## Author: AS + TN + AC
    206 def reducefield (input,d4=None,d3=None,d2=None,d1=None,yint=False,alt=None,anomaly=False,redope=None,mesharea=None):
     206def reducefield (input,d4=None,d3=None,d2=None,d1=None,yint=False,alt=None,anomaly=False,redope=None,mesharea=None,unidim=999):
    207207    ### we do it the reverse way to be compliant with netcdf "t z y x" or "t y x" or "y x"
    208208    ### it would be actually better to name d4 d3 d2 d1 as t z y x
     
    234234    ### now the main part
    235235    if dimension == 2:
     236        #### this is needed for 1d-type files (where dim=2 but axes are time-vert and not lat-lon)
     237        if unidim == 1: d2=d4 ; d1=d3 ; d4=None ; d3=None
    236238        if mesharea is None: mesharea=np.ones(shape)
    237239        if   max(d2) >= shape[0]: error = True
  • trunk/UTIL/PYTHON/planetoplot.py

    r701 r717  
    418418       if varname:   ### what is shaded.
    419419           what_I_plot, error = reducefield( all_var[index_f], d4=indextime, d1=indexlon, d2=indexlat, d3=indexvert, \
    420                                              yint=yintegral, alt=vert, anomaly=anomaly, redope=redope, mesharea=area )
     420                                             yint=yintegral, alt=vert, anomaly=anomaly, redope=redope, mesharea=area, unidim=is1d)
    421421           if mult != 2718.:  what_I_plot = what_I_plot*mult
    422422           else:              what_I_plot = np.log10(what_I_plot) ; print "log plot"
Note: See TracChangeset for help on using the changeset viewer.