source: trunk/src/PlotHelper.h@ 2937

Last change on this file since 2937 was 2719, checked in by Kana Sugimoto, 12 years ago

New Development: No

JIRA Issue: No

Ready for Test: Yes

Interface Changes: Yes

What Interface Changed: added two new methods, get_gref() and get_gcellval() in plothelper class.

Test Programs: test_sdplot[sdplot_gridTest]

Put in Release Notes: No

Module(s): asapplotter and sdplot

Description:

Added two new methods in plothelper class to get grid center
and spacings of plot grids.

  • get_gref(): returns the reference direction (grid center) of grid (a string)
  • get_gcellval(): returns the absolute increment (in radian) of grid (a double vector)


File size: 2.2 KB
RevLine 
[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
15// STL
16#include <iostream>
17#include <string>
18#include <vector>
19// casacore
20#include <casa/aips.h>
21#include <casa/Utilities/CountedPtr.h>
22#include <coordinates/Coordinates/DirectionCoordinate.h>
23
24#include "ScantableWrapper.h"
[2717]25#include "Scantable.h"
[2689]26
27namespace asap {
28
29class PlotHelper
30{
31public:
32 /**
33 * constructors and a destructor
34 **/
35 PlotHelper();
36 explicit PlotHelper( const ScantableWrapper &s);
37
38 virtual ~PlotHelper();
39 /**
[2719]40 * Set scantable
[2689]41 **/
42 void setScantable( const ScantableWrapper &s ) ;
43
44 /**
45 * Set grid parameters for plot panel (by values in radian)
46 **/
47 void setGridParamVal(const int nx, const int ny,
48 const double cellx, const double celly,
49 const double centx, const double centy,
50 string epoch="J2000", const string projname="SIN") ;
51 /// TODO
52 /**
53 * Set grid parameters for plot panel (by quantity)
54 **/
[2717]55 void setGridParam(const int nx, const int ny,
56 const string cellx="", const string celly="",
57 string center="", const string projname="SIN") ;
[2689]58
59 /**
[2719]60 * Get Pixel position of a row in the scantable
[2689]61 **/
62 vector<double> getGridPixel(const int whichrow=0);
63
[2719]64 /**
65 * Get the reference direction of grid coordinate (grid center)
66 **/
67 string getGridRef();
68
69 /**
70 * Get the cell size (>0) of the grid coordinate (in radian)
71 **/
72 vector<double> getGridCellVal();
73
74
[2717]75private:
[2719]76 /** Generate temporal coordinate from the DIRECTION column of a scantable**/
[2717]77 casa::DirectionCoordinate getSTCoord(const int nx, const int ny,
78 const casa::Projection::Type ptype);
79
[2719]80 /** Generation of direction coordinate **/
81 void setupCoord(const casa::MDirection::Types mdt,
82 const casa::Projection::Type pjt,
83 const casa::Double centx, const casa::Double centy,
84 const casa::Double incx, const casa::Double incy,
85 const casa::Double refx, const casa::Double refy);
86
87 casa::DirectionCoordinate *dircoord_p;
[2717]88 casa::CountedPtr<Scantable> data_p;
[2689]89
90};
91
92} // namespace
93
94#endif
Note: See TracBrowser for help on using the repository browser.