source: trunk/src/SDContainer.h@ 16

Last change on this file since 16 was 16, checked in by mmarquar, 20 years ago

Updated data container. Changed the axis order in the spectrum/flag arrays to [nBeam,nIF,nPol,nChan]

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.5 KB
Line 
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
39template<class T> class Matrix;
40
41namespace atnf_sd {
42
43class SDFrequencyTable {
44
45public:
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
55private:
56 Int nFreq_;
57 Vector<Double> refPix_;
58 Vector<Double> revVal_;
59 Vector<Double> increment_;
60};
61
62
63class SDContainer {
64
65public:
66 SDContainer(uInt nBeam, uInt nIF, uInt nPol, uInt nChan);
67 SDContainer(IPosition shp);
68
69 virtual ~SDContainer();
70
71 Bool setSpectrum(const Matrix<Float>& spec,
72 uInt whichBeam, uInt whichIF);
73 Bool putSpectrum(const Array<Float>& spec);
74
75 Bool setFlags(const Matrix<uChar>& flgs,
76 uInt whichBeam, uInt whichIF);
77 Bool putFlags(const Array<uChar>& spec);
78
79 Bool setTsys(const Vector<Float>& ts,
80 uInt whichBeam, uInt whichIF);
81 Bool putTsys(const Array<Float>& spec);
82
83 Bool setPointing(const Vector<Double>& point, uInt whichBeam) {;}
84
85 Bool setFrequencyMap(uInt freqslot, uInt whichIF) {;}
86
87 const Array<Float>& getSpectrum() const { return spectrum_; }
88 const Array<uChar>& getFlags() const { return flags_; }
89 const Array<Float>& getTsys() const { return tsys_; }
90
91 Double timestamp;
92 String sourcename;
93 Double interval;
94 uInt scanid;
95
96private:
97 uInt nBeam_,nIF_,nPol_,nChan_;
98
99 // (nBeam,nIF,nPol,nChannel)
100 Array<Float> spectrum_;
101 Array<uChar> flags_;
102 // (nBeam,nIF,nPol,[nChannel]) Tsys is not really a function of
103 // channel, but this makes it easier to work with at the expense of
104 // a little memory
105 Array<Float> tsys_;
106 Array<Float> tcal_;
107
108 //(nBeam) maybe use Measures here...
109 //*** Vector<Vector<Double>> pointing_;
110 //(nIF) indx into "global" frequency table
111 Vector<uInt> freqidx_;
112
113};
114
115} // namespace
116#endif
Note: See TracBrowser for help on using the repository browser.