Changeset 2671 for trunk/python
- Timestamp:
- 10/18/12 18:36:25 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/python/asapgrid.py
r2669 r2671 135 135 self.gridder._defineimage( nx, ny, cellx, celly, center ) 136 136 137 def setFunc( self, func='box', width=-1 ):137 def setFunc( self, func='box', width=-1, gwidth="", jwidth="" ): 138 138 """ 139 139 Set convolution function. Possible options are 'box' (Box-car, … … 151 151 choose pre-defined value for each convolution function. 152 152 """ 153 self.gridder._setfunc( func, width ) 153 fname = func.upper() 154 if fname == 'GAUSS' or fname == 'GJINC': 155 gw = str(gwidth) 156 jw = str(jwidth) 157 w = str(width) 158 if w[0] == '-': w = '' 159 #self.gridder._setfunc(fname, -1, w, gw, jw) 160 self.gridder._setfunc(fname,convsupport=-1,gwidth=gw,jwidth=jw,truncate=w) 161 else: 162 self.gridder._setfunc( func, convsupport=width ) 154 163 155 164 def setWeight( self, weightType='uniform' ): … … 223 232 asaplog.push('plot: elapsed time %s sec'%(t1-t0)) 224 233 asaplog.post('DEBUG','asapgrid.plot') 234 235 def plotFunc(self, clear=True): 236 """ 237 Support function to see the shape of current grid function. 238 239 clear -- clear panel if True. Default is True. 240 """ 241 pl.figure(11) 242 if clear: 243 pl.clf() 244 f = self.gridder._getfunc() 245 convsampling = 100 246 a = numpy.arange(0,len(f)/convsampling,1./convsampling,dtype=float) 247 pl.plot(a,f,'.-') 248 pl.xlabel('pixel') 249 pl.ylabel('convFunc') 225 250 226 251 class asapgrid2: … … 367 392 choose pre-defined value for each convolution function. 368 393 """ 369 self.gridder._setfunc( func, width ) 394 fname = func.upper() 395 if fname == 'GAUSS' or fname == 'GJINC': 396 gw = str(gwidth) 397 jw = str(jwidth) 398 w = str(width) 399 if w[0] == '-': w = '' 400 #self.gridder._setfunc(fname, -1, w, gw, jw) 401 self.gridder._setfunc(fname,convsupport=-1,gwidth=gw,jwidth=jw,truncate=w) 402 else: 403 self.gridder._setfunc( func, convsupport=width ) 370 404 371 405 def setWeight( self, weightType='uniform' ): … … 408 442 tp = 0 if rcParams['scantable.storage']=='memory' else 1 409 443 return scantable( self.gridder._get( tp ), average=False ) 444 445 def plotFunc(self, clear=True): 446 """ 447 Support function to see the shape of current grid function. 448 449 clear -- clear panel if True. Default is True. 450 """ 451 pl.figure(11) 452 if clear: 453 pl.clf() 454 f = self.gridder._getfunc() 455 convsampling = 100 456 a = numpy.arange(0,len(f)/convsampling,1./convsampling,dtype=float) 457 pl.plot(a,f,'.-') 458 pl.xlabel('pixel') 459 pl.ylabel('convFunc') 410 460 411 461 class _SDGridPlotter:
Note:
See TracChangeset
for help on using the changeset viewer.