Gyoto
GyotoFitsRW.h
Go to the documentation of this file.
1 
7 /*
8  Copyright 2019 Frederic Vincent, Thibaut Paumard, Nicolas Aimar
9 
10  This file is part of Gyoto.
11 
12  Gyoto is free software: you can redistribute it and/or modify
13  it under the terms of the GNU General Public License as published by
14  the Free Software Foundation, either version 3 of the License, or
15  (at your option) any later version.
16 
17  Gyoto is distributed in the hope that it will be useful,
18  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  GNU General Public License for more details.
21 
22  You should have received a copy of the GNU General Public License
23  along with Gyoto. If not, see <http://www.gnu.org/licenses/>.
24  */
25 
26 #ifndef __GyotoFitsRW_H_
27 #define __GyotoFitsRW_H_
28 
29 #include <iostream>
30 #include <fstream>
31 #include <iomanip>
32 #ifdef GYOTO_USE_CFITSIO
33 #include <fitsio.h>
34 #endif
35 
36 namespace Gyoto {
37  class FitsRW;
38 }
39 
40 #ifdef GYOTO_USE_XERCES
41 #include <GyotoRegister.h>
42 #endif
43 
51 {
52  private:
53 
54  size_t nnu_; //number of frequency lines in FITS File
55  double numin_;
56  double numax_;
57  size_t nt_; //number of time steps in FITS File
58  double dt_;
59  double tmin_;
60  double tmax_;
61 
62  public:
63  FitsRW();
64  FitsRW(const FitsRW&);
65  virtual FitsRW* clone() const ;
66  virtual ~FitsRW() ;
67 
68  // Accessors
69  void numin(double numn);
70  double numin() const;
71  void numax(double numx);
72  double numax() const;
73  void nnu(size_t nn);
74  size_t nnu() const;
75  void tmin(double tmn);
76  double tmin() const;
77  void tmax(double tmx);
78  double tmax() const;
79  void nt(size_t nn);
80  size_t nt() const;
81  void dt(double dd);
82  double dt() const;
83 
84 #ifdef GYOTO_USE_CFITSIO
85 
97  fitsfile* fitsCreate(std::string filename);
98 
106  void fitsClose(fitsfile* fptr);
107 
119  void fitsWriteHDU(fitsfile* fptr,
120  std::string extname,
121  double* src);
122 
123  void fitsWriteParams(fitsfile* fptr, double n_e, double theta, double kappa, double BB, double t_inj);
124 
125  virtual std::vector<size_t> fitsReadHDU(fitsfile* fptr,
126  std::string extname,
127  double *& dest);
128 
129  #endif
130 
131  void getIndices(size_t i[2], double const nu, double const tt, double* const freq_array) const ;
132  double interpolate(double nu, double tt, double* const array, double* const freq_array) const ;
133 
134 };
135 
136 
137 #endif
FitsRW()
Constructor.
Gyoto registers.
Definition: GyotoFitsRW.h:50
void fitsClose(fitsfile *fptr)
Closes a fits file referred to by a fitsfile pointer.
void fitsWriteHDU(fitsfile *fptr, std::string extname, double *src)
Writes specific HDU in FITS files.
Namespace for the Gyoto library.
Definition: GyotoAstrobj.h:43
virtual ~FitsRW()
Destructor.
fitsfile * fitsCreate(std::string filename)
Creates a FITS file with dummy primary HDU.