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