[2689] | 1 | //
|
---|
| 2 | // C++ Interface: PlotHelper
|
---|
| 3 | //
|
---|
| 4 | // Description:
|
---|
| 5 | // A small helper class to handle direction coordinate in asapplotter
|
---|
| 6 | //
|
---|
| 7 | // Author: Kana Sugimoto <kana.sugi@nao.ac.jp>, (C) 2012
|
---|
| 8 | //
|
---|
| 9 | // Copyright: See COPYING file that comes with this distribution
|
---|
| 10 | //
|
---|
| 11 | //
|
---|
| 12 | #ifndef ASAPPLOTHELPER_H
|
---|
| 13 | #define ASAPPLOTHELPER_H
|
---|
| 14 |
|
---|
[3085] | 15 | // ASAP
|
---|
| 16 | // ScantableWrapper.h must be included first to avoid compiler warnings
|
---|
| 17 | // related with _XOPEN_SOURCE
|
---|
| 18 | #include "ScantableWrapper.h"
|
---|
| 19 | #include "Scantable.h"
|
---|
| 20 |
|
---|
[2689] | 21 | // STL
|
---|
| 22 | #include <iostream>
|
---|
| 23 | #include <string>
|
---|
| 24 | #include <vector>
|
---|
| 25 | // casacore
|
---|
| 26 | #include <casa/aips.h>
|
---|
| 27 | #include <casa/Utilities/CountedPtr.h>
|
---|
| 28 | #include <coordinates/Coordinates/DirectionCoordinate.h>
|
---|
| 29 |
|
---|
| 30 | namespace asap {
|
---|
| 31 |
|
---|
| 32 | class PlotHelper
|
---|
| 33 | {
|
---|
| 34 | public:
|
---|
| 35 | /**
|
---|
| 36 | * constructors and a destructor
|
---|
| 37 | **/
|
---|
| 38 | PlotHelper();
|
---|
| 39 | explicit PlotHelper( const ScantableWrapper &s);
|
---|
| 40 |
|
---|
| 41 | virtual ~PlotHelper();
|
---|
| 42 | /**
|
---|
[2719] | 43 | * Set scantable
|
---|
[2689] | 44 | **/
|
---|
| 45 | void setScantable( const ScantableWrapper &s ) ;
|
---|
| 46 |
|
---|
| 47 | /**
|
---|
| 48 | * Set grid parameters for plot panel (by values in radian)
|
---|
| 49 | **/
|
---|
| 50 | void setGridParamVal(const int nx, const int ny,
|
---|
| 51 | const double cellx, const double celly,
|
---|
| 52 | const double centx, const double centy,
|
---|
| 53 | string epoch="J2000", const string projname="SIN") ;
|
---|
| 54 | /// TODO
|
---|
| 55 | /**
|
---|
| 56 | * Set grid parameters for plot panel (by quantity)
|
---|
| 57 | **/
|
---|
[2717] | 58 | void setGridParam(const int nx, const int ny,
|
---|
| 59 | const string cellx="", const string celly="",
|
---|
| 60 | string center="", const string projname="SIN") ;
|
---|
[2689] | 61 |
|
---|
| 62 | /**
|
---|
[2719] | 63 | * Get Pixel position of a row in the scantable
|
---|
[2689] | 64 | **/
|
---|
| 65 | vector<double> getGridPixel(const int whichrow=0);
|
---|
| 66 |
|
---|
[2719] | 67 | /**
|
---|
| 68 | * Get the reference direction of grid coordinate (grid center)
|
---|
| 69 | **/
|
---|
| 70 | string getGridRef();
|
---|
| 71 |
|
---|
| 72 | /**
|
---|
| 73 | * Get the cell size (>0) of the grid coordinate (in radian)
|
---|
| 74 | **/
|
---|
| 75 | vector<double> getGridCellVal();
|
---|
| 76 |
|
---|
| 77 |
|
---|
[2717] | 78 | private:
|
---|
[2719] | 79 | /** Generate temporal coordinate from the DIRECTION column of a scantable**/
|
---|
[3106] | 80 | casacore::DirectionCoordinate getSTCoord(const int nx, const int ny,
|
---|
| 81 | const casacore::Projection::Type ptype);
|
---|
[2717] | 82 |
|
---|
[2719] | 83 | /** Generation of direction coordinate **/
|
---|
[3106] | 84 | void setupCoord(const casacore::MDirection::Types mdt,
|
---|
| 85 | const casacore::Projection::Type pjt,
|
---|
| 86 | const casacore::Double centx, const casacore::Double centy,
|
---|
| 87 | const casacore::Double incx, const casacore::Double incy,
|
---|
| 88 | const casacore::Double refx, const casacore::Double refy);
|
---|
[2719] | 89 |
|
---|
[3106] | 90 | casacore::DirectionCoordinate *dircoord_p;
|
---|
| 91 | casacore::CountedPtr<Scantable> data_p;
|
---|
[2689] | 92 |
|
---|
| 93 | };
|
---|
| 94 |
|
---|
| 95 | } // namespace
|
---|
| 96 |
|
---|
| 97 | #endif
|
---|