Changeset 871 for trunk/UTIL
- Timestamp:
- Feb 1, 2013, 6:10:25 AM (12 years ago)
- Location:
- trunk/UTIL/PYTHON
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/PYTHON/myplot.py
r865 r871 732 732 def getdimfromvar (nc): 733 733 varinfile = nc.variables.keys() 734 dim = nc.variables[varinfile[-1]].shape ## usually the last variable is 4D or 3D 735 return dim 734 sav = [0.] 735 for var in varinfile: 736 dim = nc.variables[var].shape ## usually the last variable is 4D or 3D 737 if len(dim) > len(sav): sav=dim 738 return sav 736 739 737 740 ## FROM COOKBOOK http://www.scipy.org/Cookbook/SignalSmooth … … 814 817 elif 'u' in varinfile: [uchar,vchar] = ['u','v'] #; print "this is GCM file" 815 818 elif 'vitu' in varinfile: [uchar,vchar] = ['vitu','vitv'] #; print "this is GCM v5 file" 819 elif 'ucomp' in varinfile: [uchar,vchar] = ['ucomp','vcomp'] 816 820 ### you can add choices here ! 817 821 else: [uchar,vchar] = ['not found','not found'] … … 1118 1122 "TSK": "RdBu_r",\ 1119 1123 "QH2O": "PuBu",\ 1124 "PSFC": "RdYlBu_r",\ 1120 1125 "USTM": "YlOrRd",\ 1121 1126 "WIND": "YlOrRd",\ … … 1235 1240 "Southern_Hemisphere": [[-90., 60.],[-180., 180.]],\ 1236 1241 "Northern_Hemisphere": [[-60., 90.],[-180., 180.]],\ 1242 "Tharsis_alt": [[-30., 60.],[ 190., 350.]],\ 1237 1243 "Tharsis": [[-30., 60.],[-170.,- 10.]],\ 1238 1244 "Whole_No_High": [[-60., 60.],[-180., 180.]],\ … … 1249 1255 "Xanadu": [[-40., 20.],[ 40., 120.]],\ 1250 1256 "Hyperboreae": [[ 80., 87.],[- 70.,- 10.]],\ 1257 "VM_alt": [[-15., 0.],[ 270., 300.]],\ 1251 1258 } 1252 1259 if area not in list: area = "Whole" -
trunk/UTIL/PYTHON/planetoplot.py
r866 r871 228 228 ### --> add a line here if your reference is not present 229 229 else: 230 print "No altitude found. Try to build a simple axis." ; dadim = getdimfromvar(nc)230 dadim = getdimfromvar(nc) ; print "No altitude found. Try to build a simple axis.",dadim 231 231 if len(dadim) == 4: print "-- 4D field. Assume z is dim 2." ; vert = np.arange(dadim[-3]) 232 232 elif len(dadim) == 3: print "-- 3D field. Assume z is dim 1." ; vert = [0.]
Note: See TracChangeset
for help on using the changeset viewer.