Changeset 2433


Ignore:
Timestamp:
03/14/12 20:34:15 (12 years ago)
Author:
Kana Sugimoto
Message:

New Development: No

JIRA Issue: Yes (CAS-2818)

Ready for Test: Yes

Interface Changes: No

What Interface Changed:

Test Programs: unit test: sdaverage[test900]

Put in Release Notes: No

Module(s):

Description: Higher precision regridding of frequency axis.

*An additional comment for r2431 (forgot to mention this)*
Scantable::regridChannel now regrids Tsys column if necessary, i.e.,
the number of Tsys channels are equal to that of spectra.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/Scantable.cpp

    r2431 r2433  
    18851885}
    18861886
     1887
    18871888void asap::Scantable::regridChannel( int nChan, double dnu )
    18881889{
     
    19051906  }
    19061907
    1907   // change channel number for specCol_ and flagCol_
    1908   //Vector<Float> newspec( nChan, 0 ) ;
    1909   //Vector<uChar> newflag( nChan, false ) ;
     1908  // change channel number for specCol_, flagCol_, and tsysCol_ (if necessary)
    19101909  vector<string> coordinfo = getCoordInfo() ;
    19111910  string oldinfo = coordinfo[0] ;
     
    19551954  int ichan = 0 ;
    19561955  double wsum = 0.0 ;
    1957   Vector<Float> zi( nChan+1 ) ;
    1958   Vector<Float> yi( oldsize + 1 ) ;
     1956  Vector<double> zi( nChan+1 ) ;
     1957  Vector<double> yi( oldsize + 1 ) ;
    19591958  zi[0] = abcissa[0] - 0.5 * olddnu ;
    19601959  //zi[1] = zi[1] + dnu ;
     
    19661965  for ( int ii = 1 ; ii < oldsize ; ii++ )
    19671966    //yi[ii] = abcissa[ii-1] + olddnu ;
    1968     yi[ii] = yi[0] + olddnu * ii ;
    1969   yi[oldsize] = abcissa[oldsize-1] + 0.5 * olddnu ;
     1967    yi[ii] = 0.5* (abcissa[ii-1] + abcissa[ii]) ;
     1968  yi[oldsize] = abcissa[oldsize-1] \
     1969    + 0.5 * (abcissa[oldsize-1] - abcissa[oldsize-2]) ;
    19701970  if ( dnu > 0.0 ) {
    19711971    for ( int ii = 0 ; ii < nChan ; ii++ ) {
Note: See TracChangeset for help on using the changeset viewer.