Changeset 338
- Timestamp:
- 01/31/05 20:54:05 (20 years ago)
- Location:
- trunk/src
- Files:
-
- 4 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_; -
trunk/src/SDReader.h
r332 r338 51 51 public: 52 52 SDReader(); 53 SDReader(const std::string& filename, int whichIF=-1,54 int whichBeam=-1);53 SDReader(const std::string& filename, const std::string& unit, 54 int whichIF=-1, int whichBeam=-1); 55 55 SDReader(casa::CountedPtr<SDMemTable> tbl); 56 56 virtual ~SDReader(); 57 57 58 58 void open(const std::string& filename, 59 const std::string& unit, 59 60 int whichIF=-1, 60 61 int whichBeam=-1); -
trunk/src/SDReaderWrapper.h
r332 r338 43 43 public: 44 44 SDReaderWrapper() {;} 45 SDReaderWrapper(const std::string& filename, int ifSel=-1, int beamSel=-1) : SDReader(filename,ifSel,beamSel) {;} 45 SDReaderWrapper(const std::string& filename, const std::string& unit, 46 int ifSel=-1, int beamSel=-1) : SDReader(filename,unit,ifSel,beamSel) {;} 46 47 SDReaderWrapper(SDMemTableWrapper tbl) : 47 48 SDReader(tbl.getCP()){;} -
trunk/src/python_SDReader.cc
r332 r338 40 40 void python_SDReader() { 41 41 class_<SDReaderWrapper>("sdreader") 42 .def( init < std::string, int, int > () )42 .def( init < std::string, string, int, int > () ) 43 43 .def("open", &SDReaderWrapper::open) 44 44 .def("read", &SDReaderWrapper::read)
Note:
See TracChangeset
for help on using the changeset viewer.