Ignore:
Timestamp:
04/27/07 11:00:43 (17 years ago)
Author:
mar637
Message:

enhancement #107; added scantable.shift_refpix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STFrequencies.cpp

    r941 r1360  
    4141}
    4242
    43 asap::STFrequencies::STFrequencies( casa::Table tab ) :
     43STFrequencies::STFrequencies( casa::Table tab ) :
    4444  STSubTable(tab, name_)
    4545{
     
    5454}
    5555
    56 STFrequencies & asap::STFrequencies::operator =( const STFrequencies & other )
     56STFrequencies & STFrequencies::operator=( const STFrequencies & other )
    5757{
    5858  if ( this != &other ) {
     
    140140  // get first row - there should only be one matching id
    141141  const TableRecord& rec = row.get(0);
    142 
    143142  return SpectralCoordinate( getFrame(true), rec.asDouble("REFVAL"),
    144143                             rec.asDouble("INCREMENT"),
     
    147146
    148147SpectralCoordinate
    149   asap::STFrequencies::getSpectralCoordinate( const MDirection& md,
    150                                               const MPosition& mp,
    151                                               const MEpoch& me,
    152                                               Double restfreq, uInt id ) const
     148  STFrequencies::getSpectralCoordinate( const MDirection& md,
     149                                        const MPosition& mp,
     150                                        const MEpoch& me,
     151                                        Double restfreq, uInt id ) const
    153152{
    154153  SpectralCoordinate spc = getSpectralCoordinate(id);
     
    242241}
    243242
    244 std::string asap::STFrequencies::getFrameString( bool base ) const
     243std::string STFrequencies::getFrameString( bool base ) const
    245244{
    246245  if ( base ) return table_.keywordSet().asString("BASEFRAME");
     
    248247}
    249248
    250 std::string asap::STFrequencies::getUnitString( ) const
     249std::string STFrequencies::getUnitString( ) const
    251250{
    252251  return table_.keywordSet().asString("UNIT");
    253252}
    254253
    255 Unit asap::STFrequencies::getUnit( ) const
     254Unit STFrequencies::getUnit( ) const
    256255{
    257256  return Unit(table_.keywordSet().asString("UNIT"));
    258257}
    259258
    260 std::string asap::STFrequencies::getDopplerString( ) const
     259std::string STFrequencies::getDopplerString( ) const
    261260{
    262261  return table_.keywordSet().asString("DOPPLER");
    263262}
    264263
    265 MDoppler::Types asap::STFrequencies::getDoppler( ) const
     264MDoppler::Types STFrequencies::getDoppler( ) const
    266265{
    267266  String dpl = table_.keywordSet().asString("DOPPLER");
     
    275274}
    276275
    277 std::string asap::STFrequencies::print( int id )
     276std::string STFrequencies::print( int id )
    278277{
    279278  Table t;
     
    303302}
    304303
    305 bool asap::STFrequencies::conformant( const STFrequencies& other ) const
     304bool STFrequencies::conformant( const STFrequencies& other ) const
    306305{
    307306  const Record& r = table_.keywordSet();
     
    314313}
    315314
    316 std::vector< std::string > asap::STFrequencies::getInfo( ) const
     315std::vector< std::string > STFrequencies::getInfo( ) const
    317316{
    318317  const Record& r = table_.keywordSet();
     
    324323}
    325324
    326 void asap::STFrequencies::setInfo( const std::vector< std::string >& theinfo )
     325void STFrequencies::setInfo( const std::vector< std::string >& theinfo )
    327326{
    328327  if ( theinfo.size() != 3 ) throw(AipsError("setInfo needs three parameters"));
     
    336335}
    337336
    338 void asap::STFrequencies::setUnit( const std::string & unit )
     337void STFrequencies::setUnit( const std::string & unit )
    339338{
    340339  if (unit == "" || unit == "pixel" || unit == "channel" ) {
     
    350349}
    351350
    352 void asap::STFrequencies::setFrame(MFrequency::Types frame, bool base )
     351void STFrequencies::setFrame(MFrequency::Types frame, bool base )
    353352{
    354353  String f = MFrequency::showType(frame);
     
    360359}
    361360
    362 void asap::STFrequencies::setFrame( const std::string & frame, bool base )
     361void STFrequencies::setFrame( const std::string & frame, bool base )
    363362{
    364363  MFrequency::Types mdr;
     
    380379}
    381380
    382 void asap::STFrequencies::setDoppler( const std::string & doppler )
     381void STFrequencies::setDoppler( const std::string & doppler )
    383382{
    384383  MDoppler::Types mdt;
     
    397396}
    398397
     398void 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}
    399405
    400406} // namespace
Note: See TracChangeset for help on using the changeset viewer.