Ignore:
Timestamp:
01/31/13 13:14:27 (12 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: Yes CSV-2532 (may be related to CSV-1908 and CSV-2161)

Ready for Test: Yes

Interface Changes: Yes

What Interface Changed: In tool level, added parameter 'freq_tolsr' to

scantable constructor and function sd.splitant.

Test Programs: test_sdsave, test_importasdm_sd

Put in Release Notes: Yes

Module(s): Module Names change impacts.

Description: Describe your changes here...

In importing MS to Scantable, frequency frame information is
imported as is by default, i.e., base frame in Scantable is
TOPO for ALMA data, which is forcibly converted to LSRK with
wrong time and direction reference.

Some functions have a boolean parameter 'freq_tolsr' that controls
the above behavior. If freq_tolsr is False (default), frequency
is imported as is, while frequency is converted to LSRK (wrongly)
when it is True.


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

Legend:

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

    r2710 r2754  
    2626    antennaId_( -1 ),
    2727    antennaName_( "" ),
    28     className_("ASDMFiller")
     28    className_("ASDMFiller"),
     29    freqToLsr_(False)
    2930{
    3031  reader_ = new ASDMReader() ;
     
    5253  antennaId_ = reader_->getAntennaId() ;
    5354  antennaName_ = reader_->getAntennaName() ;
     55
     56  if (rec.isDefined("asdm")) {
     57    Record asdmrec = rec.asRecord("asdm") ;
     58    if (asdmrec.isDefined("freq_tolsr")) {
     59      freqToLsr_ = asdmrec.asBool("freq_tolsr");
     60    }
     61  }
     62  logsink_->postLocally(LogMessage("freqToLsr_ = "+String(freqToLsr_?"True":"False"), LogOrigin(className_, funcName, WHERE)));
    5463
    5564  //logsink_->postLocally( LogMessage("antennaId_ = "+String::toString(antennaId_),LogOrigin(className_,funcName,WHERE)) ) ;
     
    7281  MFrequency::Types freqFrame = MFrequency::LSRK ;
    7382  table_->frequencies().setFrame( freqFrame, false ) ;
    74   table_->frequencies().setFrame( freqFrame, true ) ;
     83  if ( freqToLsr_ ) {
     84    table_->frequencies().setFrame( freqFrame, true ) ;
     85  }
     86  else {
     87    string baseFrame = reader_->getFrame() ;
     88    table_->frequencies().setFrame( baseFrame, true ) ;
     89  }
    7590  //logsink_->postLocally( LogMessage("sFreqFrame = "+sFreqFrame,LogOrigin(className_,funcName,WHERE)) ) ;
    7691 
     
    615630  //logsink_->postLocally( LogMessage("freqref = "+freqref,LogOrigin(className_,funcName,WHERE)) ) ;
    616631  casa::Double newf = freq ;
    617   if ( freqref != "LSRK" ) {
     632  if ( freqToLsr_ && freqref != "LSRK" ) {
    618633    MEpoch me( Quantum<casa::Double>( utc, Unit("d") ), MEpoch::UTC ) ;
    619634    Vector< Quantum<casa::Double> > antposQ( 3 ) ;
  • trunk/external-alma/asdm2ASAP/ASDMFiller.h

    r2225 r2754  
    102102
    103103  casa::String className_ ;
     104  casa::Bool freqToLsr_ ;
    104105
    105106} ;
  • trunk/external-alma/asdm2ASAP/asdm2ASAP.cc

    r2273 r2754  
    4949  inp.create( "srt", "all", "spectral resolution mode: all|fr(full resolution)|ca(channel average)|bw(baseband wide)|fr+ca|fr+bw|ca+bw", "String" ) ;
    5050  inp.create( "logfile", "", "logger output", "String" ) ;
     51  inp.create( "freq-tolsr", "False", "Convert frequency frame to LSRK or not: True|False", "Bool" ) ;
    5152  inp.readArguments( argc, argv ) ;
    5253
     
    6061  string resolutionType = inp.getString( "srt" ) ;
    6162  string logfile = inp.getString( "logfile" ) ;
     63  Bool freqToLsr = inp.getBool( "freq-tolsr" ) ;
    6264   
    6365  int numApc = 1 ;
     
    112114    asdmRec.define( "sampling", timeSampling ) ;
    113115    asdmRec.define( "srt", resolutionType ) ;
     116    asdmRec.define( "freq_tolsr", freqToLsr ) ;
    114117    if ( reg.match( antenna.c_str(), antenna.size() ) != String::npos ) {
    115118      // antenna is specifiec as id
Note: See TracChangeset for help on using the changeset viewer.