Ignore:
Timestamp:
Mar 31, 2012, 7:33:41 PM (13 years ago)
Author:
aslmd
Message:

UTIL PYTHON : for mesoscale plots 1. improved the case of pressure interpolation -i 1 or 2 ; 2. fixed the mean capabilities e.g. --lat 15.,35. now working fine the problem was the wrong dimension being considered in slon, my bad.

File:
1 edited

Legend:

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

    r578 r610  
    7979            zelevel = float(inputnvert[0])
    8080            ze_interp_levels = [-9999.]
    81         elif np.array(inputnvert).size == 2:
     81        elif np.array(inputnvert).size > 2:
    8282            zelevel = -99.
    83             ze_interp_levels = np.linspace(float(inputnvert[0]),float(inputnvert[1]),20)
    84         else:
    85             zelevel = -99.
    86             ze_interp_levels = np.linspace(float(inputnvert[0]),float(inputnvert[1]),float(inputnvert[2]))
     83            start = float(inputnvert[0])
     84            stop = float(inputnvert[1])
     85            if np.array(inputnvert).size == 2:  numsample = 20
     86            else:                               numsample = float(inputnvert[2])
     87            if stop > start:   
     88               ## altitude coordinates
     89               ze_interp_levels = np.linspace(start,stop,numsample)
     90            else:
     91               ## pressure coordinates
     92               ze_interp_levels = np.logspace(np.log10(start),np.log10(stop),numsample)
    8793
    8894        #########################################################
Note: See TracChangeset for help on using the changeset viewer.