Changeset 2208 for trunk/external-alma/asdm2ASAP/ASDMFiller.cc
- Timestamp:
- 07/06/11 16:52:38 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/external-alma/asdm2ASAP/ASDMFiller.cc
r2197 r2208 12 12 #include <casa/Arrays/Matrix.h> 13 13 #include <casa/Quanta/MVTime.h> 14 #include <casa/Logging/LogMessage.h> 14 15 15 16 #include "ASDMFiller.h" … … 22 23 : FillerBase( stable ), 23 24 antennaId_( -1 ), 24 antennaName_( "" ) 25 { 26 cout << "This is constructor of ASDMFiller" << endl ; 27 25 antennaName_( "" ), 26 className_("ASDMFiller") 27 { 28 28 reader_ = new ASDMReader() ; 29 30 cout << "input filename is " << stable->table().tableName() << endl ;31 29 } 32 30 33 31 ASDMFiller::~ASDMFiller() 34 32 { 35 cout << "This is destructor of ASDMFiller" << endl ; 33 // nothing to do? 34 logsink_ = 0 ; 35 } 36 37 void ASDMFiller::setLogger( CountedPtr<LogSinkInterface> &logsink ) 38 { 39 logsink_ = logsink ; 40 if ( !(reader_.null()) ) { 41 reader_->setLogger( logsink ) ; 42 } 36 43 } 37 44 38 45 bool ASDMFiller::open( const string &filename, const Record &rec ) 39 46 { 47 String funcName = "open" ; 40 48 bool status = reader_->open( filename, rec ) ; 41 49 … … 43 51 antennaName_ = reader_->getAntennaName() ; 44 52 45 cout << "antennaId_ = " << antennaId_ << endl;46 cout << "antennaName_ = " << antennaName_ << endl;53 //logsink->postLocally( LogMessage("antennaId_ = "+String::toString(antennaId_),LogOrigin(className_,funcName,WHERE)) ) ; 54 //logsink->postLocally( LogMessage("antennaName_ = "+antennaName_,LogOrigin(className_,funcName,WHERE)) ) ; 47 55 48 56 return status ; … … 51 59 void ASDMFiller::fill() 52 60 { 61 String funcName = "fill" ; 62 53 63 // header 54 64 fillHeader() ; … … 65 75 uInt numConfigDescId = configDescIdList.size() ; 66 76 67 cout << "configDescIdList = " << configDescIdList << endl;77 //logsink->postLocally( LogMessage("configDescIdList = "+String::toString(configDescIdList),LogOrigin(className_,funcName,WHERE)) ) ; 68 78 69 79 // get field list … … 71 81 uInt numFieldId = fieldIdList.size() ; 72 82 73 cout << "fieldIdList = " << fieldIdList << endl;83 //logsink->postLocally( LogMessage("fieldIdList = "+String::toString(fieldIdList),LogOrigin(className_,funcName,WHERE)) ) ; 74 84 75 85 // BEAMNO is always 0 since ALMA antenna is single beam … … 83 93 84 94 for ( uInt icon = 0 ; icon < numConfigDescId ; icon++ ) { 85 //Vector<uInt> dataDescIdList = reader_->getDataDescIdList( configDescIdList[icon] ) ;86 //uInt numDataDescId = dataDescIdList.size() ;87 //Vector<uInt> switchCycleIdList = reader_->getSwitchCycleIdList( configDescIdList[icon] ) ;88 //Vector<uInt> feedIdList = reader_->getFeedIdList( configDescIdList[icon] ) ;89 //uInt numFeedId = feedIdList.size() ;90 95 for ( unsigned int ifield = 0 ; ifield < numFieldId ; ifield++ ) { 91 cout << "start configDescId " << configDescIdList[icon] 92 << " fieldId " << fieldIdList[ifield] << endl ; 96 //logsink_->postLocally( LogMessage("start configDescId "+String::toString(configDescIdList[icon])+" fieldId "+String::toString(fieldIdList[ifield]),LogOrigin(className_,funcName,WHERE)) ) ; 93 97 94 98 //Bool status = reader_->setMainRow( configDescIdList[icon], fieldIdList[ifield] ) ; 95 99 if ( !(reader_->setMainRow( configDescIdList[icon], fieldIdList[ifield] )) ) { 96 cout << "skip configDescId " << configDescIdList[icon] 97 << ", fieldId " << fieldIdList[ifield] << endl ; 100 //logsink_->postLocally( LogMessage("skip configDescId "+String::toString(configDescIdList[icon])+" fieldId "+String::toString(fieldIdList[ifield]),LogOrigin(className_,funcName,WHERE)) ) ; 98 101 continue ; 99 102 } … … 102 105 uInt nrow = reader_->getNumMainRow() ; 103 106 104 cout << "There are " << nrow << " rows in Main table." << endl;107 //logsink_->postLocally( LogMessage("There are "+String::toString(nrow)+" rows in Main table corresponding to configDescId "+String::toString(configDescIdList[icon]+" fieldId "+String::toString(fieldIdList[ifield]),LogOrigin(className_,funcName,WHERE)) ) ; 105 108 106 109 // CYCLENO … … 112 115 if ( !(reader_->setMainRow( irow )) ) { 113 116 // skip row since the row doesn't have valid configDescId 114 cout << "skip " << irow << endl;117 //logsink_->postLocally( LogMessage("skip "+String::toString(irow),LogOrigin(className_,funcName,WHERE)) ) ; 115 118 continue ; 116 119 } … … 122 125 // set data 123 126 if ( !(reader_->setData()) ) { 124 // skip row since failed to retrieve data 125 cout << "skip " << irow << endl ; 127 // skip row since reader failed to retrieve data 128 //logsink_->postLocally( LogMessage("skip "+String::toString(irow),LogOrigin(className_,funcName,WHRER)) ) ; 129 continue ; 126 130 } 127 131 … … 235 239 toJ2000( direction, az, el, mjd, antpos ) ; 236 240 } 237 cout << "direction = " << direction << endl;241 //logsink_->postLocally( LogMessage("direction = "+String::toString(direction),LogOrigin(className_,funcName,WHERE)) ) ; 238 242 setDirection( direction, (casa::Float)az, (casa::Float)el ) ; 239 243 240 244 // loop on polarization 241 245 vector<unsigned int> dataShape = reader_->getDataShape( idata ) ; 242 for ( unsigned int i = 0 ; i < dataShape.size() ; i++ ) { 243 if ( i == 0 ) 244 cout << "dataShape=[" << dataShape[i] << ", " ; 245 else if ( i == dataShape.size()-1 ) 246 cout << dataShape[i] << "]" << endl ; 247 else 248 cout << dataShape[i] << ", " ; 249 } 246 // ostringstream oss ; 247 // for ( unsigned int i = 0 ; i < dataShape.size() ; i++ ) { 248 // if ( i == 0 ) 249 // oss << "dataShape=[" << dataShape[i] << ", " ; 250 // else if ( i == dataShape.size()-1 ) 251 // oss << dataShape[i] << "]" ; 252 // else 253 // oss << dataShape[i] << ", " ; 254 // } 255 // logsink_->postLocally( LogMessage(oss.str(),LogOrigin(className_,funcName,WHERE)) ) ; 256 250 257 //int numPol = reader_->getNumPol( idata ) ; 251 258 unsigned int numPol = dataShape[0] ; 252 259 unsigned int numChan = dataShape[1] ; 253 260 254 cout << "numPol = " << numPol << endl;261 //logsink_->postLocally( LogMessage("numPol = "+String::toString(numPol),LogOrigin(className_,funcName,WHERE)) ) ; 255 262 256 263 // OPACITY … … 295 302 } 296 303 } 297 298 cout << "filled" << endl ;299 304 300 305 return ; … … 481 486 Vector<casa::Double> antpos ) 482 487 { 488 String funcName = "toJ2000" ; 489 483 490 Vector<casa::Double> azel( 2 ) ; 484 491 azel[0] = az ; … … 491 498 MPosition mp( MVPosition( qantpos ), 492 499 MPosition::ITRF ) ; 493 mp.print( cout) ;500 // mp.print( os_.output() ) ; 494 501 MeasFrame mf( me, mp ) ; 495 502 MDirection::Convert toj2000( MDirection::AZELGEO, 496 //MDirection::Convert toj2000( MDirection::AZEL,497 //MDirection::Convert toj2000( MDirection::AZELSW,498 //MDirection::Convert toj2000( MDirection::AZELSWGEO,499 //MDirection::Convert toj2000( MDirection::AZELNE,500 //MDirection::Convert toj2000( MDirection::AZELNEGEO,501 503 MDirection::Ref( MDirection::J2000, mf ) ) ; 502 504 dir = toj2000( azel ).getAngle( "rad" ).getValue() ; 503 cout << "dir = " << dir << endl;504 } 505 505 //logsink->postLocally( LogMessage("dir = "+String::toString(dir),LogOrigin(className_,funcName,WHERE)) ) ; 506 } 507
Note: See TracChangeset
for help on using the changeset viewer.