healpix_map_fitsio.h

Go to the documentation of this file.
00001 /*
00002  *  This file is part of Healpix_cxx.
00003  *
00004  *  Healpix_cxx is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  Healpix_cxx is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with Healpix_cxx; if not, write to the Free Software
00016  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00017  *
00018  *  For more information about HEALPix, see http://healpix.sourceforge.net
00019  */
00020 
00021 /*
00022  *  Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik
00023  *  and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt
00024  *  (DLR).
00025  */
00026 
00027 /*! \file healpix_map_fitsio.h
00028  *  Copyright (C) 2003-2011 Max-Planck-Society
00029  *  \author Martin Reinecke
00030  */
00031 
00032 #ifndef HEALPIX_MAP_FITSIO_H
00033 #define HEALPIX_MAP_FITSIO_H
00034 
00035 #include <string>
00036 #include "datatypes.h"
00037 #include "fitshandle.h"
00038 #include "healpix_base.h"
00039 
00040 template<typename T> class arr;
00041 template<typename T> class Healpix_Map;
00042 
00043 /*! \defgroup healpix_map_fitsio_group FITS-based I/O of HEALPix maps */
00044 /*! \{ */
00045 
00046 /*! Reads the map stored in column \a colnum of the FITS binary table
00047     pointed to by \a inp into \a map. */
00048 template<typename T> void read_Healpix_map_from_fits
00049   (fitshandle &inp, Healpix_Map<T> &map, int colnum=1);
00050 /*! Opens the FITS file \a filename, jumps to the HDU \a hdunum,
00051     and reads the column \a colnum into \a map. */
00052 template<typename T> void read_Healpix_map_from_fits
00053   (const std::string &filename, Healpix_Map<T> &map, int colnum=1,
00054   int hdunum=2);
00055 
00056 template<typename T> void read_Healpix_map_from_fits
00057   (fitshandle &inp, Healpix_Map<T> &mapT, Healpix_Map<T> &mapQ,
00058   Healpix_Map<T> &mapU);
00059 template<typename T> void read_Healpix_map_from_fits
00060   (const std::string &filename, Healpix_Map<T> &mapT, Healpix_Map<T> &mapQ,
00061   Healpix_Map<T> &mapU, int hdunum=2);
00062 
00063 /*! Inserts a new binary table into \a out, which contains one column
00064     of Planck type \a datatype with the name \a name, and writes all HEALPix
00065     specific keywords based on the information in \a base. */
00066 void prepare_Healpix_fitsmap
00067   (fitshandle &out, const Healpix_Base &base, PDT datatype,
00068   const arr<std::string> &colname);
00069 
00070 /*! Inserts a new binary table into \a out, which contains one column
00071     of Planck type \a datatype, and stores \a map into this column. */
00072 template<typename T> void write_Healpix_map_to_fits
00073   (fitshandle &out, const Healpix_Map<T> &map, PDT datatype);
00074 /*! Inserts a new binary table into \a out, which contains three columns
00075     of Planck type \a datatype, and stores \a mapT, \a mapQ and \a mapU
00076     into these columns. */
00077 template<typename T> void write_Healpix_map_to_fits
00078   (fitshandle &out, const Healpix_Map<T> &mapT,
00079    const Healpix_Map<T> &mapQ, const Healpix_Map<T> &mapU, PDT datatype);
00080 
00081 /*! Creates a new FITS file with the name \a outfile, with a binary table in
00082     HDU 2, which contains one column of Planck type \a datatype, and stores
00083     \a map into this column. */
00084 template<typename T> inline void write_Healpix_map_to_fits
00085   (const std::string &outfile, const Healpix_Map<T> &map, PDT datatype)
00086   {
00087   fitshandle out;
00088   out.create (outfile);
00089   write_Healpix_map_to_fits (out,map,datatype);
00090   }
00091 /*! Creates a new FITS file with the name \a outfile, with a binary table in
00092     HDU 2, which contains three columns of Planck type \a datatype, and stores
00093     \a mapT, \a mapQ and \a mapU into this column. */
00094 template<typename T> inline void write_Healpix_map_to_fits
00095   (const std::string &outfile, const Healpix_Map<T> &mapT,
00096    const Healpix_Map<T> &mapQ, const Healpix_Map<T> &mapU, PDT datatype)
00097   {
00098   fitshandle out;
00099   out.create (outfile);
00100   write_Healpix_map_to_fits (out,mapT,mapQ,mapU,datatype);
00101   }
00102 
00103 /*! \} */
00104 
00105 #endif

Generated on Thu Oct 8 14:48:52 2015 for Healpix C++