casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
SDFITSwriter.h
Go to the documentation of this file.
00001 //#---------------------------------------------------------------------------
00002 //# SDFITSwriter.h: ATNF CFITSIO interface class for SDFITS output.
00003 //#---------------------------------------------------------------------------
00004 //# livedata - processing pipeline for single-dish, multibeam spectral data.
00005 //# Copyright (C) 2000-2009, Australia Telescope National Facility, CSIRO
00006 //#
00007 //# This file is part of livedata.
00008 //#
00009 //# livedata is free software: you can redistribute it and/or modify it under
00010 //# the terms of the GNU General Public License as published by the Free
00011 //# Software Foundation, either version 3 of the License, or (at your option)
00012 //# any later version.
00013 //#
00014 //# livedata is distributed in the hope that it will be useful, but WITHOUT
00015 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00016 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
00017 //# more details.
00018 //#
00019 //# You should have received a copy of the GNU General Public License along
00020 //# with livedata.  If not, see <http://www.gnu.org/licenses/>.
00021 //#
00022 //# Correspondence concerning livedata may be directed to:
00023 //#        Internet email: mcalabre@atnf.csiro.au
00024 //#        Postal address: Dr. Mark Calabretta
00025 //#                        Australia Telescope National Facility, CSIRO
00026 //#                        PO Box 76
00027 //#                        Epping NSW 1710
00028 //#                        AUSTRALIA
00029 //#
00030 //# http://www.atnf.csiro.au/computing/software/livedata.html
00031 //# $Id: SDFITSwriter.h,v 19.10 2009-09-29 07:33:39 cal103 Exp $
00032 //#---------------------------------------------------------------------------
00033 //# Original: 2000/07/24, Mark Calabretta, ATNF
00034 //#---------------------------------------------------------------------------
00035 
00036 #ifndef ATNF_SDFITSWRITER_H
00037 #define ATNF_SDFITSWRITER_H
00038 
00039 #include <atnf/PKSIO/MBrecord.h>
00040 #include <casa/Logging/LogIO.h>
00041 
00042 #include <fitsio.h>
00043 
00044 using namespace std;
00045 using namespace casa;
00046 
00047 // <summary>
00048 // ATNF CFITSIO interface class for SDFITS output.
00049 // </summary>
00050 
00051 class SDFITSwriter
00052 {
00053   public:
00054     // Default constructor.
00055     SDFITSwriter();
00056 
00057     // Destructor.
00058     virtual ~SDFITSwriter();
00059 
00060     // Create a new SDFITSwriter and store static data.
00061     int create(
00062         char*  sdname,
00063         char*  observer,
00064         char*  project,
00065         char*  telescope,
00066         double antPos[3],
00067         char*  obsMode,
00068         char*  bunit,
00069         float  equinox,
00070         char*  dopplerFrame,
00071         int    nIF,
00072         int*   nChan,
00073         int*   nPol,
00074         int*   haveXPol,
00075         int    haveBase,
00076         int    extraSysCal);
00077 
00078     // Store time-variable data.
00079     int write(MBrecord &record);
00080 
00081     // Write a history record.
00082     int history(char* text);
00083 
00084     // Close the SDFITS file.
00085     void close();
00086 
00087     // Close and delete the SDFITS file.
00088     void deleteFile();
00089 
00090   private:
00091     fitsfile *cSDptr;
00092     int  cDoTDIM, cDoXPol, cExtraSysCal, cHaveBase, *cHaveXPol, cIsMX,
00093          *cNChan, cNIF, *cNPol, cStatus;
00094     long cRow;
00095 
00096     // Message handling.
00097     char cMsg[256];
00098     void log(LogOrigin origin, LogIO::Command cmd, const char *msg = 0x0);
00099 };
00100 
00101 #endif