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 |
|
---|
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 |
|
---|
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 | /**
|
---|
43 | * Set scantable
|
---|
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 | **/
|
---|
58 | void setGridParam(const int nx, const int ny,
|
---|
59 | const string cellx="", const string celly="",
|
---|
60 | string center="", const string projname="SIN") ;
|
---|
61 |
|
---|
62 | /**
|
---|
63 | * Get Pixel position of a row in the scantable
|
---|
64 | **/
|
---|
65 | vector<double> getGridPixel(const int whichrow=0);
|
---|
66 |
|
---|
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 |
|
---|
78 | private:
|
---|
79 | /** Generate temporal coordinate from the DIRECTION column of a scantable**/
|
---|
80 | casa::DirectionCoordinate getSTCoord(const int nx, const int ny,
|
---|
81 | const casa::Projection::Type ptype);
|
---|
82 |
|
---|
83 | /** Generation of direction coordinate **/
|
---|
84 | void setupCoord(const casa::MDirection::Types mdt,
|
---|
85 | const casa::Projection::Type pjt,
|
---|
86 | const casa::Double centx, const casa::Double centy,
|
---|
87 | const casa::Double incx, const casa::Double incy,
|
---|
88 | const casa::Double refx, const casa::Double refy);
|
---|
89 |
|
---|
90 | casa::DirectionCoordinate *dircoord_p;
|
---|
91 | casa::CountedPtr<Scantable> data_p;
|
---|
92 |
|
---|
93 | };
|
---|
94 |
|
---|
95 | } // namespace
|
---|
96 |
|
---|
97 | #endif
|
---|