Changeset 1002 for trunk/UTIL
- Timestamp:
- Jul 5, 2013, 2:34:21 PM (11 years ago)
- Location:
- trunk/UTIL/PYTHON/planetoplot_v2
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UTIL/PYTHON/planetoplot_v2/examples/zonalmean.py
r923 r1002 6 6 temp.file = "/home/aymeric/Big_Data/DATAPLOT/diagfired.nc" 7 7 temp.var = "temp" 8 temp.x = "-180,1 80"8 temp.x = "-180,175" 9 9 temp.y = "-90,90" 10 10 temp.t = "0,1" … … 18 18 u.file = "/home/aymeric/Big_Data/DATAPLOT/diagfired.nc" 19 19 u.var = "u" 20 u.x = "-180,1 80"20 u.x = "-180,175" 21 21 u.y = None 22 22 u.t = "0.5" -
trunk/UTIL/PYTHON/planetoplot_v2/ppclass.py
r991 r1002 623 623 obj = self.request[i][j][t][z][y][x] 624 624 obj.getfield() 625 obj.computations() 625 if self.compute != "nothing": 626 obj.computations() 626 627 # save fields in self.f for the user 627 628 self.f[count] = obj.field … … 1296 1297 # if xy axis are apparently undefined, set 2D grid points axis. 1297 1298 if "grid points" not in self.name_x: 1298 if self.field_x.all() == self.field_x[0,0]: 1299 if self.field_x.all() == self.field_x[0,0] \ 1300 or self.field_x.min() == self.field_x.max() \ 1301 or self.field_y.min() == self.field_y.max(): 1299 1302 if self.verbose: print "!! WARNING !! xy axis look undefined. creating non-dummy ones." 1300 1303 self.field_x = np.array(range(self.dim_x)) ; self.name_x = "x grid points" -
trunk/UTIL/PYTHON/planetoplot_v2/ppcompute.py
r942 r1002 100 100 ################ 101 101 ### TBD: works with missing values 102 103 def smooth2diter(field,n=1): 104 count = 0 105 result = field 106 while count < n: 107 result = smooth2d(result, window=2) 108 count = count + 1 109 return result 102 110 103 111 ## Author: AS. uses gauss_kern and blur_image. -
trunk/UTIL/PYTHON/planetoplot_v2/ppplot.py
r991 r1002 262 262 # ---------------------------------- 263 263 def writeascii (field=None,absc=None,name=None): 264 field = np.array(field) 265 absc = np.array(absc) 264 266 if name is None: 265 267 name = "prof" … … 368 370 def check(self): 369 371 if self.field is None: print "!! ERROR !! Please define a field to be plotted" ; exit() 372 else: self.field = np.array(self.field) # ensure this is a numpy array 370 373 371 374 # define_from_var … … 454 457 self.absc = np.array(range(self.field.shape[0])) 455 458 print "!! WARNING !! dummy coordinates on x axis" 459 else: 460 self.absc = np.array(self.absc) # ensure this is a numpy array 456 461 # swapping if requested 457 462 if self.swap: x = self.field ; y = self.absc … … 770 775 if self.addvecx is not None and self.addvecy is not None: 771 776 # vectors on map projection or simple 2D mapping 772 if self.mapmode: [vecx,vecy] = m.rotate_vector(self.addvecx,self.addvecy,self.absc,self.ordi) # for metwinds only ? 773 else: vecx,vecy = self.addvecx,self.addvecy ; x,y = np.meshgrid(x,y) 777 if self.mapmode: 778 [vecx,vecy] = m.rotate_vector(self.addvecx,self.addvecy,self.absc,self.ordi) # for metwinds only ? 779 else: 780 vecx,vecy = self.addvecx,self.addvecy 781 if x.ndim < 2 and y.ndim < 2: x,y = np.meshgrid(x,y) 774 782 # reference vector is scaled 775 if self.wscale is None: self.wscale = ppcompute.mean(np.sqrt(self.addvecx*self.addvecx+self.addvecy*self.addvecy)) 783 if self.wscale is None: 784 self.wscale = ppcompute.mean(np.sqrt(self.addvecx*self.addvecx+self.addvecy*self.addvecy)) 776 785 # make vector field 777 786 if self.mapmode:
Note: See TracChangeset
for help on using the changeset viewer.