Changeset 2227 for trunk/external-alma


Ignore:
Timestamp:
07/14/11 16:04:17 (13 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: Yes CAS-1913

Ready for Test: Yes

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

Frequency is stored as LSRK value although original frequency is
in an arbitrary frequency frame (e.g. TOPO). Conversion is done
in filler if necessary.


Location:
trunk/external-alma/asdm2ASAP
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/external-alma/asdm2ASAP/ASDMFiller.cc

    r2225 r2227  
    6868  // set Frame for FREQUENCIES table
    6969  string sFreqFrame = reader_->getFrame() ;
    70   MFrequency::Types freqFrame = toFrameType( sFreqFrame ) ;
     70  //MFrequency::Types freqFrame = toFrameType( sFreqFrame ) ;
     71  MFrequency::Types freqFrame = MFrequency::LSRK ;
    7172  table_->frequencies().setFrame( freqFrame, false ) ;
    7273  table_->frequencies().setFrame( freqFrame, true ) ;
     
    143144        double refval = 0.0 ;
    144145        double incr = 0.0 ;
     146        string freqref = "" ;
    145147
    146148        for ( unsigned int idata = 0 ; idata < numData ; idata++ ) {
     
    151153          // IFNO
    152154          uInt ifno = reader_->getIFNo( idata ) ;
    153 
    154 
    155           // REFPIX, REFVAL, INCREMENT
    156           String ifkey = getIFKey( ifno ) ;
    157           if ( ifrec_.isDefined( ifkey ) ) {
    158             getFrequencyRec( ifkey, refpix, refval, incr ) ;
    159           }
    160           else {
    161             reader_->getFrequency( idata, refpix, refval, incr ) ;
    162             setFrequencyRec( ifkey, refpix, refval, incr ) ;
    163           }
    164 
    165           // fill FREQ_ID and add FREQUENCIES row if necessary
    166           setFrequency( (casa::Double)refpix, (casa::Double)refval, (casa::Double)incr ) ;
    167 
    168155
    169156          // rest frequency
     
    176163          setMolecule( restFreqs ) ;
    177164         
    178 
    179165          // time and interval
    180166          casa::Double mjd = (casa::Double)(reader_->getTime( idata )) ;
     
    254240          setDirection( direction, (casa::Float)az, (casa::Float)el ) ;
    255241
     242           // REFPIX, REFVAL, INCREMENT
     243          String ifkey = getIFKey( ifno ) ;
     244          if ( ifrec_.isDefined( ifkey ) ) {
     245            getFrequencyRec( ifkey, refpix, refval, incr ) ;
     246          }
     247          else {
     248            reader_->getFrequency( idata, refpix, refval, incr, freqref ) ;
     249            refval = (double)toLSRK( casa::Double(refval),
     250                                     String(freqref),
     251                                     mjd,
     252                                     antpos,
     253                                     //direction,
     254                                     srcDir,
     255                                     "J2000" ) ;
     256            setFrequencyRec( ifkey, refpix, refval, incr ) ;
     257          }
     258
     259          // fill FREQ_ID and add FREQUENCIES row if necessary
     260          setFrequency( (casa::Double)refpix, (casa::Double)refval, (casa::Double)incr ) ;
     261
    256262          // loop on polarization
    257263          vector<unsigned int> dataShape = reader_->getDataShape( idata ) ;
  • trunk/external-alma/asdm2ASAP/ASDMReader.cc

    r2225 r2227  
    4848bool ASDMReader::open( const string &filename, const casa::Record &rec )
    4949{
    50   String funcName = "open" ;
     50  casa::String funcName = "open" ;
    5151
    5252  // return value
     
    255255                             casa::String &poltype )
    256256{
    257   String funcName = "fillHeader" ;
     257  casa::String funcName = "fillHeader" ;
    258258
    259259  ExecBlockTable &ebtab = asdm_->getExecBlock() ;
     
    431431void ASDMReader::selectConfigDescription()
    432432{
    433   String funcName = "selectConfigDescription" ;
     433  casa::String funcName = "selectConfigDescription" ;
    434434
    435435  vector<ConfigDescriptionRow *> cdrows = asdm_->getConfigDescription().get() ;
     
    467467casa::Vector<casa::uInt> ASDMReader::getFieldIdList()
    468468{
    469   String funcName = "getFieldIdList" ;
     469  casa::String funcName = "getFieldIdList" ;
    470470
    471471  vector<FieldRow *> frows = asdm_->getField().get() ;
     
    544544void ASDMReader::setupIFNO()
    545545{
    546   String funcName = "setupIFNO" ;
     546  casa::String funcName = "setupIFNO" ;
    547547
    548548  vector<SpectralWindowRow *> spwrows = asdm_->getSpectralWindow().get() ;
     
    601601// casa::Vector<casa::uInt> ASDMReader::getFeedIdList( casa::uInt cdid )
    602602// {
    603 //   String funcName = "getFeedIdList" ;
     603//   casa::String funcName = "getFeedIdList" ;
    604604//   
    605605//   Tag cdTag( (unsigned int)cdid, TagType::ConfigDescription ) ;
     
    623623casa::Bool ASDMReader::setData()
    624624{
    625   String funcName = "setData" ;
     625  casa::String funcName = "setData" ;
    626626
    627627  //logsink_->postLocally( LogMessage("try to retrieve binary data",LogOrigin(className_,funcName,WHERE)) ) ;
     
    705705                               double &refpix,
    706706                               double &refval,
    707                                double &incr )
    708 {
    709   String funcName = "getFrequency" ;
     707                               double &incr,
     708                               string &freqref )
     709{
     710  casa::String funcName = "getFrequency" ;
    710711
    711712  Tag ddTag( vmsData_->v_dataDescId[dataIdList_[idx]], TagType::DataDescription ) ;
     
    714715  SpectralWindowRow *spwrow = ddrow->getSpectralWindowUsingSpectralWindowId() ;
    715716  int nchan = spwrow->getNumChan() ;
     717  freqref = "TOPO" ;
     718  if ( spwrow->isMeasFreqRefExists() )
     719    freqref = CFrequencyReferenceCode::toString( spwrow->getMeasFreqRef() ) ;
    716720  if ( nchan == 1 ) {
    717721    //logsink_->postLocally( LogMessage("channel averaged data",LogOrigin(className_,funcName,WHERE)) ) ;
     
    16961700                                    casa::Vector<casa::Double> antpos )
    16971701{
    1698   casa::String funcname = "toJ2000" ;
     1702  casa::String funcName = "toJ2000" ;
    16991703
    17001704  vector<double> newd( dir ) ;
     
    17331737string ASDMReader::getFrame()
    17341738{
    1735   String funcName = "getFrame" ;
     1739  casa::String funcName = "getFrame" ;
    17361740 
    17371741  // default is TOPO
     
    17621766int ASDMReader::getNumIFs()
    17631767{
    1764   String funcName = "getNumIFs" ;
     1768  casa::String funcName = "getNumIFs" ;
    17651769
    17661770  int nif = 0 ;
  • trunk/external-alma/asdm2ASAP/ASDMReader.h

    r2225 r2227  
    183183   * @param refval REFVAL
    184184   * @param incr INCREMENT
     185   * @param freqref frequency reference
    185186   **/
    186187  void getFrequency( unsigned int idx,
    187188                     double &refpix,
    188189                     double &refval,
    189                      double &incr ) ;
     190                     double &incr,
     191                     std::string &freqref ) ;
    190192
    191193  /**
Note: See TracChangeset for help on using the changeset viewer.