Changeset 1360 for trunk/src/STFrequencies.cpp
- Timestamp:
- 04/27/07 11:00:43 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/STFrequencies.cpp
r941 r1360 41 41 } 42 42 43 asap::STFrequencies::STFrequencies( casa::Table tab ) :43 STFrequencies::STFrequencies( casa::Table tab ) : 44 44 STSubTable(tab, name_) 45 45 { … … 54 54 } 55 55 56 STFrequencies & asap::STFrequencies::operator=( const STFrequencies & other )56 STFrequencies & STFrequencies::operator=( const STFrequencies & other ) 57 57 { 58 58 if ( this != &other ) { … … 140 140 // get first row - there should only be one matching id 141 141 const TableRecord& rec = row.get(0); 142 143 142 return SpectralCoordinate( getFrame(true), rec.asDouble("REFVAL"), 144 143 rec.asDouble("INCREMENT"), … … 147 146 148 147 SpectralCoordinate 149 asap::STFrequencies::getSpectralCoordinate( const MDirection& md,150 151 152 148 STFrequencies::getSpectralCoordinate( const MDirection& md, 149 const MPosition& mp, 150 const MEpoch& me, 151 Double restfreq, uInt id ) const 153 152 { 154 153 SpectralCoordinate spc = getSpectralCoordinate(id); … … 242 241 } 243 242 244 std::string asap::STFrequencies::getFrameString( bool base ) const243 std::string STFrequencies::getFrameString( bool base ) const 245 244 { 246 245 if ( base ) return table_.keywordSet().asString("BASEFRAME"); … … 248 247 } 249 248 250 std::string asap::STFrequencies::getUnitString( ) const249 std::string STFrequencies::getUnitString( ) const 251 250 { 252 251 return table_.keywordSet().asString("UNIT"); 253 252 } 254 253 255 Unit asap::STFrequencies::getUnit( ) const254 Unit STFrequencies::getUnit( ) const 256 255 { 257 256 return Unit(table_.keywordSet().asString("UNIT")); 258 257 } 259 258 260 std::string asap::STFrequencies::getDopplerString( ) const259 std::string STFrequencies::getDopplerString( ) const 261 260 { 262 261 return table_.keywordSet().asString("DOPPLER"); 263 262 } 264 263 265 MDoppler::Types asap::STFrequencies::getDoppler( ) const264 MDoppler::Types STFrequencies::getDoppler( ) const 266 265 { 267 266 String dpl = table_.keywordSet().asString("DOPPLER"); … … 275 274 } 276 275 277 std::string asap::STFrequencies::print( int id )276 std::string STFrequencies::print( int id ) 278 277 { 279 278 Table t; … … 303 302 } 304 303 305 bool asap::STFrequencies::conformant( const STFrequencies& other ) const304 bool STFrequencies::conformant( const STFrequencies& other ) const 306 305 { 307 306 const Record& r = table_.keywordSet(); … … 314 313 } 315 314 316 std::vector< std::string > asap::STFrequencies::getInfo( ) const315 std::vector< std::string > STFrequencies::getInfo( ) const 317 316 { 318 317 const Record& r = table_.keywordSet(); … … 324 323 } 325 324 326 void asap::STFrequencies::setInfo( const std::vector< std::string >& theinfo )325 void STFrequencies::setInfo( const std::vector< std::string >& theinfo ) 327 326 { 328 327 if ( theinfo.size() != 3 ) throw(AipsError("setInfo needs three parameters")); … … 336 335 } 337 336 338 void asap::STFrequencies::setUnit( const std::string & unit )337 void STFrequencies::setUnit( const std::string & unit ) 339 338 { 340 339 if (unit == "" || unit == "pixel" || unit == "channel" ) { … … 350 349 } 351 350 352 void asap::STFrequencies::setFrame(MFrequency::Types frame, bool base )351 void STFrequencies::setFrame(MFrequency::Types frame, bool base ) 353 352 { 354 353 String f = MFrequency::showType(frame); … … 360 359 } 361 360 362 void asap::STFrequencies::setFrame( const std::string & frame, bool base )361 void STFrequencies::setFrame( const std::string & frame, bool base ) 363 362 { 364 363 MFrequency::Types mdr; … … 380 379 } 381 380 382 void asap::STFrequencies::setDoppler( const std::string & doppler )381 void STFrequencies::setDoppler( const std::string & doppler ) 383 382 { 384 383 MDoppler::Types mdt; … … 397 396 } 398 397 398 void STFrequencies::shiftRefPix(int npix, uInt id) 399 { 400 Table t = table_(table_.col("ID") == Int(id) ); 401 if ( t.nrow() == 0 ) throw(AipsError("Selected Illegal frequency id")); 402 ScalarColumn<Double> tcol(t, "REFPIX"); 403 tcol.put(0, tcol(0)+Double(npix)); 404 } 399 405 400 406 } // namespace
Note: See TracChangeset
for help on using the changeset viewer.