Changeset 457 for trunk/UTIL


Ignore:
Timestamp:
Dec 7, 2011, 11:56:29 AM (13 years ago)
Author:
acolaitis
Message:

PYTHON.

  • added possibility to specify area of plotting, using --area "name_of_area" example --area Sirenum_Crater_small list of areas are in myplot: latinterv (feel free to add more)
  • added operation "-%": difference in percent between two files, with respect to the reference file. [ 100.*(file-ref)/ref ]
  • changed default subplot tile for operations "-" and "-%" to 2x2 instead of 3x1
Location:
trunk/UTIL/PYTHON
Files:
4 edited

Legend:

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

    r453 r457  
    864864        "South_Pole":            [[-90.,-50.],[-180., 180.]],\
    865865        "Close_South_Pole":      [[-90.,-75.],[-180., 180.]],\
     866        "Sirenum_Crater_large":  [[-46.,-34.],[-166., -151.]],\
     867        "Sirenum_Crater_small":  [[-36.,-26.],[-168., -156.]],\
     868
    866869              }
    867870    if area not in list:   area = "Whole"
  • trunk/UTIL/PYTHON/myscript.py

    r453 r457  
    3131    parser.add_option('--res',          action='store',dest='res',       type="float",   default=200.,  help='Resolution for png outputs. --save png needed. [200.]')
    3232    parser.add_option('--trans',        action='store',dest='trans',     type="float",   default=1.,    help='shaded plots transparency, from 0 (transparent) to 1 (opaque) [1]')
     33    parser.add_option('--area',         action='store',dest='area',       type="string",   default=None,  help='Area on the map to be plot [None]')
    3334
    3435    ### SPECIFIC FOR MAPPING [MAPMODE 1]
  • trunk/UTIL/PYTHON/planetoplot.py

    r453 r457  
    5656           mrate=None,\
    5757           mquality=False,\
    58            trans=1):
     58           trans=1,\
     59           zarea=None):
    5960
    6061
     
    189190         elif proj in ["lcc","laea"]:      [wlon,wlat] = wrfinterv(lon2d,lat2d)
    190191         else:                             [wlon,wlat] = simplinterv(lon2d,lat2d)
    191          if zoom:                          [wlon,wlat] = zoomset(wlon,wlat,zoom)
     192         if zoom:                          [wlon,wlat] = zoomset(wlon,wlat,zoom)
     193         elif zarea is not None: [wlon,wlat] = latinterv(area=zarea)
    192194
    193195      all_varname[k] = varname
     
    216218        if "var" not in ope:
    217219             if len(var) > 1: errormess("for this operation... please set only one var !")
    218              if ope in ["-","+"]:
     220             if ope in ["-","+","-%"]:
    219221                if fileref is not None:   all_var[k] = getfield(Dataset(fileref),all_varname[k-1]) ; all_varname[k] = all_varname[k-1] ; all_time[k] = all_time[k-1] ; all_namefile[k] = all_namefile[k-1]
    220222                else:                     errormess("fileref is missing!")
    221223                if ope == "-":     all_var[k+1]= all_var[k-1] - all_var[k]
    222224                elif ope == "+":   all_var[k+1]= all_var[k-1] + all_var[k]
     225                elif ope == "-%":  all_var[k+1]= 100.*(all_var[k-1] + all_var[k])/all_var[k]
    223226                all_varname[k+1] = all_varname[k] ; all_time[k+1] = all_time[k] ; all_namefile[k+1] = all_namefile[k] ; numplot = numplot+2
    224227             elif ope in ["cat"]:
     
    244247    fig = figure()
    245248    subv,subh = definesubplot( numplot, fig )
     249    if ope in ['-','-%']: subv,subh = 2,2
    246250 
    247251    #################################
  • trunk/UTIL/PYTHON/pp.py

    r453 r457  
    141141                invert_y=opt.inverty,xaxis=zexaxis,yaxis=zeyaxis,ylog=opt.logy,yintegral=opt.column,\
    142142                blat=opt.blat,blon=opt.blon,tsat=opt.tsat,flagnolow=opt.nolow,\
    143                 mrate=opt.rate,mquality=opt.quality,trans=opt.trans)
     143                mrate=opt.rate,mquality=opt.quality,trans=opt.trans,zarea=opt.area)
    144144        print 'DONE: '+name
    145145        system("rm -f to_be_erased")
Note: See TracChangeset for help on using the changeset viewer.