Changeset 342
- Timestamp:
- 02/01/05 13:15:36 (20 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SDReader.cc
r338 r342 46 46 cursor_ = 0; 47 47 } 48 SDReader::SDReader(const std::string& filename, const std::string& unit,48 SDReader::SDReader(const std::string& filename, 49 49 int whichIF, int whichBeam) : 50 50 reader_(0), 51 51 table_(new SDMemTable()) { 52 52 cursor_ = 0; 53 open(filename, unit,whichIF, whichBeam);53 open(filename, whichIF, whichBeam); 54 54 } 55 55 … … 88 88 89 89 90 void SDReader::open(const std::string& filename, const std::string& unit,90 void SDReader::open(const std::string& filename, 91 91 int whichIF, int whichBeam) { 92 92 if (reader_) delete reader_; reader_ = 0; … … 146 146 nIF_ = 1; 147 147 } 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 } 169 157 // 170 158 header_.nif = nIF_; -
trunk/src/SDReader.h
r338 r342 51 51 public: 52 52 SDReader(); 53 SDReader(const std::string& filename, const std::string& unit,53 SDReader(const std::string& filename, 54 54 int whichIF=-1, int whichBeam=-1); 55 55 SDReader(casa::CountedPtr<SDMemTable> tbl); … … 57 57 58 58 void open(const std::string& filename, 59 const std::string& unit,60 59 int whichIF=-1, 61 60 int whichBeam=-1); -
trunk/src/SDReaderWrapper.h
r338 r342 43 43 public: 44 44 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) {;} 47 47 SDReaderWrapper(SDMemTableWrapper tbl) : 48 48 SDReader(tbl.getCP()){;} -
trunk/src/python_SDReader.cc
r338 r342 40 40 void python_SDReader() { 41 41 class_<SDReaderWrapper>("sdreader") 42 .def( init < std::string, string,int, int > () )42 .def( init < std::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.