Ignore:
Timestamp:
06/27/16 18:22:47 (9 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: No

Ready for Test: Yes

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...


Bug fix on frequency labeling for NOSTAR data. Do not apply additional (NEWSTAR specific) frequency correction if the data is NOSTAR.

Location:
trunk/external-alma/atnf/PKSIO
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/external-alma/atnf/PKSIO/NRODataset.cc

    r3095 r3101  
    14041404  vector<double> chcal = getCHCAL()[ib] ;
    14051405  double f0cal = getF0CAL()[ib] ;
     1406  //cout << "FREQ0=" << fq0 << " F0CAL=" << f0cal << endl;
    14061407  Vector<Double> freqs( ncal, fq0-f0cal ) ;
    14071408
     
    14091410  if ( ivdef == 0 )
    14101411    factor = 1.0 / ( 1.0 - factor ) ;
     1412
    14111413  for ( int ii = 0 ; ii < ncal ; ii++ ) {
     1414    //double freqs_org = freqs[ii];
    14121415    freqs[ii] += fqcal[ii] ;
    1413     if ( ivdef == 0 ) {
    1414       freqs[ii] = freqs[ii] * factor + record->FQTRK * ( 1.0 - factor ) ;
    1415     }
    1416     else if ( ivdef == 1 ) {
    1417       freqs[ii] = freqs[ii] * ( 1.0 + factor ) - record->FQTRK * factor ;
     1416    if (isNewstarFormat()) {
     1417      if ( ivdef == 0 ) {
     1418        freqs[ii] = freqs[ii] * factor + record->FQTRK * ( 1.0 - factor ) ;
     1419      }
     1420      else if ( ivdef == 1 ) {
     1421        freqs[ii] = freqs[ii] * ( 1.0 + factor ) - record->FQTRK * factor ;
     1422      }
    14181423    }
    14191424
     
    14221427    //ofs << i << " " << record->ARRYT << " " << chcal[ii] << " " << freqs[ii] << " " << record->ISCAN << " " << fqcal[ii] << " " << f0cal << " " << record->FQTRK << " " << vel << endl ;
    14231428    //ofs.close() ;
     1429//    cout << setprecision(16) ;
     1430//    cout << "LOOP " << ii << " ARRAY ID=" << record->ARRYT << " CHCAL=" << chcal[ii] << " FREQS(ORG)=" << freqs_org << " FREQS=" << freqs[ii] << " ISCAN=" << record->ISCAN << " FQCAL=" << fqcal[ii] << " F0CAL=" << f0cal << " FQTRK=" << record->FQTRK << " VEL=" << vel << endl ;
    14241431
    14251432  }
     
    14471454  }
    14481455  else {
    1449 
    1450     cw = ( freqs[1] - freqs[0] )
    1451       / ( chcal[1] - chcal[0] ) ;   
     1456    double nchcal = static_cast<double>(chcal[1] - chcal[0]);
     1457    //cout << "nchcal = " << nchcal << endl;
     1458    double bw = freqs[1] - freqs[0];
     1459    //cout << "bw = " << bw << " (effective bw " << bw * (nchcal + 1.0) / nchcal << ")"<< endl;
     1460    cw = bw / nchcal;
     1461    //cout << "cw = " << cw << endl;
    14521462
    14531463    if ( isUSB ) {
     
    14711481  frec_.define( key, f ) ;
    14721482
     1483  //cout << "refpix " << v[0] << " refval " << v[1] << " increment " << v[2] << endl;
    14731484  return v ;
    14741485}
  • trunk/external-alma/atnf/PKSIO/NRODataset.h

    r3066 r3101  
    9090  // Data initialization
    9191  virtual void initialize() = 0 ;
     92
     93  // whether data is NEWSTAR or not
     94  virtual bool isNewstarFormat() const {return true;}
    9295
    9396  // open file
  • trunk/external-alma/atnf/PKSIO/NROOTFDataset.h

    r2782 r3101  
    7777  virtual void initialize() ;
    7878
     79  // this is NOSTAR data
     80  virtual bool isNewstarFormat() const {return false;}
     81
    7982 protected:
    8083  // fill header information
Note: See TracChangeset for help on using the changeset viewer.