Changeset 830 for trunk


Ignore:
Timestamp:
02/17/06 15:49:59 (19 years ago)
Author:
mar637
Message:

added getEntry to support export for STWriter.

Location:
trunk/src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/STFrequencies.cpp

    r806 r830  
    9292
    9393
     94
     95void STFrequencies::getEntry( Double& refpix, Double& refval, Double& inc,
     96                              uInt id )
     97{
     98  Table t = table_(table_.col("ID") == Int(id) );
     99  if (t.nrow() == 0 ) {
     100    throw(AipsError("STFrequencies::getEntry - freqID out of range"));
     101  }
     102  ROTableRow row(t);
     103  // get first row - there should only be one matching id
     104  const TableRecord& rec = row.get(0);
     105  refpix = rec.asDouble("REFPIX");
     106  refval = rec.asDouble("REFVAL");
     107  inc = rec.asDouble("INCREMENT");
     108}
     109
    94110SpectralCoordinate STFrequencies::getSpectralCoordinate( uInt freqID )
    95111{
  • trunk/src/STFrequencies.h

    r806 r830  
    4343                       casa::Double inc );
    4444
    45   //const casa::Table& table() const { return table_; }
    46   //casa::Table table() { return table_; }
     45  void getEntry( casa::Double& refpix, casa::Double& refval,
     46                 casa::Double& inc, casa::uInt id );
    4747
    4848  casa::SpectralCoordinate getSpectralCoordinate( casa::uInt freqID );
     
    5959  void rescale(casa::Float factor, const std::string& mode);
    6060
    61   float getRefFreq(casa::uInt d, casa::uInt channel);
     61  float getRefFreq(casa::uInt id, casa::uInt channel);
    6262
    6363  std::string print(int id=-1);
  • trunk/src/STMolecules.cpp

    r809 r830  
    7878}
    7979
     80void STMolecules::getEntry( Double restfreq, String& name,
     81                            String& formattedname, uInt id )
     82{
     83  Table t = table_(table_.col("ID") == Int(id) );
     84  if (t.nrow() == 0 ) {
     85    throw(AipsError("STMolecules::getEntry - id out of range"));
     86  }
     87  ROTableRow row(t);
     88  // get first row - there should only be one matching id
     89  const TableRecord& rec = row.get(0);
     90  restfreq = rec.asDouble("RESTFREQUENCY");
     91  name = rec.asString("NAME");
     92  formattedname = rec.asString("FORMATTEDNAME");
    8093}
     94
     95} //namespace
  • trunk/src/STMolecules.h

    r809 r830  
    3636                       const casa::String& formattedname="");
    3737
     38  void getEntry( casa::Double restfreq, casa::String& name,
     39                 casa::String& formattedname, casa::uInt id);
     40
    3841private:
    3942  void setup();
  • trunk/src/STTcal.cpp

    r810 r830  
    7474}
    7575
     76void STTcal::getEntry( String& time, Vector<Float>& tcal, uInt id )
     77{
     78  Table t = table_(table_.col("ID") == Int(id) );
     79  if (t.nrow() == 0 ) {
     80    throw(AipsError("STTcal::getEntry - id out of range"));
     81  }
     82  ROTableRow row(t);
     83  // get first row - there should only be one matching id
     84  const TableRecord& rec = row.get(0);
     85  time = rec.asString("TIME");
     86  tcal.resize();
     87  Vector<Float> out;
     88  rec.get("TCAL",out);
     89  tcal = out;
    7690}
    7791
     92} //namespace
     93
  • trunk/src/STTcal.h

    r810 r830  
    3636  casa::uInt addEntry( const casa::String& time,
    3737                       const casa::Vector<casa::Float>& tcal);
     38  void getEntry( casa::String& time, casa::Vector<casa::Float>& tcal,
     39                 casa::uInt id );
    3840
    3941private:
  • trunk/src/STTemplates.cpp

    r816 r830  
    3434#include <casa/namespace.h>
    3535#include <casa/Exceptions/Error.cc>
    36 //#include <casa/Exceptions/Error2.cc>
    3736#include <casa/Utilities/CountedPtr.cc>
    38 //#include <casa/Utilities/CountedPtr2.cc>
    3937
    4038namespace asap {
     
    110108                        const Vector<Bool>&,
    111109                        Bool, Bool);
    112   template uInt addEntry(Vector<uInt>&, uInt);
    113   template void extendLastArrayAxis(Array<Int>&, const Array<Int>&,
    114                                    const Int& initVal);
    115110}
    116111//template Array<Bool> SDPolUtil::stokesData (Array<Bool>& dataIn, Bool);
  • trunk/src/STWeather.cpp

    r811 r830  
    8282}
    8383
     84void STWeather::getEntry( Float& temperature, Float& pressure,
     85                          Float& humidity, Float& windspeed, Float& windaz,
     86                          uInt id )
     87{
     88  Table t = table_(table_.col("ID") == Int(id) );
     89  if (t.nrow() == 0 ) {
     90    throw(AipsError("STWeather::getEntry - id out of range"));
     91  }
     92  ROTableRow row(t);
     93  // get first row - there should only be one matching id
     94  const TableRecord& rec = row.get(0);
     95  temperature = rec.asFloat("TEMPERATURE");
     96  pressure = rec.asDouble("PRESSURE");
     97  humidity = rec.asDouble("HUMIDITY");
     98  windspeed = rec.asDouble("WINDSPEED");
     99  windaz = rec.asDouble("WINDAZ");
    84100}
     101
     102}
     103
  • trunk/src/STWeather.h

    r811 r830  
    3535  casa::uInt addEntry( casa::Float temperature, casa::Float pressure,
    3636                       casa::Float humidity,
    37                        casa::Float windspeed, casa::Float  windaz);
     37                       casa::Float windspeed, casa::Float windaz);
     38
     39  void getEntry( casa::Float& temperature, casa::Float& pressure,
     40                       casa::Float& humidity,
     41                       casa::Float& windspeed, casa::Float& windaz,
     42                       casa::uInt id);
    3843
    3944private:
Note: See TracChangeset for help on using the changeset viewer.