Changeset 870


Ignore:
Timestamp:
03/06/06 10:55:24 (18 years ago)
Author:
mar637
Message:

fixed getEntry (wasnt passing reference)
added getRestFrequency()

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STMolecules.cpp

    r856 r870  
    9595}
    9696
    97 void STMolecules::getEntry( Double restfreq, String& name,
    98                             String& formattedname, uInt id )
     97void STMolecules::getEntry( Double& restfreq, String& name,
     98                            String& formattedname, uInt id ) const
    9999{
    100100  Table t = table_(table_.col("ID") == Int(id) );
     
    118118}
    119119
     120double asap::STMolecules::getRestFrequency( uInt id ) const
     121{
     122  Table t = table_(table_.col("ID") == Int(id) );
     123  if (t.nrow() == 0 ) {
     124    throw(AipsError("STMolecules::getRestFrequency - id out of range"));
     125  }
     126  ROTableRow row(t);
     127  const TableRecord& rec = row.get(0);
     128  return double(rec.asDouble("RESTFREQUENCY"));
     129}
     130
    120131
    121132}//namespace
  • trunk/src/STMolecules.h

    r856 r870  
    4040                       const casa::String& formattedname="");
    4141
    42   void getEntry( casa::Double restfreq, casa::String& name,
    43                  casa::String& formattedname, casa::uInt id);
     42  void getEntry( casa::Double& restfreq, casa::String& name,
     43                 casa::String& formattedname, casa::uInt id) const;
    4444
    4545  std::vector<double> getRestFrequencies() const;
    46 
     46  double getRestFrequency( casa::uInt id ) const;
    4747  const casa::String& name() const { return name_; }
    4848
Note: See TracChangeset for help on using the changeset viewer.