Ignore:
Timestamp:
11/12/08 17:04:01 (16 years ago)
Author:
TakTsutsumi
Message:

Merged recent updates (since 2007) from nrao-asap

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/alma/src/STFrequencies.cpp

    r1375 r1446  
    128128}
    129129
     130void 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
    130147SpectralCoordinate STFrequencies::getSpectralCoordinate( uInt id ) const
    131148{
     
    140157  // get first row - there should only be one matching id
    141158  const TableRecord& rec = row.get(0);
     159
    142160  return SpectralCoordinate( getFrame(true), rec.asDouble("REFVAL"),
    143161                             rec.asDouble("INCREMENT"),
     
    145163}
    146164
     165/**
    147166SpectralCoordinate
    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**/
     172SpectralCoordinate
     173  asap::STFrequencies::getSpectralCoordinate( const MDirection& md,
     174                                              const MPosition& mp,
     175                                              const MEpoch& me,
     176                                              Vector<Double> restfreq, uInt id ) const
    152177{
    153178  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);
    155186  if ( !spc.setReferenceConversion(getFrame(), me, mp, md) ) {
    156187    throw(AipsError("Couldn't convert frequency frame."));
Note: See TracChangeset for help on using the changeset viewer.