Changeset 396 in lmdz_wrf for trunk/tools/drawing.py
- Timestamp:
- Apr 8, 2015, 4:01:25 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/drawing.py
r383 r396 519 519 odimyu = objdimy.getncattr('units') 520 520 521 # Getting only t at dimensions with coincident names521 # Getting only that dimensions with coincident names 522 522 dimnvx = objdimx.dimensions 523 523 cutslice = [] … … 580 580 581 581 if mapvalue == 'None': mapvalue = None 582 583 print ' ' + fname + ': Lluis shapes valshad:',valshad.shape,'valcont:',valcont.shape584 582 585 583 drw.plot_2D_shadow_contour(valshad, valcont, vnamesfig, odimxv, odimyv, odimxu, \ … … 764 762 if vdimxn == timename: 765 763 timevals = objsf.variables[vdimxn][:] 764 timedims = objsf.variables[vdimxn].dimensions 766 765 dimt = 'x' 767 766 ovalaxis = objsf.variables[vdimyn] … … 769 768 elif vdimyn == timename: 770 769 timevals = objsf.variables[vdimyn][:] 770 timedims = objsf.variables[vdimyn].dimensions 771 771 dimt = 'y' 772 772 ovalaxis = objsf.variables[vdimxn] … … 779 779 timepos, timelabels = drw.CFtimes_plot(timevals, timeunit, timekind, timefmt) 780 780 781 if len(ovalaxis.shape) <= 2: 782 ovalaxisv = ovalaxis[:] 783 784 elif len(ovalaxis.shape) == 3: 785 ovalaxisv = ovalaxis[0,:] 786 else: 787 print errormsg 788 print ' ' + fname + ': shape of dimension variable:', ovalaxis.shape, \ 789 ' not ready!!' 790 quit(-1) 781 # Getting only that dimensions with coincident names 782 dimnvx = ovalaxis.dimensions 783 784 cutslice = [] 785 for idimn in dimsshad: 786 found = False 787 for dimsn in dimnvx: 788 if idimn == dimsn: 789 cutslice.append(slice(0,len(objsf.dimensions[idimn]))) 790 found = True 791 if not found: cutslice.append(0) 792 793 ovalaxisv = ovalaxis[tuple(cutslice)] 794 795 ## if len(ovalaxis.shape) <= 2: 796 ## ovalaxisv = ovalaxis[:] 797 798 ## elif len(ovalaxis.shape) == 3: 799 ## ovalaxisv = ovalaxis[0,:] 800 ## else: 801 ## print errormsg 802 ## print ' ' + fname + ': shape of dimension variable:', ovalaxis.shape, \ 803 ## ' not ready!!' 804 ## quit(-1) 791 805 792 806 if countlabelfmt == 'None': … … 1922 1936 dimxv = dimtvalues[0:dimtsqx] 1923 1937 dimyv = dimtvalues[0:dimt:dimtsqx] 1924 1925 print 'Lluis lens: dimxv, dimyv:',len(dimxv), len(dimyv)1926 1938 1927 1939 dimn = ['time','time']
Note: See TracChangeset
for help on using the changeset viewer.