Changeset 382 in lmdz_wrf for trunk/tools/drawing.py


Ignore:
Timestamp:
Mar 23, 2015, 11:37:10 AM (10 years ago)
Author:
lfita
Message:

Second attempt to fix dimensions issue on 'draw_2D_shad_cont'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/drawing.py

    r381 r382  
    523523    cutslice = []
    524524    for idimn in objdimx.dimensions:
    525         if idimn == dimxvn:
    526             cutslice.append(slice(0,len(objsf.dimensions(idimn))))
    527         else:
    528             cutslice.append(0)
     525        found = False
     526        for dimsn in dimsshad:
     527            if idimn == dimsn:
     528                cutslice.append(slice(0,len(objsf.dimensions(idimn))))
     529                found = True
     530        if not found: cutslice.append(0)
    529531
    530532    odimxv = objdimx[tuple(cutslice)]
     
    533535    cutslice = []
    534536    for idimn in objdimy.dimensions:
    535         if idimn == dimyvn:
    536             cutslice.append(slice(0,len(objsf.dimensions(idimn))))
    537         else:
    538             cutslice.append(0)
     537        found = False
     538        for dimsn in dimsshad:
     539            if idimn == dimsn:
     540                cutslice.append(slice(0,len(objsf.dimensions(idimn))))
     541                found = True
     542        if not found: cutslice.append(0)
    539543
    540544    odimyv = objdimy[tuple(cutslice)]
Note: See TracChangeset for help on using the changeset viewer.