Changeset 34 for trunk/src/SDContainer.cc
- Timestamp:
- 07/07/04 18:37:16 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/SDContainer.cc
r27 r34 65 65 spectrum_(IPosition(4,nBeam,nIF,nPol,nChan)), 66 66 flags_(IPosition(4,nBeam,nIF,nPol,nChan)), 67 tsys_(IPosition(4,nBeam,nIF,nPol,nChan)) { 67 tsys_(IPosition(4,nBeam,nIF,nPol,nChan)), 68 freqidx_(nIF) { 68 69 uChar x = 0; 69 70 flags_ = ~x; … … 77 78 spectrum_(shp), 78 79 flags_(shp), 79 tsys_(shp) { 80 tsys_(shp), 81 freqidx_(shp(1)){ 80 82 uChar x = 0; 81 83 flags_ = ~x; … … 174 176 } 175 177 176 Array<Float> SDContainer::getSpectrum(uInt whichBeam, uInt whichIF) const 177 { 178 const Array<Float>& SDContainer::getSpectrum(uInt whichBeam, uInt whichIF) const { 178 179 Matrix<Float> spectra(nChan_, nPol_); 179 180 … … 209 210 } 210 211 211 Array<uChar>SDContainer::getFlags(uInt whichBeam, uInt whichIF) const212 const Array<uChar>& SDContainer::getFlags(uInt whichBeam, uInt whichIF) const 212 213 { 213 214 Matrix<uChar> flagtra(nChan_, nPol_); … … 244 245 } 245 246 246 Array<Float>SDContainer::getTsys(uInt whichBeam, uInt whichIF) const247 const Array<Float>& SDContainer::getTsys(uInt whichBeam, uInt whichIF) const 247 248 { 248 249 Vector<Float> tsys(nPol_); … … 269 270 o0++; 270 271 } 271 272 272 return tsys; 273 273 } 274 275 Bool SDContainer::setFrequencyMap(uInt freqslot, uInt whichIF) { 276 freqidx_[whichIF] = freqslot; 277 return True; 278 } 279 280 Bool SDContainer::putFreqMap(const Vector<uInt>& freqs) { 281 freqidx_.resize(); 282 freqidx_ = freqs; 283 return True; 284 } 285 286 Int SDFrequencyTable::addFrequency(Int refPix, Double refVal, Double inc) { 287 Int idx = -1; 288 Bool addit = False; 289 if (length() > 0) { 290 for (uInt i=0; i< length();++i) { 291 if ( refVal == refVal_[i] ) { // probably check with tolerance 292 if ( refPix == refPix_[i] ) 293 if ( inc == increment_[i] ) 294 idx = Int(i); 295 } 296 } 297 if (idx >= 0) { 298 return idx; 299 } 300 } 301 nFreq_ += 1; 302 refPix_.resize(nFreq_,True); 303 refVal_.resize(nFreq_,True); 304 increment_.resize(nFreq_,True); 305 refPix_[nFreq_-1] = refPix; 306 refVal_[nFreq_-1] = refVal; 307 increment_[nFreq_-1] = inc; 308 idx = nFreq_-1; 309 return idx; 310 } 311
Note: See TracChangeset
for help on using the changeset viewer.