Changeset 489 in lmdz_wrf for trunk/tools


Ignore:
Timestamp:
Jun 12, 2015, 5:47:18 PM (10 years ago)
Author:
lfita
Message:

Adding use of `dxdy_lonlatDIMS' on 'shad_contour'
Removing some residual debug printings...

Location:
trunk/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/drawing.py

    r478 r489  
    530530
    531531# Getting only that dimensions with coincident names
    532     dimnvx = objdimx.dimensions
    533     cutslice = []
    534     for idimn in objdimx.dimensions:
    535         found = False
    536         for dimsn in dimsshad:
    537             if idimn == dimsn:
    538                 cutslice.append(slice(0,len(objsf.dimensions[idimn])))
    539                 found = True
    540         if not found: cutslice.append(0)
    541 
    542     odimxv = objdimx[tuple(cutslice)]
    543 
    544     dimnvy = objdimy.dimensions
    545     cutslice = []
    546     for idimn in objdimy.dimensions:
    547         found = False
    548         for dimsn in dimsshad:
    549             if idimn == dimsn:
    550                 cutslice.append(slice(0,len(objsf.dimensions[idimn])))
    551                 found = True
    552         if not found: cutslice.append(0)
    553 
    554     odimyv = objdimy[tuple(cutslice)]
     532    odimxv, odimyv = drw.dxdy_lonlatDIMS(objdimx[:], objdimy[:], objdimx.dimensions,     \
     533      objdimy.dimensions, dimvals.replace(':','|').split(','))
     534
     535#    dimnvx = objdimx.dimensions
     536#    cutslice = []
     537#    for idimn in objdimx.dimensions:
     538#        found = False
     539#        for dimsn in dimsshad:
     540#            if idimn == dimsn:
     541#                cutslice.append(slice(0,len(objsf.dimensions[idimn])))
     542#                found = True
     543#        if not found: cutslice.append(0)
     544#
     545#    odimxv = objdimx[tuple(cutslice)]
     546#
     547#    dimnvy = objdimy.dimensions
     548#    cutslice = []
     549#    for idimn in objdimy.dimensions:
     550#        found = False
     551#        for dimsn in dimsshad:
     552#            if idimn == dimsn:
     553#                cutslice.append(slice(0,len(objsf.dimensions[idimn])))
     554#                found = True
     555#        if not found: cutslice.append(0)
     556#
     557#    odimyv = objdimy[tuple(cutslice)]
    555558
    556559#    if len(objdimx.shape) <= 2:
  • trunk/tools/drawing_tools.py

    r488 r489  
    38473847    fname = 'plot_2D_shadow_contour'
    38483848
    3849 
    38503849    if varsv == 'h':
    38513850        print fname + '_____________________________________________________________'
     
    44004399    fname = 'dxdy_lonlat'
    44014400
    4402     print 'Lluis which dimensions x:',ddx,'y:',ddy
    4403 
    44044401    if ddx.find(',') > -1:
    44054402        dxk = 2
     
    44464443    else:
    44474444        slicey.append(slice(0,len(dyv)))
    4448 
    4449     print '    ' + fname + ' Lluis shapes dxv:',dxv.shape,'dyv:',dyv.shape
    4450     print '    ' + fname + ' Lluis slicex:',slicex,'slicey:',slicey
    4451     print '    final shapes x:',len(dxv.shape)-len(ddx),'y:',len(dyv.shape)-len(ddy)
    44524445
    44534446    if dxk == 2 and dyk == 2:
Note: See TracChangeset for help on using the changeset viewer.