Changeset 342


Ignore:
Timestamp:
02/01/05 13:15:36 (20 years ago)
Author:
kil064
Message:

Take unit out of interface again, Handled at python levek now

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/SDReader.cc

    r338 r342  
    4646  cursor_ = 0;
    4747}
    48 SDReader::SDReader(const std::string& filename, const std::string& unit,
     48SDReader::SDReader(const std::string& filename,
    4949                   int whichIF, int whichBeam) :
    5050  reader_(0),
    5151  table_(new SDMemTable()) {
    5252  cursor_ = 0;
    53   open(filename, unit, whichIF, whichBeam);
     53  open(filename, whichIF, whichBeam);
    5454}
    5555
     
    8888
    8989
    90 void SDReader::open(const std::string& filename, const std::string& unit,
     90void SDReader::open(const std::string& filename,
    9191                    int whichIF, int whichBeam) {
    9292  if (reader_) delete reader_; reader_ = 0;
     
    146146    nIF_ = 1;
    147147  }
    148 //
    149 // Determine Telescope and set units...
    150 
    151   String sUnit(unit);
    152   if (sUnit.empty()) {
    153      Bool throwIt = False;
    154      Instrument inst = SDMemTable::convertInstrument (header_.antennaname, throwIt);
    155      header_.fluxunit = "Jy";
    156      if (inst==ATMOPRA || inst==TIDBINBILLA) {
    157         header_.fluxunit = "K";
    158      }
    159      cerr << "Assuming brightness unit is " << header_.fluxunit << endl;
    160    } else {
    161       Unit u(sUnit);
    162       if (u==Unit("Jy") || u==Unit("K")) {
    163          header_.fluxunit = unit;
    164          cerr << "Setting brightness unit to " << header_.fluxunit << endl;
    165       } else {
    166          throw(AipsError("Specified brightness unit is illegal - must be consistent with Jy or K"));
    167       }
    168    }
     148
     149// Determine Telescope and set brightness unit
     150
     151  Bool throwIt = False;
     152  Instrument inst = SDMemTable::convertInstrument (header_.antennaname, throwIt);
     153  header_.fluxunit = "Jy";
     154  if (inst==ATMOPRA || inst==TIDBINBILLA) {
     155     header_.fluxunit = "K";
     156  }
    169157//
    170158  header_.nif = nIF_;
  • trunk/src/SDReader.h

    r338 r342  
    5151public:
    5252  SDReader();
    53   SDReader(const std::string& filename, const std::string& unit,
     53  SDReader(const std::string& filename,
    5454           int whichIF=-1, int whichBeam=-1);
    5555  SDReader(casa::CountedPtr<SDMemTable> tbl);
     
    5757
    5858  void open(const std::string& filename,
    59             const std::string& unit,
    6059            int whichIF=-1,
    6160            int whichBeam=-1);
  • trunk/src/SDReaderWrapper.h

    r338 r342  
    4343public:
    4444  SDReaderWrapper() {;}
    45   SDReaderWrapper(const std::string& filename, const std::string& unit,
    46                   int ifSel=-1, int beamSel=-1) : SDReader(filename,unit,ifSel,beamSel) {;}
     45  SDReaderWrapper(const std::string& filename, int ifSel=-1, int beamSel=-1) :
     46     SDReader(filename,ifSel,beamSel) {;}
    4747  SDReaderWrapper(SDMemTableWrapper tbl) :
    4848    SDReader(tbl.getCP()){;}
  • trunk/src/python_SDReader.cc

    r338 r342  
    4040    void python_SDReader() {
    4141      class_<SDReaderWrapper>("sdreader")
    42         .def( init < std::string, string, int, int > () )
     42        .def( init < std::string, int, int > () )
    4343        .def("open", &SDReaderWrapper::open)
    4444        .def("read", &SDReaderWrapper::read)
Note: See TracChangeset for help on using the changeset viewer.