Gyoto
Public Member Functions | Private Attributes | List of all members
Gyoto::GridData2D Class Reference

Class for reading data stored in a 2D grid. More...

#include <GyotoGridData2D.h>

Inheritance diagram for Gyoto::GridData2D:
Gyoto::Astrobj::FlaredDiskSynchrotron

Public Member Functions

 GridData2D ()
 Constructor.
 
 GridData2D (const GridData2D &)
 Copy constructor.
 
virtual GridData2Dclone () const
 
virtual ~GridData2D ()
 Destructor.
 
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
 
virtual std::vector< size_tfitsReadHDU (fitsfile *fptr, std::string extname, double *&dest, size_t length=0)
 
fitsfile * fitsCreate (std::string filename)
 Creates a FITS file with dummy primary HDU. More...
 
void fitsClose (fitsfile *fptr)
 Closes a fits file referred to by a fitsfile pointer. More...
 
void fitsWriteHDU (fitsfile *fptr, std::string extname, double *src, size_t length=0)
 Writes specific HDU in FITS files. More...
 
void getIndices (size_t i[3], double const tt, double const phi, double const rr) const
 
double interpolate (double tt, double phi, double rr, double *const array) const
 

Private Attributes

double phimin_
 Minimum phi in grid.
 
double phimax_
 Maximum phi in grid.
 
double dphi_
 δφ between two grid columns
 
size_t nphi_
 Grid size in the φ direction.
 
double dr_
 Radius step.
 
size_t nr_
 Grid size in the r direction.
 
double rmin_
 Minimum r in grid.
 
double rmax_
 Maximum r in grid.
 
double dt_
 Time step.
 
size_t nt_
 Grid size in the t direction.
 
double tmin_
 Minimum t in grid.
 
double tmax_
 Maximum t in grid.
 

Detailed Description

Class for reading data stored in a 2D grid.

Member Function Documentation

◆ fitsClose()

void Gyoto::GridData2D::fitsClose ( fitsfile *  fptr)

Closes a fits file referred to by a fitsfile pointer.

Parameters
fptrfitsfile pointer to FITS file to be closed

◆ fitsCreate()

fitsfile* Gyoto::GridData2D::fitsCreate ( std::string  filename)

Creates a FITS file with dummy primary HDU.

Opens a new fits file referred to by a fitsfile pointer and fills the primary HDU by a single pixel equal to 0. Returns the fitsfile pointer to the new FITS file.

Parameters
filenameName of fits file to be created

◆ fitsWriteHDU()

void Gyoto::GridData2D::fitsWriteHDU ( fitsfile *  fptr,
std::string  extname,
double *  src,
size_t  length = 0 
)

Writes specific HDU in FITS files.

Parameters
fptrfitsfile pointer to FITS file
extnameName of extension to be written
srcData to be written in extension
lengthData has shape {nr_,nphi_,nt_} if length is 0 (default; used for storing scalar data), or {nr_,nphi_,nt_,length} if length is not 0 (used for storing vector data, e.g.: length=2 - (v_r, v_phi) - for velocity)

The documentation for this class was generated from the following file: