Ignore:
Timestamp:
Nov 7, 2011, 12:53:40 AM (13 years ago)
Author:
aslmd
Message:

PYTHON GRAPHICS: for mesoscale files section with vertically interpolated fields with alitude or pressure (through api wrapper) is now supported. the same thing might be useful to be done with zrecast for GCM.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MESOSCALE/LMD_MM_MARS/SRC/PYTHON/planetoplot.py

    r350 r351  
    77
    88def planetoplot (namefiles,\
    9            nvert=0,\
     9           level=0,\
    1010           vertmode=0,\
    1111           proj=None,\
     
    7575      ### Load NETCDF object
    7676      nc  = Dataset(namefile)
    77      
     77
    7878      ##################################
    7979      ### Initial checks and definitions
     
    104104      elif typefile in ['meso','mesoapi']:
    105105          if mapmode == 0:
    106               if var in ['PHTOT','W']:  vertdim='BOTTOM-TOP_PATCH_END_STAG'
    107               else:                     vertdim='BOTTOM-TOP_PATCH_END_UNSTAG'
     106              if var in ['PHTOT','W']:    vertdim='BOTTOM-TOP_PATCH_END_STAG'
     107              else:                       vertdim='BOTTOM-TOP_PATCH_END_UNSTAG'
    108108              if var in ['V']:  latdim='SOUTH-NORTH_PATCH_END_STAG'
    109109              else:             latdim='SOUTH-NORTH_PATCH_END_UNSTAG'
     
    112112              lon = np.arange(0,getattr(nc,londim),1)
    113113              lat = np.arange(0,getattr(nc,latdim),1)
    114               vert = np.arange(0,getattr(nc,vertdim),1)
     114              if vertmode == 0:   vert = np.arange(0,getattr(nc,vertdim),1)
     115              else:               vert = nc.variables["vert"][:]
    115116              time = np.arange(0,len(nc.variables["Times"]),1)
    116117       #if firstfile:
     
    135136         ### Name for title and graphics save file
    136137         basename = getname(var=var,winds=winds,anomaly=anomaly)
    137          basename = basename + getstralt(nc,nvert)  ## can be moved elsewhere for a more generic routine
     138         basename = basename + getstralt(nc,level)  ## can be moved elsewhere for a more generic routine
    138139     
    139140      print "var, var2: ", var, var2
     
    196197               indexlon = None
    197198               indexlat = None
    198                indexvert = nvert  ## ou svert ???
     199               indexvert = level  ## ou svert ???
    199200               nlon = 1
    200201               nlat = 1
Note: See TracChangeset for help on using the changeset viewer.