source: trunk/src/STCoordinate.h@ 3110

Last change on this file since 3110 was 3106, checked in by Takeshi Nakazato, 8 years ago

New Development: No

JIRA Issue: No

Ready for Test: Yes/No

Interface Changes: Yes/No

What Interface Changed: Please list interface changes

Test Programs: List test programs

Put in Release Notes: Yes/No

Module(s): Module Names change impacts.

Description: Describe your changes here...


Check-in asap modifications from Jim regarding casacore namespace conversion.

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 casacore::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 casacore::Double world;
49 spec_.toWorld(world, pix);
50 return world;
51 }
52
53 double toVelocity(double pix) {
54 casacore::Double vel;
55 spec_.pixelToVelocity(vel, pix);
56 return vel;
57 }
58
59 double toPixel(double world) {
60 casacore::Double pix;
61 spec_.toPixel(pix, world);
62 return pix;
63 }
64
65 private:
66 casacore::SpectralCoordinate spec_;
67};
68
69}
70
71#endif
Note: See TracBrowser for help on using the repository browser.