Changeset 1446 for branches/alma/src/STFrequencies.cpp
- Timestamp:
- 11/12/08 17:04:01 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/alma/src/STFrequencies.cpp
r1375 r1446 128 128 } 129 129 130 void STFrequencies::setEntry( Double refpix, Double refval, Double inc, uInt id ) 131 { 132 Table t = table_(table_.col("ID") == Int(id) ); 133 if (t.nrow() == 0 ) { 134 throw(AipsError("STFrequencies::getEntry - freqID out of range")); 135 } 136 for ( uInt i = 0 ; i < table_.nrow() ; i++ ) { 137 uInt fid ; 138 idCol_.get( i, fid ) ; 139 if ( fid == id ) { 140 refpixCol_.put( i, refpix ) ; 141 refvalCol_.put( i, refval ) ; 142 incrCol_.put( i, inc ) ; 143 } 144 } 145 } 146 130 147 SpectralCoordinate STFrequencies::getSpectralCoordinate( uInt id ) const 131 148 { … … 140 157 // get first row - there should only be one matching id 141 158 const TableRecord& rec = row.get(0); 159 142 160 return SpectralCoordinate( getFrame(true), rec.asDouble("REFVAL"), 143 161 rec.asDouble("INCREMENT"), … … 145 163 } 146 164 165 /** 147 166 SpectralCoordinate 148 STFrequencies::getSpectralCoordinate( const MDirection& md, 149 const MPosition& mp, 150 const MEpoch& me, 151 Double restfreq, uInt id ) const 167 asap::STFrequencies::getSpectralCoordinate( const MDirection& md, 168 const MPosition& mp, 169 const MEpoch& me, 170 Double restfreq, uInt id ) const 171 **/ 172 SpectralCoordinate 173 asap::STFrequencies::getSpectralCoordinate( const MDirection& md, 174 const MPosition& mp, 175 const MEpoch& me, 176 Vector<Double> restfreq, uInt id ) const 152 177 { 153 178 SpectralCoordinate spc = getSpectralCoordinate(id); 154 spc.setRestFrequency(restfreq, True); 179 //spc.setRestFrequency(restfreq, True); 180 // for now just use the first rest frequency 181 if (restfreq.nelements()==0 ) { 182 restfreq.resize(1); 183 restfreq[0] = 0; 184 } 185 spc.setRestFrequency(restfreq[0], True); 155 186 if ( !spc.setReferenceConversion(getFrame(), me, mp, md) ) { 156 187 throw(AipsError("Couldn't convert frequency frame."));
Note:
See TracChangeset
for help on using the changeset viewer.