Healpix C++  3.82
healpix_map_fitsio.h
Go to the documentation of this file.
1 /*
2  * This file is part of Healpix_cxx.
3  *
4  * Healpix_cxx is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * Healpix_cxx is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with Healpix_cxx; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17  *
18  * For more information about HEALPix, see http://healpix.sourceforge.net
19  */
20 
21 /*
22  * Healpix_cxx is being developed at the Max-Planck-Institut fuer Astrophysik
23  * and financially supported by the Deutsches Zentrum fuer Luft- und Raumfahrt
24  * (DLR).
25  */
26 
27 /*! \file healpix_map_fitsio.h
28  * Copyright (C) 2003-2017 Max-Planck-Society
29  * \author Martin Reinecke
30  */
31 
32 #ifndef HEALPIX_MAP_FITSIO_H
33 #define HEALPIX_MAP_FITSIO_H
34 
35 #include <string>
36 #include "datatypes.h"
37 #include "fitshandle.h"
38 #include "healpix_base.h"
39 
40 template<typename T> class arr;
41 template<typename T> class Healpix_Map;
42 
43 /*! \defgroup healpix_map_fitsio_group FITS-based I/O of HEALPix maps */
44 /*! \{ */
45 
46 /*! Reads the map stored in column \a colnum of the FITS binary table
47  pointed to by \a inp into \a map. */
48 template<typename T> void read_Healpix_map_from_fits
49  (fitshandle &inp, Healpix_Map<T> &map, int colnum=1);
50 /*! Returns the map stored in column \a colnum of the FITS binary table
51  pointed to by \a inp. */
52 template<typename T> Healpix_Map<T> read_Healpix_map_from_fits
53  (fitshandle &inp, int colnum=1);
54 /*! Opens the FITS file \a filename, jumps to the HDU \a hdunum,
55  and reads the column \a colnum into \a map. */
56 template<typename T> void read_Healpix_map_from_fits
57  (const std::string &filename, Healpix_Map<T> &map, int colnum=1,
58  int hdunum=2);
59 /*! Opens the FITS file \a filename, jumps to the HDU \a hdunum,
60  and returns the map in column \a colnum. */
61 template<typename T> Healpix_Map<T> read_Healpix_map_from_fits
62  (const std::string &filename, int colnum=1, int hdunum=2);
63 
64 template<typename T> void read_Healpix_map_from_fits
65  (fitshandle &inp, Healpix_Map<T> &mapT, Healpix_Map<T> &mapQ,
66  Healpix_Map<T> &mapU);
67 template<typename T> void read_Healpix_map_from_fits
68  (const std::string &filename, Healpix_Map<T> &mapT, Healpix_Map<T> &mapQ,
69  Healpix_Map<T> &mapU, int hdunum=2);
70 
71 /*! Inserts a new binary table into \a out, which contains one column
72  of Planck type \a datatype with the name \a name, and writes all HEALPix
73  specific keywords based on the information in \a base. */
75  (fitshandle &out, const Healpix_Base &base, PDT datatype,
76  const arr<std::string> &colname);
77 
78 /*! Inserts a new binary table into \a out, which contains one column
79  of Planck type \a datatype, and stores \a map into this column. */
80 template<typename T> void write_Healpix_map_to_fits
81  (fitshandle &out, const Healpix_Map<T> &map, PDT datatype);
82 /*! Inserts a new binary table into \a out, which contains three columns
83  of Planck type \a datatype, and stores \a mapT, \a mapQ and \a mapU
84  into these columns. */
85 template<typename T> void write_Healpix_map_to_fits
86  (fitshandle &out, const Healpix_Map<T> &mapT,
87  const Healpix_Map<T> &mapQ, const Healpix_Map<T> &mapU, PDT datatype);
88 
89 /*! Creates a new FITS file with the name \a outfile, with a binary table in
90  HDU 2, which contains one column of Planck type \a datatype, and stores
91  \a map into this column. */
92 template<typename T> inline void write_Healpix_map_to_fits
93  (const std::string &outfile, const Healpix_Map<T> &map, PDT datatype)
94  {
95  fitshandle out;
96  out.create (outfile);
97  write_Healpix_map_to_fits (out,map,datatype);
98  }
99 /*! Creates a new FITS file with the name \a outfile, with a binary table in
100  HDU 2, which contains three columns of Planck type \a datatype, and stores
101  \a mapT, \a mapQ and \a mapU into this column. */
102 template<typename T> inline void write_Healpix_map_to_fits
103  (const std::string &outfile, const Healpix_Map<T> &mapT,
104  const Healpix_Map<T> &mapQ, const Healpix_Map<T> &mapU, PDT datatype)
105  {
106  fitshandle out;
107  out.create (outfile);
108  write_Healpix_map_to_fits (out,mapT,mapQ,mapU,datatype);
109  }
110 
111 /*! \} */
112 
113 #endif
void read_Healpix_map_from_fits(fitshandle &inp, Healpix_Map< T > &map, int colnum=1)
void write_Healpix_map_to_fits(fitshandle &out, const Healpix_Map< T > &map, PDT datatype)
void prepare_Healpix_fitsmap(fitshandle &out, const Healpix_Base &base, PDT datatype, const arr< std::string > &colname)

Generated on Thu Jul 28 2022 17:32:07 for Healpix C++