Ignore:
Timestamp:
08/04/11 12:58:21 (13 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: No

Ready for Test: No

Interface Changes: 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...

Preparation for check in tuning on NRO filler.
Merge changes in trunk.

r2154
r2156
r2158
r2198-2203
r2212
r2261


Location:
branches/parallel
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/parallel

  • branches/parallel/external-alma

  • branches/parallel/external-alma/atnf/PKSIO/NROReader.cc

    r1868 r2262  
    3939#include <atnf/PKSIO/ASTEDataset.h>
    4040
     41#include <measures/Measures/MEpoch.h>
     42#include <measures/Measures/MPosition.h>
    4143#include <measures/Measures/MDirection.h>
    4244#include <measures/Measures/MCDirection.h>
     45#include <measures/Measures/MeasFrame.h>
    4346#include <measures/Measures/MeasConvert.h>
    4447
     
    314317    //<< srcra << "," << srcdec << ") B1950 to ("
    315318    //<< v( 0 ) << ","<< v( 1 ) << ") J2000" << endl ;
    316     os << LogIO::NORMAL << "SRCDIRECTION convert from ("
    317        << srcra << "," << srcdec << ") B1950 to ("
    318        << v( 0 ) << ","<< v( 1 ) << ") J2000" << LogIO::POST ;
     319    //os << LogIO::NORMAL << "SRCDIRECTION convert from ("
     320    //   << srcra << "," << srcdec << ") B1950 to ("
     321    //   << v( 0 ) << ","<< v( 1 ) << ") J2000" << LogIO::POST ;
    319322  }
    320323  else if ( strncmp( epoch, "J2000", 5 ) == 0 ) {
     
    353356    //<< dirx << "," << diry << ") LB to ("
    354357    //<< v( 0 ) << ","<< v( 1 ) << ") RADEC" << endl ;
    355     os << LogIO::NORMAL << "DIRECTION convert from ("
    356        << dirx << "," << diry << ") LB to ("
    357        << v( 0 ) << ","<< v( 1 ) << ") RADEC" << LogIO::POST ;
     358    //os << LogIO::NORMAL << "DIRECTION convert from ("
     359    //   << dirx << "," << diry << ") LB to ("
     360    //   << v( 0 ) << ","<< v( 1 ) << ") RADEC" << LogIO::POST ;
    358361  }
    359362  else if ( icoord == 2 ) {
    360363    // convert from AZEL to RADEC
     364    vector<double> antpos = getAntennaPosition() ;
     365    Vector<Quantity> qantpos( 3 ) ;
     366    for ( int ip = 0 ; ip < 3 ; ip++ )
     367      qantpos[ip] = Quantity( antpos[ip], "m" ) ;
     368    Double scantime = Double( dataset_->getScanTime( i ) ) ;
     369    MEpoch me( Quantity( scantime, "d" ), MEpoch::UTC ) ;
     370    MPosition mp( MVPosition( qantpos ), MPosition::ITRF ) ;
     371    MeasFrame mf( me, mp ) ;
    361372    MDirection result =
    362373      MDirection::Convert( MDirection( Quantity( dirx, "rad" ),
    363374                                       Quantity( diry, "rad" ),
    364375                                       MDirection::Ref( MDirection::AZEL ) ),
    365                            MDirection::Ref( MDirection::J2000 ) ) () ;
     376                           MDirection::Ref( MDirection::J2000, mf ) ) () ;
    366377    v = result.getAngle().getValue() ;
    367378    //cout << "NROReader::getDirection()  DIRECTION convert from ("
    368379    //<< dirx << "," << diry << ") AZEL to ("
    369380    //<< v( 0 ) << ","<< v( 1 ) << ") RADEC" << endl ;
    370     os << LogIO::NORMAL << "DIRECTION convert from ("
    371        << dirx << "," << diry << ") AZEL to ("
    372        << v( 0 ) << ","<< v( 1 ) << ") RADEC" << LogIO::POST ;
     381    //os << LogIO::NORMAL << "DIRECTION convert from ("
     382    //   << dirx << "," << diry << ") AZEL to ("
     383    //   << v( 0 ) << ","<< v( 1 ) << ") RADEC" << LogIO::POST ;
    373384  }
    374385  else if ( icoord == 0 ) {
     
    387398      //<< dirx << "," << diry << ") B1950 to ("
    388399      //<< v( 0 ) << ","<< v( 1 ) << ") J2000" << endl ;
    389       os << LogIO::NORMAL << "DIRECTION convert from ("
    390          << dirx << "," << diry << ") B1950 to ("
    391          << v( 0 ) << ","<< v( 1 ) << ") J2000" << LogIO::POST ;
     400      //os << LogIO::NORMAL << "DIRECTION convert from ("
     401      //   << dirx << "," << diry << ") B1950 to ("
     402      //   << v( 0 ) << ","<< v( 1 ) << ") J2000" << LogIO::POST ;
    392403    }
    393404    else if ( strncmp( epoch, "J2000", 5 ) == 0 ) {
     
    441452  //cout << "antpos = " << antpos << endl ;
    442453  string eq = dataset_->getEPOCH() ;
    443   if ( eq.compare( 0, 5, "B1950" ) == 0 )
    444     equinox = 1950.0 ;
    445   else if ( eq.compare( 0, 5, "J2000" ) == 0 )
    446     equinox = 2000.0 ;
     454//   if ( eq.compare( 0, 5, "B1950" ) == 0 )
     455//     equinox = 1950.0 ;
     456//   else if ( eq.compare( 0, 5, "J2000" ) == 0 )
     457//     equinox = 2000.0 ;
     458  // equinox is always 2000.0
     459  equinox = 2000.0 ;
    447460  //cout << "equinox = " << equinox << endl ;
    448461  string vref = dataset_->getVREF() ;
     
    456469  }
    457470  //freqref = vref ;
    458   freqref = "LSRK" ;
     471  //freqref = "LSRK" ;
     472  freqref = "REST" ;
    459473  //cout << "freqref = " << freqref << endl ;
    460474  NRODataRecord *record = dataset_->getRecord( 0 ) ;
     
    483497  //cout << "poltype = " << poltype << endl ;
    484498
    485   vector<Bool> ifs = getIFs() ;
    486   nif = ifs.size() ;
     499  //vector<Bool> ifs = getIFs() ;
     500  //nif = ifs.size() ;
     501  nif = getNumIF() ;
    487502  //cout << "nif = " << nif << endl ;
    488503
    489   vector<Bool> beams = getBeams() ;
    490   nbeam = beams.size() ;
     504  //vector<Bool> beams = getBeams() ;
     505  //nbeam = beams.size() ;
     506  nbeam = getNumBeam() ;
    491507  //cout << "nbeam = " << nbeam << endl ;
    492508
     
    505521                            uInt &scanno,
    506522                            uInt &cycleno,
     523                            uInt &ifno,
    507524                            uInt &beamno,
    508525                            uInt &polno,
     
    548565  //cout << "cycleno = " << cycleno << endl ;
    549566
    550   // beamno
    551   string arryt = string( record->ARRYT ) ;
    552   string sbeamno = arryt.substr( 1, arryt.size()-1 ) ;
    553   uInt ibeamno = atoi( sbeamno.c_str() ) ;
    554   beamno = ibeamno - 1 ;
     567  // beamno and ifno
     568  string rxname = dataset_->getRX()[0] ;
     569  if ( rxname.find("MULT2") != string::npos ) {
     570    string arryt = string( record->ARRYT ) ;
     571    beamno = dataset_->getArrayId( arryt ) ;
     572    ifno = 0 ;
     573  }
     574  else {
     575    beamno = 0 ;
     576    string arryt = string( record->ARRYT ) ;
     577    ifno = dataset_->getArrayId( arryt ) ;
     578  }
    555579  //cout << "beamno = " << beamno << endl ;
    556580
     
    575599
    576600  // scantime
    577   scantime = Double( dataset_->getStartIntTime( irow ) ) ;
     601  //scantime = Double( dataset_->getStartIntTime( irow ) ) ;
     602  scantime = Double( dataset_->getScanTime( irow ) ) ;
    578603  //cout << "scantime = " << scantime << endl ;
    579604
Note: See TracChangeset for help on using the changeset viewer.