Changeset 990 for trunk/UTIL/PYTHON/planetoplot_v2/ppclass.py
- Timestamp:
- Jun 14, 2013, 9:52:31 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/PYTHON/planetoplot_v2/ppclass.py
r984 r990 161 161 changetime=None,\ 162 162 units=None,\ 163 savtxt=False,\ 163 164 title=None): 164 165 self.request = None … … 199 200 self.includedate = includedate 200 201 self.changetime = changetime 202 self.savtxt = savtxt 201 203 ## here are user-defined plot settings 202 204 ## -- if not None, valid on all plots in the pp() objects … … 262 264 self.includedate = other.includedate 263 265 self.changetime = other.changetime 266 self.savtxt = other.savtxt 264 267 else: 265 268 print "!! ERROR !! argument must be a pp object." ; exit() … … 943 946 # finally make the plot 944 947 pl.make() 948 # possibly print results in a text file 949 if self.savtxt: 950 if self.verbose: print "**** Printing results in a text file" 951 name = pl.var + "%04d" % self.n 952 ppplot.writeascii(field=pl.field,absc=pl.absc,name=name) 945 953 # increment plot count (and propagate this in plotin) 946 954 self.n = self.n+1 … … 1299 1307 self.name_z = "z grid points" 1300 1308 else: 1301 self.field_z = self.f.variables[self.name_z][:] # specify dimension 1302 # TBD: have to check that this is not a 3D field 1309 tabalt = self.f.variables[self.name_z] 1310 # (consider the case where tabtime is not dim 1) TBD: 2D and 3D cases 1311 if tabalt.ndim == 4: 1312 try: 1313 self.field_z = tabalt[1,:,0,0] # 4D case. alt is usually third dimension. 1314 # 1 for time to avoid initial 0s 1315 except: 1316 self.field_z = tabalt[0,:,0,0] 1317 if self.verbose: print "!! WARNING !! "+self.name_z+" is 4D var. We made it 1D." 1318 else: 1319 self.field_z = self.f.variables[self.name_z][:] # specify dimension 1303 1320 if self.dim_z > 1: 1304 1321 if self.verbose: print "**** OK. z axis %4.0f values [%5.1f,%5.1f]" % (self.dim_z,self.field_z.min(),self.field_z.max())
Note: See TracChangeset
for help on using the changeset viewer.