source: trunk/src/STCoordinate.h@ 2075

Last change on this file since 2075 was 1823, checked in by Kana Sugimoto, 14 years ago

New Development: No

JIRA Issue: No (merge: recover logs)

Ready for Test: Yes

Interface Changes: No

Module(s): nothing just logs

Description:

restored several codes from tags/asap-trunk-no-alma to recover change logs.
In addition, STFITSImageWriter.cpp is modified by hand to merge a change in alma branch.

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.