source: trunk/src/STFrequencies.h@ 847

Last change on this file since 847 was 847, checked in by mar637, 19 years ago

numerous changes before move to new svn repository sourcecode.atnf.csiro.au

File size: 4.7 KB
RevLine 
[806]1//
2// C++ Interface: STFrequencies
3//
4// Description:
5//
6//
7// Author: Malte Marquarding <asap@atnf.csiro.au>, (C) 2006
8//
9// Copyright: See COPYING file that comes with this distribution
10//
11//
12#ifndef ASAPSTFREQUENCIES_H
13#define ASAPSTFREQUENCIES_H
14
15#include <casa/aips.h>
16#include <casa/BasicSL/String.h>
17#include <coordinates/Coordinates/SpectralCoordinate.h>
18#include <tables/Tables/Table.h>
19#include <tables/Tables/ScalarColumn.h>
20
21#include "STSubTable.h"
22
23namespace asap {
24
25/**
26The Frequencies subtable of the Scantable
27
28@author Malte Marquarding
[836]29@brief The frequency subtable of the Scantable
[806]30*/
31class STFrequencies : public STSubTable {
32public:
33 STFrequencies( casa::Table::TableType tt = casa::Table::Memory);
34
35 virtual ~STFrequencies();
36 /**
37 * Add a new Entry to the Frequency subtable. This checks for duplicates.
38 * @param[in] refpix the reference pixel
39 * @param[in] refval the reference value
40 * @param[in] inc the increment
41 * @return an index into the frequency table
42 */
43 casa::uInt addEntry( casa::Double refpix, casa::Double refval,
44 casa::Double inc );
45
[836]46 /**
47 * Retrieve the frequency values for a specific id via references
48 * @param refpix the reference pixel
49 * @param refval the reference value
50 * @param inc the increment
51 * @param id the identifier
52 */
[830]53 void getEntry( casa::Double& refpix, casa::Double& refval,
54 casa::Double& inc, casa::uInt id );
[806]55
[836]56
[840]57 bool conformant(const STFrequencies& other) const;
58
[836]59 /**
60 * Retrieve the frequency values as a casa::SpectralCoordinate
61 * @param freqID
62 * @return casa::SpectralCoordinate
63 */
[847]64 casa::SpectralCoordinate getSpectralCoordinate( casa::uInt freqID ) const;
[806]65
[847]66 casa::SpectralCoordinate getSpectralCoordinate( const casa::MDirection& md,
67 const casa::MPosition& mp,
68 const casa::MEpoch& me,
69 casa::Double restfreq,
70 casa::uInt freqID
71 ) const;
72
[836]73 /**
74 * Return the unit of the frequency values
75 * @return casa::Unit
76 */
[847]77 casa::Unit getUnit() const;
78 std::string getUnitString() const;
79
[836]80 /**
81 * Return the doppler type of the values
[847]82 * @return casa::MDoppler::Types
[836]83 */
[847]84 casa::MDoppler::Types getDoppler() const;
85 std::string getDopplerString() const;
[806]86
87
[836]88 /**
89 * Return the frame type, e.g MFrequency::TOPO
[847]90 * @param base return the base frame or the user frame
[836]91 * @return casa::MFrequency::Types
92 */
[847]93 casa::MFrequency::Types getFrame(bool base=false) const;
[836]94
95 /**
96 * Return a string representation of the frame type, e.g TOPO
[847]97 * @param base return the base frame or the user frame
98 * @return the string representation of the frame
[836]99 */
[847]100 std::string getFrameString(bool base=false) const;
[836]101
102 /**
103 * set the frequency frame from a string value
104 * @param frame a string identifier
105 */
[806]106 void setFrame(const std::string& frame);
[836]107 /**
108 * set the frequency frame from a casa::MFrequency::Types
109 * @param frame casa::MFrequency::Types
110 */
[806]111 void setFrame(casa::MFrequency::Types frame);
112
[836]113 /**
114 * rescale the whole table by a given factor
115 * @param factor the factor to bin or resample by
116 * @param mode the rescaling mode
117 * @li "BIN"
118 * @li "RESAMPLE"
119 */
[806]120 void rescale(casa::Float factor, const std::string& mode);
121
[836]122 /**
123 * get the reference frequency at a given channel for a specidif identifier
124 * @param id the identifier
125 * @param channel the channel number
126 * @return teh reference frequency
127 */
[830]128 float getRefFreq(casa::uInt id, casa::uInt channel);
[806]129
[836]130
131 /**
132 * Rteun this table or s specific row as a string representation
133 * @param id the identifier. If id<0 all rows are returned
134 * @return a string
135 */
[806]136 std::string print(int id=-1);
137
[847]138 std::vector<std::string> getInfo() const;
139 void setInfo( const std::vector<std::string>& theinfo );
140
[806]141private:
[836]142
143 /**
144 * setup the the column structure of the casa::table
145 */
[806]146 void setup();
[836]147 /**
148 * the actual binning of the SpectralCoordinate as called by rescale
149 * @param sc
150 * @param factor the bin factor
151 * @return casa::SpectralCoordinate
152 */
[806]153 casa::SpectralCoordinate binCsys(const casa::SpectralCoordinate& sc, casa::Int factor);
[836]154 /**
155 * the actual resampling of the SpectralCoordinate as called by rescale
156 * @param sc
157 * @param width the resacle width. Can be decimal.
158 * @return
159 */
[806]160 casa::SpectralCoordinate resampleCsys(const casa::SpectralCoordinate& sc, casa::Float width);
161
162 static const casa::String name_;
163 casa::ScalarColumn<casa::Double> refvalCol_, refpixCol_, incrCol_;
164};
165
166}
167
168#endif
Note: See TracBrowser for help on using the repository browser.