GyotoGridData2D.h
Go to the documentation of this file.
/*
Copyright (c) 2019-2021 Frederic Vincent, Thibaut Paumard, Nicolas Aimar
This file is part of Gyoto.
Gyoto is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Gyoto is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Gyoto. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GyotoGridData2D_H_
#define __GyotoGridData2D_H_
#include <iostream>
#include <fstream>
#include <iomanip>
#ifdef GYOTO_USE_CFITSIO
#include <fitsio.h>
#endif
namespace Gyoto {
class GridData2D;
}
#ifdef GYOTO_USE_XERCES
#include <GyotoRegister.h>
#endif
class Gyoto::GridData2D
{
private:
double phimin_;
double phimax_;
double dphi_;
size_t nphi_;
double dr_;
size_t nr_;
double rmin_;
double rmax_;
double dt_;
size_t nt_;
double tmin_;
double tmax_;
//NB: phimin, phimax are always assumed to be 0, 2pi
public:
GridData2D();
GridData2D(const GridData2D&);
virtual GridData2D* clone() const ;
virtual ~GridData2D() ;
// Accessors
void rmin(double rmn);
double rmin() const;
void rmax(double rmx);
double rmax() const;
void nr(size_t nn);
size_t nr() const;
void dr(double dd);
double dr() const;
void phimin(double phimn);
double phimin() const;
void phimax(double phimx);
double phimax() const;
void dphi(double dd);
double dphi() const;
void tmin(double tmn);
double tmin() const;
void tmax(double tmx);
double tmax() const;
void nt(size_t nn);
size_t nt() const;
void nphi(size_t nn);
size_t nphi() const;
#ifdef GYOTO_USE_CFITSIO
virtual std::vector<size_t> fitsReadHDU(fitsfile* fptr,
std::string extname,
double *& dest,
size_t length = 0);
fitsfile* fitsCreate(std::string filename);
void fitsClose(fitsfile* fptr);
void fitsWriteHDU(fitsfile* fptr,
std::string extname,
double* src,
size_t length = 0) ;
#endif
void getIndices(size_t i[3], double const tt, double const phi, double const rr, double* const time_array=NULL) const ;
double interpolate(double tt, double phi, double rr,
double* const array, double* const time_array=NULL) const ;
};
#endif
GyotoRegister.h
Gyoto registers.
Gyoto::GridData2D
Class for reading data stored in a 2D grid.
Definition GyotoGridData2D.h:52
Gyoto::GridData2D::nt_
size_t nt_
Grid size in the t direction.
Definition GyotoGridData2D.h:63
Gyoto::GridData2D::GridData2D
GridData2D(const GridData2D &)
Copy constructor.
Gyoto::GridData2D::fitsCreate
fitsfile * fitsCreate(std::string filename)
Creates a FITS file with dummy primary HDU.
Gyoto::GridData2D::dr_
double dr_
Radius step.
Definition GyotoGridData2D.h:58
Gyoto::GridData2D::fitsWriteHDU
void fitsWriteHDU(fitsfile *fptr, std::string extname, double *src, size_t length=0)
Writes specific HDU in FITS files.
Gyoto::GridData2D::phimax_
double phimax_
Maximum phi in grid.
Definition GyotoGridData2D.h:55
Gyoto::GridData2D::GridData2D
GridData2D()
Constructor.
Gyoto::GridData2D::nr_
size_t nr_
Grid size in the r direction.
Definition GyotoGridData2D.h:59
Gyoto::GridData2D::~GridData2D
virtual ~GridData2D()
Destructor.
Gyoto::GridData2D::dt_
double dt_
Time step, if not constant would be ignored.
Definition GyotoGridData2D.h:62
Gyoto::GridData2D::tmin_
double tmin_
Minimum t in grid.
Definition GyotoGridData2D.h:64
Gyoto::GridData2D::rmin_
double rmin_
Minimum r in grid.
Definition GyotoGridData2D.h:60
Gyoto::GridData2D::fitsClose
void fitsClose(fitsfile *fptr)
Closes a fits file referred to by a fitsfile pointer.
Gyoto::GridData2D::tmax_
double tmax_
Maximum t in grid.
Definition GyotoGridData2D.h:65
Gyoto::GridData2D::phimin_
double phimin_
Minimum phi in grid.
Definition GyotoGridData2D.h:54
Gyoto::GridData2D::nphi_
size_t nphi_
Grid size in the φ direction.
Definition GyotoGridData2D.h:57
Gyoto::GridData2D::rmax_
double rmax_
Maximum r in grid.
Definition GyotoGridData2D.h:61
Gyoto::GridData2D::dphi_
double dphi_
δφ between two grid columns
Definition GyotoGridData2D.h:56
Gyoto
Namespace for the Gyoto library.
Definition GyotoAstrobj.h:44