Changeset 2632 for trunk


Ignore:
Timestamp:
08/07/12 18:28:59 (12 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: Yes CAS-2825

Ready for Test: Yes

Interface Changes: No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: No

Module(s): Module Names change impacts.

Description: Describe your changes here...

DEC. correction on R.A. grid.


Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/GenericEdgeDetector.cpp

    r2626 r2632  
    109109  const Double *y_p = dir_p + 1 ;
    110110  for ( uInt i = 0 ; i < len ; i++ ) {
    111     *px_p = pcenx_ + ( *x_p - cenx_ ) / dx_ ;
     111    *px_p = pcenx_ + ( *x_p - cenx_ ) * decCorr_ / dx_ ;
    112112    *py_p = pceny_ + ( *y_p - ceny_ ) / dy_ ;
    113113    px_p += 2 ;
     
    123123  os_.origin(LogOrigin( "GenericEdgeDetector", "setup", WHERE )) ;
    124124
     125  Double xmax, xmin, ymax, ymin ;
     126  minMax( xmin, xmax, dir_.row( 0 ) ) ;
     127  minMax( ymin, ymax, dir_.row( 1 ) ) ;
     128  Double wx = ( xmax - xmin ) * 1.1 ;
     129  Double wy = ( ymax - ymin ) * 1.1 ;
     130
     131  cenx_ = 0.5 * ( xmin + xmax ) ;
     132  ceny_ = 0.5 * ( ymin + ymax ) ;
     133  decCorr_ = 1.0 / cos( ceny_ ) ;
     134
    125135  uInt len = time_.nelements() ;
    126136  Matrix<Double> dd = dir_.copy() ;
    127137  for ( uInt i = len-1 ; i > 0 ; i-- ) {
    128     dd(0,i) = dd(0,i) - dd(0,i-1) ;
     138    dd(0,i) = ( dd(0,i) - dd(0,i-1) ) * decCorr_ ;
    129139    dd(1,i) = dd(1,i) - dd(1,i-1) ;
    130140  }
     
    141151  dir_.freeStorage( dir_p, b ) ;
    142152  Double med = median( dr, False, True, True ) ;
    143   dx_ = med * width_ ;
    144   dy_ = dx_ ;
    145 
    146   Double xmax, xmin, ymax, ymin ;
    147   minMax( xmin, xmax, dir_.row( 0 ) ) ;
    148   minMax( ymin, ymax, dir_.row( 1 ) ) ;
    149   Double wx = ( xmax - xmin ) * 1.1 ;
    150   Double wy = ( ymax - ymin ) * 1.1 ;
    151 
    152   cenx_ = 0.5 * ( xmin + xmax ) ;
    153   ceny_ = 0.5 * ( ymin + ymax ) ;
     153  dy_ = med * width_ ;
     154  dx_ = dy_ * decCorr_ ;
    154155
    155156  nx_ = uInt( ceil( wx / dx_ ) ) ;
  • trunk/src/GenericEdgeDetector.h

    r2617 r2632  
    6262  casa::Double dx_ ;
    6363  casa::Double dy_ ;
     64  casa::Double decCorr_ ;
    6465 
    6566  // storage for detection
Note: See TracChangeset for help on using the changeset viewer.