source: trunk/src/SDMemTable.h @ 18

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

Moved SDHeader from SDReader to SDConatiner. Added header to SDMemTable. Added access funtions to nif,nbema,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();
53  SDMemTable(const std::string& name);
54  SDMemTable(const SDMemTable& other, Bool clear=False);
55
56  SDMemTable(const Table& tab, Int scanID);
57  virtual ~SDMemTable();
58  virtual bool putSDContainer(const SDContainer& sdc);
59  virtual bool putSDHeader(const SDHeader& sdh);
60  virtual bool putSDFreqTable(const SDFrequencyTable& sdft) {;}
61 
62  virtual std::vector<float> getSpectrum(Int whichRow) const;
63  virtual std::vector<bool> getMask(Int whichRow) const;
64 
65  MaskedArray<Float> rowAsMaskedArray(uInt whichRow,
66                                      Bool useSelection = False);
67
68  virtual Float getTsys(Int whichRow) const;
69  virtual Double getTime(Int whichRow) const ;
70  virtual std::string getSourceName(Int whichRow) const ;
71 
72  virtual bool setIF(Int whichIF=0);
73  virtual bool setBeam(Int whichBeam=0);
74  virtual bool setPol(Int whichPol=0);   
75  //sets the user mask
76  virtual bool setMask(const std::vector<int>& whichChans);
77 
78
79  virtual Int getIF() { return IFSel_; }
80  virtual Int getBeam() { return beamSel_; }
81  virtual Int getPol() { return polSel_; }   
82 
83  virtual void summary() const;
84 
85  std::string name() const;
86  void makePersistent(const std::string& filename);
87  SDMemTable getScan(Int scanID);
88
89  const TableRecord& getHeader() const {;}
90  const Table& table() { return table_; }
91
92  Int nBeam() const;
93  Int nIF() const;
94  Int nPol() const;
95  Int nChan() const;
96
97private:
98  void setup();
99
100  Int IFSel_,beamSel_,polSel_;
101  std::vector<bool> chanMask_;
102  String name_;
103  Table table_;
104};
105
106}// namespace
107#endif
Note: See TracBrowser for help on using the repository browser.