Ignore:
Timestamp:
Nov 28, 2011, 10:59:33 AM (13 years ago)
Author:
aslmd
Message:

LMDZ.MARS: corrected wrong datafile default link. MESOSCALE: added 4 to 5 nests files. GRAPHICS: added geo files handling. LMDZ.GENERIC: replaced makegcm by a symboli link to makegcm_whateverversion.

File:
1 edited

Legend:

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

    r425 r426  
    139139          else:                           errormess("no time axis found.")
    140140          vert = nc.variables["altitude"][:]
    141       elif typefile in ['meso','mesoapi']:
     141      elif typefile in ['meso','mesoapi','geo']:
    142142          if vlon is not None or vlat is not None:   indices = bidimfind(lon2d,lat2d,vlon,vlat) ; print '********** INDICES: ', indices
    143143          if slon is not None: slon[0][0] = indices[0] ; slon[0][1] = indices[0]
     
    150150          else:                 londim='WEST-EAST_PATCH_END_UNSTAG'
    151151          lon = np.arange(0,getattr(nc,londim),1) ; lat = np.arange(0,getattr(nc,latdim),1)
    152           if vertmode is None:  vertmode=0
    153           if vertmode == 0:     vert = np.arange(0,getattr(nc,vertdim),1)
    154           else:                 vert = nc.variables["vert"][:]
    155152          time = np.arange(0,len(nc.variables["Times"]),1)
     153          if typefile in ['geo']:   vert = [0.] ; stime = readslices(str(0))
     154          else:
     155              if vertmode is None:  vertmode=0
     156              if vertmode == 0:     vert = np.arange(0,getattr(nc,vertdim),1)
     157              else:                 vert = nc.variables["vert"][:]
    156158       #if firstfile:
    157159       #   lat0 = lat
     
    230232    print "********************************************"
    231233    while error is False:
    232        print "********** nplot", nplot, "error",error
     234       print "********** NPLOT", nplot
    233235     
    234236       ### General plot settings
     
    247249       indexlat  = getsindex(slat,((nplot-1)//nlon)%nlat,lat)
    248250       indexvert = getsindex(svert,((nplot-1)//(nlon*nlat))%nvert,vert)
    249 
    250251       if ope is not None:
    251252           if fileref is not None:      index_f = ((nplot-1)//(nlon*nlat*nvert*ntime))%(len(namefiles)+2)  ## OK only 1 var,  see test in the beginning
     
    261262       if mapmode == 1 and stime is None:   indextime = 1
    262263       else:                                indextime = getsindex(stime,((nplot-1)//(nlon*nlat*nvert))%ntime,time)
     264       ltst = None
    263265       if typefile in ['mesoapi','meso'] and indextime is not None:  ltst = localtime ( interv[0]+indextime*interv[1], 0.5*(wlon[0]+wlon[1]) ) 
    264266       print "********** index lon, lat, vert, time ",indexlon,indexlat,indexvert,indextime
     
    329331                     if mapmode == 1:       m.pcolor( x, y, what_I_plot, cmap = palette, vmin=zevmin, vmax=zevmax )
    330332                     elif mapmode == 0:     pcolor( x, y, what_I_plot, cmap = palette, vmin=zevmin, vmax=zevmax )
    331                  if colorb != 'nobar' and varname != 'HGT' :       
    332                      if (fileref is not None) and (index_f is numplot-1):
    333                         colorbar(fraction=0.05,pad=0.03,format="%.3f",\
    334                                            ticks=np.linspace(zevmin,zevmax,num=min([ticks/2+1,20])),\
    335                                            extend='neither',spacing='proportional')
    336                      else:
    337                         colorbar(fraction=0.05,pad=0.03,format=fmtvar(fvar.upper()),\
    338                                            ticks=np.linspace(zevmin,zevmax,num=min([ticks/2+1,20])),\
    339                                            extend='neither',spacing='proportional')
    340                                            # both min max neither
     333                 if colorb != 'nobar':       
     334                     if (fileref is not None) and (index_f is numplot-1):   daformat = "%.3f"
     335                     else:                                                  daformat = fmtvar(fvar.upper())
     336                     colorbar( fraction=0.05,pad=0.03,format=daformat,\
     337                               ticks=np.linspace(zevmin,zevmax,num=min([ticks/2+1,20])),extend='neither',spacing='proportional' )
    341338               ##### 1D field
    342339               elif len(what_I_plot.shape) is 1:
     
    346343               #### Other cases: (maybe plot 3-D field one day or movie ??)
    347344               else:
    348                  print "WARNING!!! ",len(what_I_plot.shape),"-D PLOT NOT SUPPORTED !!!"
    349                  print "field dimensions: ", what_I_plot.shape
    350                  exit()
    351                
     345                 print "WARNING!!! ",len(what_I_plot.shape),"-D PLOT NOT SUPPORTED !!! dimensions: ",what_I_plot.shape
     346                 errormess("Are you sure you did not forget to prescribe a dimension ?")
    352347           else:
    353348               errormess("There is an error in reducing field !")
     
    382377            if addchar: 
    383378                [addchar,gogol,gogol2] = getlschar ( all_namefile[index_f] )
    384                 plottitle = plottitle + addchar + "_LT"+str(ltst)
    385             else:        plottitle = plottitle + "_LT"+str(ltst)
     379                plottitle = plottitle + addchar + "_LT"
     380            else:        plottitle = plottitle + "_LT"
     381            if ltst is not None: plottitle = plottitle + str(ltst)
    386382       else:
    387383            if fileref is not None:
Note: See TracChangeset for help on using the changeset viewer.