Changeset 338 for trunk/src/SDReader.cc
- Timestamp:
- 01/31/05 20:54:05 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SDReader.cc
r337 r338 32 32 #include <casa/OS/Path.h> 33 33 #include <casa/OS/File.h> 34 #include <casa/Quanta/Unit.h> 34 35 #include <atnf/PKSIO/PKSreader.h> 35 36 … … 45 46 cursor_ = 0; 46 47 } 47 SDReader::SDReader(const std::string& filename, int whichIF, int whichBeam) : 48 SDReader::SDReader(const std::string& filename, const std::string& unit, 49 int whichIF, int whichBeam) : 48 50 reader_(0), 49 51 table_(new SDMemTable()) { 50 52 cursor_ = 0; 51 open(filename, whichIF, whichBeam);53 open(filename, unit, whichIF, whichBeam); 52 54 } 53 55 … … 86 88 87 89 88 void SDReader::open(const std::string& filename, int whichIF, int whichBeam) { 90 void SDReader::open(const std::string& filename, const std::string& unit, 91 int whichIF, int whichBeam) { 89 92 if (reader_) delete reader_; reader_ = 0; 90 93 Bool haveBase, haveSpectra, haveXPol; … … 146 149 // Determine Telescope and set units... 147 150 148 Bool throwIt = False; 149 Instrument inst = SDMemTable::convertInstrument (header_.antennaname, throwIt); 150 header_.fluxunit = "Jy"; 151 if (inst==ATMOPRA || inst==TIDBINBILLA) { 152 header_.fluxunit = "K"; 153 } 154 cerr << "Assuming brightness units are " << header_.fluxunit << endl; 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 } 155 169 // 156 170 header_.nif = nIF_;
Note: See TracChangeset
for help on using the changeset viewer.