source: trunk/src/SDMemTable.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.2 KB
Line 
1//#---------------------------------------------------------------------------
2//# SDMemTable.h: A MemoryTable container 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 _SDMEMTABLE_H_
32#define _SDMEMTABLE_H_
33
34// STL
35#include <string>
36#include <vector>
37// AIPS++
38#include <aips/aips.h>
39#include <aips/Utilities/String.h>
40#include <aips/Tables/Table.h>
41#include <aips/Arrays/MaskedArray.h>
42
43namespace atnf_sd {
44
45class SDContainer;
46class SDHeader;
47class SDFrequencyTable;
48
49
50class SDMemTable {
51public:
52  SDMemTable(const std::string& name= "SDInputTable.tbl");
53  SDMemTable(const SDMemTable& other, Bool clear=False);
54
55  SDMemTable(const Table& tab, Int scanID);
56  virtual ~SDMemTable();
57  virtual bool putSDContainer(const SDContainer& sdc);
58  virtual bool putSDHeader(const SDHeader& sdh) {;}
59  virtual bool putSDFreqTable(const SDFrequencyTable& sdft) {;}
60 
61  virtual std::vector<float> getSpectrum(Int whichRow) const;
62  virtual std::vector<bool> getMask(Int whichRow) const;
63 
64  MaskedArray<Float> rowAsMaskedArray(uInt whichRow,
65                                      Bool useSelection = False);
66
67  virtual Float getTsys(Int whichRow) const;
68  virtual Double getTime(Int whichRow) const ;
69  virtual std::string getSourceName(Int whichRow) const ;
70 
71  virtual bool setIF(Int whichIF=0);
72  virtual bool setBeam(Int whichBeam=0);
73  virtual bool setPol(Int whichPol=0);   
74
75  virtual Int getIF() { return IFSel_; }
76  virtual Int getBeam() { return beamSel_; }
77  virtual Int getPol() { return polSel_; }   
78
79  //sets the mask
80  virtual bool setMask(const std::vector<int>& whichChans);
81 
82  virtual void summary() const;
83 
84  std::string name() const;
85  void makePersistent(const std::string& filename);
86  SDMemTable getScan(Int scanID);
87  const Table& table() { return table_; }
88
89private:
90  void setup();
91  //Int nBeam_,nIF_,nChan_,nPol_;
92  Int IFSel_,beamSel_,polSel_;
93  std::vector<bool> chanMask_;
94  String name_;
95  Table table_;
96};
97
98}// namespace
99#endif
Note: See TracBrowser for help on using the repository browser.