source: branches/asap-3.x/src/STCoordinate.h@ 2094

Last change on this file since 2094 was 1600, checked in by Malte Marquarding, 15 years ago

Ticket #170: python derived class for nice access e.g. units and doc strings

File size: 1.3 KB
Line 
1//
2// C++ Interface: STCoordinate
3//
4// Description:
5//
6//
7// Author: Malte Marquarding <Malte.Marquarding@csiro.au>, (C) 2009
8//
9// Copyright: See COPYING file that comes with this distribution
10//
11//
12#ifndef ASAPSTCOORDINATE_H
13#define ASAPSTCOORDINATE_H
14
15#include <vector>
16
17#include <casa/aips.h>
18#include <casa/Arrays/Array.h>
19#include <casa/Arrays/Vector.h>
20#include <coordinates/Coordinates/SpectralCoordinate.h>
21
22namespace asap {
23
24class STCoordinate {
25 public:
26 STCoordinate() {};
27
28 STCoordinate(const STCoordinate& other) : spec_(other.spec_) {};
29
30 STCoordinate(const casa::SpectralCoordinate& spec) :
31 spec_(spec) {};
32
33 virtual ~STCoordinate() {};
34
35 double getReferencePixel() {
36 return spec_.referencePixel()(0);
37 };
38
39 double getReferenceValue() {
40 return spec_.referenceValue()(0);
41 };
42
43 double getIncrement() {
44 return spec_.increment()(0);
45 }
46
47 double toFrequency(double pix) {
48 casa::Double world;
49 spec_.toWorld(world, pix);
50 return world;
51 }
52
53 double toVelocity(double pix) {
54 casa::Double vel;
55 spec_.pixelToVelocity(vel, pix);
56 return vel;
57 }
58
59 double toPixel(double world) {
60 casa::Double pix;
61 spec_.toPixel(pix, world);
62 return pix;
63 }
64
65 private:
66 casa::SpectralCoordinate spec_;
67};
68
69}
70
71#endif
Note: See TracBrowser for help on using the repository browser.