Changeset 2363


Ignore:
Timestamp:
12/07/11 17:05:24 (12 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: Yes CAS-2816

Ready for Test: No

Interface Changes: Yes/No?

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes/No?

Module(s): Module Names change impacts.

Description: Describe your changes here...

For Gaussian kernel, user-specified kernel width is treated as HWHM,
and convolution support is set to 4*HWHM.


Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/python/asapgrid.py

    r2362 r2363  
    2222        self.gridder._defineimage( nx, ny, cellx, celly, center )
    2323
    24     def setOption( self, convType='box', convSupport=-1 ):
    25         self.gridder._setoption( convType, convSupport )
     24    def setOption( self, convType='box', width=-1 ):
     25        self.gridder._setoption( convType, width )
    2626
    2727    def setWeight( self, weightType='uniform' ):
  • trunk/src/STGrid.cpp

    r2362 r2363  
    623623{
    624624  convFunc = 0.0 ;
    625   for ( Int i = 0 ; i < convSampling_*convSupport_ ; i++ ) {
    626     Double hwhm = convSampling_ * convSupport_ * 0.25 ;
     625  // HWHM of the Gaussian is convSupport_ / 4
     626  // To take into account Gaussian tail, kernel cutoff is set to 4 * HWHM
     627  Int len = convSampling_ * convSupport_ ;
     628  Double hwhm = len * 0.25 ;
     629  for ( Int i = 0 ; i < len ; i++ ) {
    627630    Double val = Double(i) / hwhm ;
    628631    convFunc(i) = exp( -log(2)*val*val ) ;
     
    653656  }
    654657  else if ( convType_ == "GAUSS" ) {
     658    // to take into account Gaussian tail
    655659    if ( convSupport_ < 0 )
    656       convSupport_ = 3 ;
     660      convSupport_ = 12 ; // 3 * 4
     661    else {
     662      convSupport_ = userSupport_ * 4 ;
     663    }
    657664    Int convSize = convSampling_ * ( 2 * convSupport_ + 2 ) ;
    658665    convFunc.resize( convSize ) ;
Note: See TracChangeset for help on using the changeset viewer.