Changeset 1598 for trunk


Ignore:
Timestamp:
07/08/09 11:22:27 (15 years ago)
Author:
Malte Marquarding
Message:

Ticket #170: added scantable.get_coordinate(row). Note that this in the specified reference frame NOT in the basese frame, e.g. usually LSRK/BARY not TOPO. That means that coord.to_frequency(coord.get_rerencepixel()) != coord.get_reference_value(). You need to run {{{freq_align to rectify this

Location:
trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/Scantable.cpp

    r1586 r1598  
    691691    specCol_.get(whichrow, arr);
    692692  } else {
    693     CountedPtr<STPol> stpol(STPol::getPolClass(Scantable::factories_, 
     693    CountedPtr<STPol> stpol(STPol::getPolClass(Scantable::factories_,
    694694                                               basetype));
    695695    uInt row = uInt(whichrow);
     
    875875    Double tm;
    876876    table_.keywordSet().get("UTC",tm);
    877     return MEpoch(MVEpoch(tm)); 
     877    return MEpoch(MVEpoch(tm));
    878878  }
    879879}
     
    882882{
    883883  return formatDirection(getDirection(uInt(whichrow)));
     884}
     885
     886
     887SpectralCoordinate Scantable::getSpectralCoordinate(int whichrow) const {
     888  const MPosition& mp = getAntennaPosition();
     889  const MDirection& md = getDirection(whichrow);
     890  const MEpoch& me = timeCol_(whichrow);
     891  Double rf = moleculeTable_.getRestFrequency(mmolidCol_(whichrow));
     892  return freqTable_.getSpectralCoordinate(md, mp, me, rf,
     893                                          mfreqidCol_(whichrow));
    884894}
    885895
     
    896906    return stlout;
    897907  }
    898 
    899   const MPosition& mp = getAntennaPosition();
    900   const MDirection& md = getDirection(whichrow);
    901   const MEpoch& me = timeCol_(whichrow);
    902   Double rf = moleculeTable_.getRestFrequency(mmolidCol_(whichrow));
    903   SpectralCoordinate spc =
    904     freqTable_.getSpectralCoordinate(md, mp, me, rf, mfreqidCol_(whichrow));
     908  SpectralCoordinate spc = getSpectralCoordinate(whichrow);
    905909  Vector<Double> pixel(nchan);
    906910  Vector<Double> world;
  • trunk/src/Scantable.h

    r1586 r1598  
    2727
    2828#include <measures/TableMeasures/ScalarMeasColumn.h>
     29
     30#include <coordinates/Coordinates/SpectralCoordinate.h>
    2931
    3032#include "Logger.h"
     
    166168   */
    167169  casa::MDirection getDirection( int whichrow ) const;
    168  
     170
    169171  /**
    170172   * get the direction type as a string, e.g. "J2000"
     
    184186   * @return a string describing the direction reference
    185187   */
    186   std::string getDirectionRefString() const;   
     188  std::string getDirectionRefString() const;
    187189
    188190  /**
     
    355357
    356358  void shift(int npix);
     359
     360  casa::SpectralCoordinate getSpectralCoordinate(int whichrow) const;
    357361
    358362  void convertDirection(const std::string& newframe);
     
    406410   * @param[in] flag true or false
    407411   */
    408   void parallactify(bool flag) 
     412  void parallactify(bool flag)
    409413  {focus().setParallactify(flag);}
    410414private:
  • trunk/src/ScantableWrapper.h

    r1586 r1598  
    2020#include "STFit.h"
    2121#include "Scantable.h"
     22#include "STCoordinate.h"
    2223
    2324namespace asap {
     
    215216    { table_->parallactify(flag); }
    216217
     218  STCoordinate getCoordinate(int row) {
     219    return STCoordinate(table_->getSpectralCoordinate(row));
     220  }
     221
    217222private:
    218223  casa::CountedPtr<Scantable> table_;
     
    221226} // namespace
    222227#endif
    223 
  • trunk/src/python_Scantable.cpp

    r1586 r1598  
    125125    .def("_getdirectionvec", &ScantableWrapper::getDirectionVector)
    126126    .def("_parallactify", &ScantableWrapper::parallactify)
     127    .def("get_coordinate", &ScantableWrapper::getCoordinate)
    127128  ;
    128129};
  • trunk/src/python_asap.cpp

    r1501 r1598  
    7575  asap::python::python_LineCatalog();
    7676  asap::python::python_Logger();
     77  asap::python::python_STCoordinate();
    7778
    7879#ifndef HAVE_LIBPYRAP
  • trunk/src/python_asap.h

    r1126 r1598  
    4747    void python_LineCatalog();
    4848    void python_Logger();
     49    void python_STCoordinate();
    4950
    5051  } // python
Note: See TracChangeset for help on using the changeset viewer.