[2] | 1 | //#---------------------------------------------------------------------------
|
---|
| 2 | //# SDReader.h: A class to read single dish spectra from SDFITS, RPFITS
|
---|
| 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 _SDREADER_H_
|
---|
| 32 | #define _SDREADER_H_
|
---|
| 33 |
|
---|
| 34 | #include <vector>
|
---|
| 35 | #include <string>
|
---|
| 36 |
|
---|
| 37 | #include <aips/aips.h>
|
---|
| 38 | #include <aips/iostream.h>
|
---|
| 39 | #include <aips/iomanip.h>
|
---|
| 40 | #include <aips/Utilities/CountedPtr.h>
|
---|
| 41 | #include <aips/Utilities/String.h>
|
---|
| 42 | #include <aips/Arrays/Vector.h>
|
---|
| 43 |
|
---|
| 44 | #include "SDMemTable.h"
|
---|
[18] | 45 | #include "SDContainer.h"
|
---|
[2] | 46 |
|
---|
| 47 | class PKSreader;
|
---|
| 48 |
|
---|
| 49 | namespace atnf_sd {
|
---|
| 50 |
|
---|
| 51 | class SDReader {
|
---|
| 52 | public:
|
---|
| 53 | SDReader();
|
---|
| 54 | SDReader(CountedPtr<SDMemTable> tbl);
|
---|
| 55 | virtual ~SDReader();
|
---|
| 56 |
|
---|
| 57 | void open(const std::string& filename);
|
---|
| 58 | int read(const std::vector<int>& seq);
|
---|
| 59 |
|
---|
| 60 | CountedPtr<SDMemTable> getTable() const { return table_;}
|
---|
| 61 |
|
---|
| 62 | void reset();
|
---|
| 63 |
|
---|
| 64 | std::vector<int> pseudoHeader() const {
|
---|
| 65 | std::vector<int> v;
|
---|
| 66 | v.push_back(nBeam_);v.push_back(nIF_);
|
---|
| 67 | v.push_back(nChan_);v.push_back(nPol_);
|
---|
| 68 | return v;
|
---|
| 69 | }
|
---|
| 70 |
|
---|
| 71 | protected:
|
---|
| 72 |
|
---|
| 73 | private:
|
---|
[16] | 74 | Int nBeam_,nIF_,nPol_,nChan_;
|
---|
[2] | 75 | PKSreader* reader_;
|
---|
| 76 | SDHeader header_;
|
---|
[33] | 77 | SDFrequencyTable frequencies_;
|
---|
[2] | 78 | CountedPtr<SDMemTable> table_;
|
---|
| 79 | String filename_;
|
---|
| 80 | uInt cursor_;
|
---|
| 81 | Double timestamp_;
|
---|
| 82 | };
|
---|
| 83 |
|
---|
| 84 | }// namespace
|
---|
| 85 | #endif
|
---|