Changeset 2022


Ignore:
Timestamp:
03/02/11 16:09:10 (14 years ago)
Author:
Takeshi Nakazato
Message:

New Development: No

JIRA Issue: Yes CAS-2718

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

Copy ASDM subtable that are optionally created by importasdm task.
For filler, their root names are stored as String in table keyword,
while for writer, existing tables are copied and are stored as Table
in table keyword.


Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/MSFiller.cpp

    r2021 r2022  
    120120
    121121  os_ << "Parsing MS options" << endl ;
    122   rec.print(cout) ;
    123122  os_ << "   getPt = " << getPt_ << endl ;
    124123  os_ << "   antenna = " << antenna_ << endl ;
     
    950949
    951950  // save path to POINTING table
    952   //Path datapath(mstable_.tableName()) ;
     951  // 2011/3/2 TN
     952  // So far, path to original POINTING table is always stored
     953  // since sd tasks and regressions don't support getpt control
     954  //if ( !getPt_ ) {
    953955  Path datapath( tablename_ ) ;
    954956  String pTabName = datapath.absoluteName() + "/POINTING" ;
    955957  stab.rwKeywordSet().define( "POINTING", pTabName ) ;
     958  //}
    956959
    957960  // for GBT
    958   if ( antennaName == "GBT" ) {
     961  if ( antennaName.matches( "GBT" ) ) {
    959962    String goTabName = datapath.absoluteName() + "/GBT_GO" ;
    960963    stab.rwKeywordSet().define( "GBT_GO", goTabName ) ;
    961964  }
     965
     966  // for MS created from ASDM
     967  //mstable_.keywordSet().print(cout) ;
     968  const TableRecord &msKeys = mstable_.keywordSet() ;
     969  uInt nfields = msKeys.nfields() ;
     970  for ( uInt ifield = 0 ; ifield < nfields ; ifield++ ) {
     971    String name = msKeys.name( ifield ) ;
     972    //os_ << "name = " << name << LogIO::POST ;
     973    if ( name.find( "ASDM" ) != String::npos ) {
     974      String asdmpath = msKeys.asTable( ifield ).tableName() ;
     975      os_ << "ASDM table: " << asdmpath << LogIO::POST ;
     976      stab.rwKeywordSet().define( name, asdmpath ) ;
     977    }
     978  }
     979
    962980//   double endSec = gettimeofday_sec() ;
    963981//   os_ << "end MSFiller::fill() endSec=" << endSec << " (" << endSec-startSec << "sec)" << LogIO::POST ;
     
    14161434    }
    14171435    if ( tidx[i] == -1 ) {
    1418       Double tsc = scTime[scnrow-1].get( "s" ).getValue() ;
    1419       Double dt = scInterval[scnrow-1] ;
     1436//       Double tsc = scTime[scnrow-1].get( "s" ).getValue() ;
     1437//       Double dt = scInterval[scnrow-1] ;
    14201438//       if ( t <= tsc+0.5*dt ) {
    14211439//         tidx[i] = scnrow-1 ;
  • trunk/src/MSWriter.cpp

    r2021 r2022  
    503503    fillSysCal() ;
    504504
     505  // ASDM tables
     506  const TableRecord &stKeys = table_->table().keywordSet() ;
     507  TableRecord &msKeys = mstable_->rwKeywordSet() ;
     508  uInt nfields = stKeys.nfields() ;
     509  for ( uInt ifield = 0 ; ifield < nfields ; ifield++ ) {
     510    String kname = stKeys.name( ifield ) ;
     511    if ( kname.find( "ASDM" ) != String::npos ) {
     512      String asdmpath = stKeys.asString( ifield ) ;
     513      os_ << "found ASDM table: " << asdmpath << LogIO::POST ;
     514      if ( Table::isReadable( asdmpath ) ) {
     515        Table newAsdmTab( asdmpath, Table::Old ) ;
     516        newAsdmTab.copy( filename_+"/"+kname, Table::New ) ;
     517        os_ << "add subtable: " << kname << LogIO::POST ;
     518        msKeys.defineTable( kname, Table( filename_+"/"+kname, Table::Old ) ) ;
     519      }
     520    }
     521  }
     522
    505523  // replace POINTING table with original one if exists
    506524  if ( ptTabName_ != "" ) {
Note: See TracChangeset for help on using the changeset viewer.