Changeset 342 for trunk/src/SDReader.cc


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

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

File:
1 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_;
Note: See TracChangeset for help on using the changeset viewer.