1 | //#--------------------------------------------------------------------------- |
---|
2 | //# SDContainer.h: A container class for single dish integrations |
---|
3 | //#--------------------------------------------------------------------------- |
---|
4 | //# Copyright (C) 2004 |
---|
5 | //# Malte Marquarding, ATNF |
---|
6 | //# |
---|
7 | //# This program is free software; you can redistribute it and/or modify it |
---|
8 | //# under the terms of the GNU General Public License as published by the Free |
---|
9 | //# Software Foundation; either version 2 of the License, or (at your option) |
---|
10 | //# any later version. |
---|
11 | //# |
---|
12 | //# This program is distributed in the hope that it will be useful, but |
---|
13 | //# WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
14 | //# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
---|
15 | //# Public License for more details. |
---|
16 | //# |
---|
17 | //# You should have received a copy of the GNU General Public License along |
---|
18 | //# with this program; if not, write to the Free Software Foundation, Inc., |
---|
19 | //# 675 Massachusetts Ave, Cambridge, MA 02139, USA. |
---|
20 | //# |
---|
21 | //# Correspondence concerning this software should be addressed as follows: |
---|
22 | //# Internet email: Malte.Marquarding@csiro.au |
---|
23 | //# Postal address: Malte Marquarding, |
---|
24 | //# Australia Telescope National Facility, |
---|
25 | //# P.O. Box 76, |
---|
26 | //# Epping, NSW, 2121, |
---|
27 | //# AUSTRALIA |
---|
28 | //# |
---|
29 | //# $Id: |
---|
30 | //#--------------------------------------------------------------------------- |
---|
31 | #ifndef _SDCONTAINER_H_ |
---|
32 | #define _SDCONTAINER_H_ |
---|
33 | |
---|
34 | #include <aips/aips.h> |
---|
35 | #include <aips/Utilities/String.h> |
---|
36 | #include <aips/Arrays/Array.h> |
---|
37 | #include <aips/Arrays/Vector.h> |
---|
38 | |
---|
39 | template<class T> class Matrix; |
---|
40 | |
---|
41 | namespace atnf_sd { |
---|
42 | |
---|
43 | class SDFrequencyTable { |
---|
44 | |
---|
45 | public: |
---|
46 | |
---|
47 | SDFrequencyTable(Double refPix, Double refVal, Double inc) {;} |
---|
48 | // returns the index into the table |
---|
49 | // this creates a new one or returns an existing one |
---|
50 | Int addFrequency(Double refPix, Double refVal, Double inc) {;} |
---|
51 | |
---|
52 | Int length() const { return nFreq_;};// # of stored Frequencies |
---|
53 | // returns a Table with nRows == nFreq, and three cols |
---|
54 | |
---|
55 | private: |
---|
56 | Int nFreq_; |
---|
57 | Vector<Double> refPix_; |
---|
58 | Vector<Double> revVal_; |
---|
59 | Vector<Double> increment_; |
---|
60 | }; |
---|
61 | |
---|
62 | |
---|
63 | class SDContainer { |
---|
64 | |
---|
65 | public: |
---|
66 | SDContainer(uInt nBeam, uInt nIF, uInt nChan, uInt nPol); |
---|
67 | |
---|
68 | virtual ~SDContainer(); |
---|
69 | |
---|
70 | Bool setSpectrum(const Matrix<Float>& spec, |
---|
71 | uInt whichBeam, uInt whichIF); |
---|
72 | Bool putSpectrum(const Array<Float>& spec); |
---|
73 | |
---|
74 | Bool setFlags(const Matrix<uChar>& flgs, |
---|
75 | uInt whichBeam, uInt whichIF); |
---|
76 | Bool putFlags(const Array<uChar>& spec); |
---|
77 | |
---|
78 | Bool setTsys(const Vector<Float>& ts, |
---|
79 | uInt whichBeam, uInt whichIF); |
---|
80 | Bool putTsys(const Array<Float>& spec); |
---|
81 | |
---|
82 | Bool setPointing(const Vector<Double>& point, uInt whichBeam) {;} |
---|
83 | |
---|
84 | Bool setFrequencyMap(uInt freqslot, uInt whichIF) {;} |
---|
85 | |
---|
86 | const Array<Float>& getSpectrum() const { return spectrum_; } |
---|
87 | const Array<uChar>& getFlags() const { return flags_; } |
---|
88 | const Array<Float>& getTsys() const { return tsys_; } |
---|
89 | |
---|
90 | Double timestamp; |
---|
91 | String sourcename; |
---|
92 | Double interval; |
---|
93 | uInt scanid; |
---|
94 | |
---|
95 | private: |
---|
96 | uInt nBeam_,nIF_,nChan_,nPol_; |
---|
97 | |
---|
98 | // (nBeam,nIF,nChannel,nPol) |
---|
99 | Array<Float> spectrum_; |
---|
100 | Array<uChar> flags_; |
---|
101 | // (nBeam,nIF,nPol) |
---|
102 | Array<Float> tsys_; |
---|
103 | Array<Float> tcal_; |
---|
104 | |
---|
105 | //(nBeam) maybe use Measures here... |
---|
106 | //*** Vector<Vector<Double>> pointing_; |
---|
107 | //(nIF) indx into "global" frequency table |
---|
108 | Vector<uInt> freqidx_; |
---|
109 | |
---|
110 | }; |
---|
111 | |
---|
112 | } // namespace |
---|
113 | #endif |
---|