Gyoto
Public Member Functions | List of all members
Gyoto::FitsRW Class Reference

Class for reading or writing data in FITS file. The data stored should be 1D array(s). More...

#include <GyotoFitsRW.h>

Inheritance diagram for Gyoto::FitsRW:
Gyoto::Astrobj::Plasmoid Gyoto::Astrobj::SimBridge Gyoto::Astrobj::SimThickDisk Gyoto::Astrobj::SimThinDisk

Public Member Functions

 FitsRW ()
 Constructor.
 
 FitsRW (const FitsRW &)
 Copy constructor.
 
virtual FitsRWclone () const
 
virtual ~FitsRW ()
 Destructor.
 
fitsfile * fitsCreate (std::string const filename) const
 Creates a FITS file with dummy primary HDU. More...
 
fitsfile * fitsOpen (std::string const filename) const
 Open a fits file. More...
 
void fitsClose (fitsfile *fptr) const
 Closes a fits file referred to by a fitsfile pointer. More...
 
void fitsWriteHDUData (fitsfile *const fptr, std::string const extname, double *const src, long const nelements) const
 Writes 1D array in FITS files. More...
 
void fitsWriteKey (fitsfile *const fptr, std::string const key, double value, std::string const hdu="PRIMARY") const
 Writes a key in the header of a given HDU (by default "PRIMARY") More...
 
double * fitsReadHDUData (fitsfile *const fptr, std::string const extname, double *dest, long expectedSize) const
 Read 1D array in FITS files. More...
 
double fitsReadKey (fitsfile *const fptr, std::string const key, std::string const hdu) const
 Read a specific key of the HDU with a specific 'extname'. More...
 
double fitsReadKey (fitsfile *const fptr, std::string const key, int const hdu_num=1) const
 Read a specific key of the HDU defined by its number (by default 1 equivalent ot the "PRIMARY" HDU) More...
 

Detailed Description

Class for reading or writing data in FITS file. The data stored should be 1D array(s).

Member Function Documentation

◆ fitsClose()

void Gyoto::FitsRW::fitsClose ( fitsfile *  fptr) const

Closes a fits file referred to by a fitsfile pointer.

Parameters
fptrfitsfile pointer to FITS file to be closed

◆ fitsCreate()

fitsfile* Gyoto::FitsRW::fitsCreate ( std::string const  filename) const

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

◆ fitsOpen()

fitsfile* Gyoto::FitsRW::fitsOpen ( std::string const  filename) const

Open a fits file.

Parameters
filenamename of the FITS file to be open

◆ fitsReadHDUData()

double* Gyoto::FitsRW::fitsReadHDUData ( fitsfile *const  fptr,
std::string const  extname,
double *  dest,
long  expectedSize 
) const

Read 1D array in FITS files.

Parameters
fptrfitsfile pointer to FITS file
extnameName of extension to be read

◆ fitsReadKey() [1/2]

double Gyoto::FitsRW::fitsReadKey ( fitsfile *const  fptr,
std::string const  key,
std::string const  hdu 
) const

Read a specific key of the HDU with a specific 'extname'.

Parameters
fptrfitsfile pointer to FITS file
keyName of the key to be read
hduHDU extname where to search for the key

◆ fitsReadKey() [2/2]

double Gyoto::FitsRW::fitsReadKey ( fitsfile *const  fptr,
std::string const  key,
int const  hdu_num = 1 
) const

Read a specific key of the HDU defined by its number (by default 1 equivalent ot the "PRIMARY" HDU)

Parameters
fptrfitsfile pointer to FITS file
keyName of the key to be read
hdu_numHDU number where to search for the key

◆ fitsWriteHDUData()

void Gyoto::FitsRW::fitsWriteHDUData ( fitsfile *const  fptr,
std::string const  extname,
double *const  src,
long const  nelements 
) const

Writes 1D array in FITS files.

Parameters
fptrfitsfile pointer to FITS file
extnameName of extension to be written
srcData to be written in extension
ndimnumer of axes of src
lenof each axes

◆ fitsWriteKey()

void Gyoto::FitsRW::fitsWriteKey ( fitsfile *const  fptr,
std::string const  key,
double  value,
std::string const  hdu = "PRIMARY" 
) const

Writes a key in the header of a given HDU (by default "PRIMARY")

Parameters
fptrfitsfile pointer to FITS file
keyName of the key to be stored
valueValue of the key to be stored
hduHDU where to store the key, by default "PRIMARY"

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