Last change
on this file since 1599 was
1599,
checked in by Malte Marquarding, 15 years ago
|
Ticket #170: forgot to add this file - the real implementation.
|
File size:
1.2 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 | |
---|
22 | namespace asap { |
---|
23 | |
---|
24 | class STCoordinate { |
---|
25 | public: |
---|
26 | STCoordinate() {}; |
---|
27 | STCoordinate(const casa::SpectralCoordinate& spec) : |
---|
28 | spec_(spec) {}; |
---|
29 | |
---|
30 | virtual ~STCoordinate() {}; |
---|
31 | |
---|
32 | double getReferencePixel() { |
---|
33 | return spec_.referencePixel()(0); |
---|
34 | }; |
---|
35 | |
---|
36 | double getReferenceValue() { |
---|
37 | return spec_.referenceValue()(0); |
---|
38 | }; |
---|
39 | |
---|
40 | double getIncrement() { |
---|
41 | return spec_.increment()(0); |
---|
42 | } |
---|
43 | |
---|
44 | double toFrequency(double pix) { |
---|
45 | casa::Double world; |
---|
46 | spec_.toWorld(world, pix); |
---|
47 | return world; |
---|
48 | } |
---|
49 | |
---|
50 | double toVelocity(double pix) { |
---|
51 | casa::Double vel; |
---|
52 | spec_.pixelToVelocity(vel, pix); |
---|
53 | return vel; |
---|
54 | } |
---|
55 | |
---|
56 | double toPixel(double world) { |
---|
57 | casa::Double pix; |
---|
58 | spec_.toPixel(pix, world); |
---|
59 | return pix; |
---|
60 | } |
---|
61 | |
---|
62 | private: |
---|
63 | casa::SpectralCoordinate spec_; |
---|
64 | }; |
---|
65 | |
---|
66 | } |
---|
67 | |
---|
68 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.