Changeset 236


Ignore:
Timestamp:
01/21/05 12:22:45 (20 years ago)
Author:
kil064
Message:

add set_instrumenbt function
and helper function convertInstrument

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SDMemTable.cc

    r218 r236  
    907907}
    908908
     909void SDMemTable::setInstrument(const std::string& name)
     910{
     911  Bool throwIt = True;
     912  Instrument ins = convertInstrument (name, throwIt);
     913  String nameU(name);
     914  nameU.upcase();
     915  table_.rwKeywordSet().define(String("AntennaName"), nameU);
     916}
     917
    909918std::string SDMemTable::summary()   {
    910919  ROScalarColumn<Int> scans(table_, "SCANID");
     
    10871096}
    10881097
     1098
     1099Instrument SDMemTable::convertInstrument (const String& instrument,
     1100                                          Bool throwIt)
     1101{
     1102   String t(instrument);
     1103   t.upcase();
     1104//
     1105   Instrument inst = asap::UNKNOWN;
     1106   if (t==String("TID")) {
     1107      inst = TIDBINBILLA;
     1108   } else if (t==String("ATPKSMB")) {
     1109      inst = PKSMULTIBEAM;
     1110   } else if (t==String("ATPKSSB")) {
     1111      inst = PKSSINGLEBEAM;
     1112   } else if (t==String("MOPRA")) {
     1113      inst = MOPRA;
     1114   } else {
     1115      if (throwIt) {
     1116         throw AipsError("Unrecognized instrument - use function scan.set_instrument to set");
     1117      }
     1118   }
     1119   return inst;
     1120}
     1121
  • trunk/src/SDMemTable.h

    r218 r236  
    3636#include <vector>
    3737// AIPS++
    38 #include <casa/aips.h>
     38 #include <casa/aips.h>
    3939#include <casa/BasicSL/String.h>
    4040#include <tables/Tables/Table.h>
    4141#include <casa/Arrays/MaskedArray.h>
     42#include "SDDefs.h"
    4243
    4344#include <coordinates/Coordinates/SpectralCoordinate.h>
     
    104105  std::string getFluxUnit() const;
    105106  void setFluxUnit (const std::string& unit);
     107
     108// Set Instrument
     109  void setInstrument (const std::string& instrument);
    106110
    107111  // set the current value
     
    174178  casa::MEpoch::Types getTimeReference () const;
    175179
     180// Helper function to check instrument (antenna) name and give enum
     181  static Instrument convertInstrument (const casa::String& instrument,
     182                                       casa::Bool throwIt);
     183
    176184private:
    177185  // utility func for nice printout
Note: See TracChangeset for help on using the changeset viewer.