Changeset 212 for trunk/src


Ignore:
Timestamp:
01/19/05 13:26:20 (20 years ago)
Author:
kil064
Message:

add function 'getDirectionReference' and 'getTimeReference' and
use them internally

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SDMemTable.cc

    r206 r212  
    365365  tme.get(whichRow,obstime);
    366366  MVEpoch tm2(Quantum<Double>(obstime, Unit(String("d"))));
    367   MEpoch::Types met;
    368   String ep;
    369   table_.keywordSet().get("Epoch",ep);
    370   if (!MEpoch::getType(met, ep)) {
    371     cerr << "Epoch type uknown - using UTC" << endl;
    372     met = MEpoch::UTC;
    373   }
    374 
     367  MEpoch::Types met = getTimeReference();
    375368  MEpoch epoch(tm2, met);
    376369
     
    608601MDirection SDMemTable::getDirection(Int whichRow) const
    609602{
    610   Float eq;
    611   table_.keywordSet().get("Equinox",eq);
    612   std::map<float,string> mp;
    613   mp[2000.0] = "J2000";
    614   mp[1950.0] = "B1950";
    615   MDirection::Types mdr;
    616   if (!MDirection::getType(mdr, mp[eq])) {
    617     mdr = MDirection::J2000;
    618     cerr  << "Unknown equinox using J2000" << endl;
    619   }
     603  MDirection::Types mdr = getDirectionReference();
    620604  ROArrayColumn<Double> dir(table_, "DIRECTION");
    621605  Array<Double> posit;
     
    10621046  spec.put(whichRow, arr);
    10631047}
     1048
     1049MDirection::Types SDMemTable::getDirectionReference () const
     1050
     1051  Float eq;
     1052  table_.keywordSet().get("Equinox",eq);
     1053  std::map<float,string> mp;
     1054  mp[2000.0] = "J2000";
     1055  mp[1950.0] = "B1950";
     1056  MDirection::Types mdr;
     1057  if (!MDirection::getType(mdr, mp[eq])) {   
     1058    mdr = MDirection::J2000;
     1059    cerr  << "Unknown equinox using J2000" << endl;
     1060  }
     1061//
     1062  return mdr;
     1063}
     1064
     1065MEpoch::Types SDMemTable::getTimeReference () const
     1066{
     1067  MEpoch::Types met;
     1068  String ep;
     1069  table_.keywordSet().get("Epoch",ep);
     1070  if (!MEpoch::getType(met, ep)) {
     1071    cerr << "Epoch type uknown - using UTC" << endl;
     1072    met = MEpoch::UTC;
     1073  }
     1074//
     1075  return met;
     1076}
     1077
  • trunk/src/SDMemTable.h

    r206 r212  
    162162  std::vector<double> getAbcissa(int whichRow=0) const;
    163163  std::string getAbcissaString(casa::Int whichRow=0) const;
    164  
     164
     165// Get MDirection for this row
    165166  casa::MDirection getDirection(casa::Int whichRow=0) const;
     167
     168// Get gloabl Direction reference
     169  casa::MDirection::Types getDirectionReference () const;
     170
     171// Get global Time reference
     172  casa::MEpoch::Types getTimeReference () const;
    166173
    167174private:
Note: See TracChangeset for help on using the changeset viewer.