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 <vector>
|
---|
35 |
|
---|
36 | #include <aips/aips.h>
|
---|
37 | #include <aips/Utilities/String.h>
|
---|
38 | #include <aips/Arrays/Array.h>
|
---|
39 | #include <aips/Arrays/Vector.h>
|
---|
40 |
|
---|
41 | template<class T> class Matrix;
|
---|
42 |
|
---|
43 | namespace atnf_sd {
|
---|
44 |
|
---|
45 |
|
---|
46 | struct SDHeader {
|
---|
47 | Int nchan;
|
---|
48 | Int npol;
|
---|
49 | Int nif;
|
---|
50 | Int nbeam;
|
---|
51 | String observer;
|
---|
52 | String project;
|
---|
53 | String obstype;
|
---|
54 | String antennaname;
|
---|
55 | Vector<Double> antennaposition;
|
---|
56 | Float equinox;
|
---|
57 | String freqref;
|
---|
58 | Double reffreq;
|
---|
59 | Double bandwidth;
|
---|
60 | Double utc;
|
---|
61 | void print() const ;
|
---|
62 | };
|
---|
63 |
|
---|
64 | class SDFrequencyTable {
|
---|
65 |
|
---|
66 | public:
|
---|
67 |
|
---|
68 | SDFrequencyTable() {;}
|
---|
69 | // returns the index into the table
|
---|
70 | // this creates a new one or returns an existing one
|
---|
71 | Int addFrequency(Double refPix, Double refVal, Double inc) {;}
|
---|
72 |
|
---|
73 | Int length() const { return nFreq_;};// # of stored Frequencies
|
---|
74 | // returns a Table with nRows == nFreq, and three cols
|
---|
75 |
|
---|
76 | private:
|
---|
77 | Int nFreq_;
|
---|
78 | std::vector<double> refPix_;
|
---|
79 | std::vector<double> revVal_;
|
---|
80 | std::vector<double> increment_;
|
---|
81 | };
|
---|
82 |
|
---|
83 |
|
---|
84 | class SDContainer {
|
---|
85 |
|
---|
86 | public:
|
---|
87 | SDContainer(uInt nBeam, uInt nIF, uInt nPol, uInt nChan);
|
---|
88 | SDContainer(IPosition shp);
|
---|
89 |
|
---|
90 | virtual ~SDContainer();
|
---|
91 |
|
---|
92 | Bool setSpectrum(const Matrix<Float>& spec,
|
---|
93 | uInt whichBeam, uInt whichIF);
|
---|
94 | Bool putSpectrum(const Array<Float>& spec);
|
---|
95 |
|
---|
96 | Bool setFlags(const Matrix<uChar>& flgs,
|
---|
97 | uInt whichBeam, uInt whichIF);
|
---|
98 | Bool putFlags(const Array<uChar>& spec);
|
---|
99 |
|
---|
100 | Bool setTsys(const Vector<Float>& ts,
|
---|
101 | uInt whichBeam, uInt whichIF);
|
---|
102 | Bool putTsys(const Array<Float>& spec);
|
---|
103 |
|
---|
104 | Bool setPointing(const Vector<Double>& point, uInt whichBeam) {;}
|
---|
105 |
|
---|
106 | Bool setFrequencyMap(uInt freqslot, uInt whichIF) {;}
|
---|
107 |
|
---|
108 | const Array<Float>& getSpectrum() const { return spectrum_; }
|
---|
109 | const Array<uChar>& getFlags() const { return flags_; }
|
---|
110 | const Array<Float>& getTsys() const { return tsys_; }
|
---|
111 |
|
---|
112 | Array<Float> getSpectrum(uInt whichBeam, uInt whichIF) const;
|
---|
113 | Array<uChar> getFlags(uInt whichBeam, uInt whichIF) const;
|
---|
114 | Array<Float> getTsys(uInt whichBeam, uInt whichIF) const;
|
---|
115 |
|
---|
116 | Double timestamp;
|
---|
117 | String sourcename;
|
---|
118 | Double interval;
|
---|
119 | Int scanid;
|
---|
120 |
|
---|
121 | private:
|
---|
122 | uInt nBeam_,nIF_,nPol_,nChan_;
|
---|
123 |
|
---|
124 | // (nBeam,nIF,nPol,nChannel)
|
---|
125 | Array<Float> spectrum_;
|
---|
126 | Array<uChar> flags_;
|
---|
127 | // (nBeam,nIF,nPol,[nChannel]) Tsys is not really a function of
|
---|
128 | // channel, but this makes it easier to work with at the expense of
|
---|
129 | // a little memory
|
---|
130 | Array<Float> tsys_;
|
---|
131 | Array<Float> tcal_;
|
---|
132 |
|
---|
133 | //(nBeam) maybe use Measures here...
|
---|
134 | //*** Vector<Vector<Double>> pointing_;
|
---|
135 | //(nIF) indx into "global" frequency table
|
---|
136 | Vector<uInt> freqidx_;
|
---|
137 |
|
---|
138 | };
|
---|
139 |
|
---|
140 | } // namespace
|
---|
141 | #endif
|
---|