[28] | 1 | //#---------------------------------------------------------------------------
|
---|
[822] | 2 | //# STWriter.h: ASAP class to write out single dish spectra.
|
---|
[28] | 3 | //#---------------------------------------------------------------------------
|
---|
| 4 | //# Copyright (C) 2004
|
---|
[125] | 5 | //# ATNF
|
---|
[28] | 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: STWriter.h 988 2006-04-05 04:31:47Z mar637 $
|
---|
| 30 | //#---------------------------------------------------------------------------
|
---|
[822] | 31 | #ifndef STWRITER_H
|
---|
| 32 | #define STWRITER_H
|
---|
[28] | 33 |
|
---|
| 34 | #include <string>
|
---|
| 35 |
|
---|
[81] | 36 | #include <casa/aips.h>
|
---|
| 37 | #include <casa/Utilities/CountedPtr.h>
|
---|
[28] | 38 |
|
---|
[894] | 39 | #include "Logger.h"
|
---|
[827] | 40 | #include "Scantable.h"
|
---|
[28] | 41 |
|
---|
| 42 | class PKSwriter;
|
---|
[827] | 43 | class casa::Table;
|
---|
[28] | 44 |
|
---|
[83] | 45 | namespace asap {
|
---|
[848] | 46 | /**
|
---|
| 47 | * This exports the ASAP internal data format to othe formats,
|
---|
| 48 | * such as "SDFITS", "FITS", "MS2" or "ASCII"
|
---|
| 49 | *
|
---|
[894] | 50 | * @brief Export of ASAP data container into foreign formats
|
---|
[848] | 51 | * @author Malte Marquarding
|
---|
[988] | 52 | * @date 2006-03-08
|
---|
[848] | 53 | * @version 2.0a
|
---|
| 54 | */
|
---|
[890] | 55 | class STWriter : public Logger {
|
---|
[28] | 56 | public:
|
---|
[822] | 57 | STWriter(const string &format = "SDFITS");
|
---|
| 58 | ~STWriter();
|
---|
[28] | 59 |
|
---|
[848] | 60 | /**
|
---|
| 61 | * Set the format the data should be exported in
|
---|
| 62 | * @param format an be "SDFITS", "FITS", "MS2" or "ASCII"
|
---|
| 63 | * @return ststus code from PKSwriter
|
---|
| 64 | */
|
---|
| 65 | casa::Int setFormat(const string& format = "SDFITS");
|
---|
| 66 |
|
---|
| 67 | /**
|
---|
| 68 | * Write the data to a file (directory)
|
---|
| 69 | * @param table the Scantable object
|
---|
| 70 | * @param filename the output file name
|
---|
| 71 | * @return
|
---|
| 72 | */
|
---|
[827] | 73 | casa::Int write(const casa::CountedPtr<Scantable> table,
|
---|
[848] | 74 | const string& filename);
|
---|
[28] | 75 |
|
---|
| 76 | private:
|
---|
[827] | 77 | casa::Vector<casa::Float> tsysFromTable(const casa::Table& tab);
|
---|
| 78 |
|
---|
[822] | 79 | void polConversion( casa::Matrix<casa::Float>& spec,
|
---|
[827] | 80 | casa::Matrix<casa::uChar>& flag,
|
---|
[822] | 81 | casa::Vector<casa::Complex>& xpol,
|
---|
[827] | 82 | const casa::Table& tab);
|
---|
[988] | 83 | std::string format_;
|
---|
| 84 | PKSwriter* writer_;
|
---|
[28] | 85 | };
|
---|
| 86 |
|
---|
[53] | 87 | }// namespace
|
---|
[28] | 88 | #endif
|
---|