fits2idia
FITS to HDF5 (IDIA schema) converter
Util.h File Reference
#include "common.h"
Include dependency graph for Util.h:
This graph shows which files directly or indirectly include this file:

Functions

std::vector< std::string > split (const std::string &str, char separator)
 
std::vector< hsize_t > trimAxes (const std::vector< hsize_t > &dims, int N)
 
std::vector< hsize_t > extend (const std::vector< hsize_t > &left, const std::vector< hsize_t > &right)
 
std::vector< hsize_t > mipDims (const std::vector< hsize_t > &dims, int mipXY, int mipZ)
 
hsize_t product (const std::vector< hsize_t > &dims)
 
template<typename T >
std::ostream & operator<< (std::ostream &out, const std::vector< T > &v)
 
bool useChunks (const std::vector< hsize_t > &dims)
 
void openFitsFile (fitsfile **filePtrPtr, const std::string &fileName)
 
void closeFitsFile (fitsfile *filePtr)
 
void getFitsDims (fitsfile *filePtr, int &N, long *dims)
 
void readFitsHeader (fitsfile *filePtr, int &numAttributes)
 
void readFitsAttribute (fitsfile *filePtr, int i, std::string &name, std::string &value)
 
void readFitsStringAttribute (fitsfile *filePtr, const std::string &name, std::string &value)
 
void readFitsData (fitsfile *filePtr, hsize_t channel, unsigned int stokes, hsize_t size, float *destination)
 
bool hdf5Exists (H5::H5Location &location, const std::string &name)
 
void createHdf5Dataset (H5::DataSet &dataset, H5::Group group, std::string path, H5::DataType dataType, std::vector< hsize_t > dims, const std::vector< hsize_t > &chunkDims=EMPTY_DIMS)
 
void writeHdf5Attribute (H5::Group group, std::string name, std::string value)
 
void writeHdf5Attribute (H5::Group group, std::string name, int64_t value)
 
void writeHdf5Attribute (H5::Group group, std::string name, double value)
 
void writeHdf5Attribute (H5::Group group, std::string name, bool value)
 
void writeHdf5Data (H5::DataSet &dataset, float *data, const std::vector< hsize_t > &dims, const std::vector< hsize_t > &count=EMPTY_DIMS, const std::vector< hsize_t > &start=EMPTY_DIMS)
 
void writeHdf5Data (H5::DataSet &dataset, double *data, const std::vector< hsize_t > &dims, const std::vector< hsize_t > &count=EMPTY_DIMS, const std::vector< hsize_t > &start=EMPTY_DIMS)
 
void writeHdf5Data (H5::DataSet &dataset, int64_t *data, const std::vector< hsize_t > &dims, const std::vector< hsize_t > &count=EMPTY_DIMS, const std::vector< hsize_t > &start=EMPTY_DIMS)
 
void readHdf5Data (H5::DataSet &dataset, float *data, const std::vector< hsize_t > &dims, const std::vector< hsize_t > &count=EMPTY_DIMS, const std::vector< hsize_t > &start=EMPTY_DIMS)
 

Function Documentation

◆ closeFitsFile()

void closeFitsFile ( fitsfile *  filePtr)
Here is the caller graph for this function:

◆ createHdf5Dataset()

void createHdf5Dataset ( H5::DataSet &  dataset,
H5::Group  group,
std::string  path,
H5::DataType  dataType,
std::vector< hsize_t >  dims,
const std::vector< hsize_t > &  chunkDims = EMPTY_DIMS 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ extend()

std::vector<hsize_t> extend ( const std::vector< hsize_t > &  left,
const std::vector< hsize_t > &  right 
)
Here is the caller graph for this function:

◆ getFitsDims()

void getFitsDims ( fitsfile *  filePtr,
int &  N,
long *  dims 
)
Here is the caller graph for this function:

◆ hdf5Exists()

bool hdf5Exists ( H5::H5Location &  location,
const std::string &  name 
)
Here is the caller graph for this function:

◆ mipDims()

std::vector<hsize_t> mipDims ( const std::vector< hsize_t > &  dims,
int  mipXY,
int  mipZ 
)
Here is the caller graph for this function:

◆ openFitsFile()

void openFitsFile ( fitsfile **  filePtrPtr,
const std::string &  fileName 
)
Here is the caller graph for this function:

◆ operator<<()

template<typename T >
std::ostream& operator<< ( std::ostream &  out,
const std::vector< T > &  v 
)

◆ product()

hsize_t product ( const std::vector< hsize_t > &  dims)
Here is the caller graph for this function:

◆ readFitsAttribute()

void readFitsAttribute ( fitsfile *  filePtr,
int  i,
std::string &  name,
std::string &  value 
)
Here is the caller graph for this function:

◆ readFitsData()

void readFitsData ( fitsfile *  filePtr,
hsize_t  channel,
unsigned int  stokes,
hsize_t  size,
float *  destination 
)
Here is the caller graph for this function:

◆ readFitsHeader()

void readFitsHeader ( fitsfile *  filePtr,
int &  numAttributes 
)
Here is the caller graph for this function:

◆ readFitsStringAttribute()

void readFitsStringAttribute ( fitsfile *  filePtr,
const std::string &  name,
std::string &  value 
)
Here is the caller graph for this function:

◆ readHdf5Data()

void readHdf5Data ( H5::DataSet &  dataset,
float *  data,
const std::vector< hsize_t > &  dims,
const std::vector< hsize_t > &  count = EMPTY_DIMS,
const std::vector< hsize_t > &  start = EMPTY_DIMS 
)
Here is the caller graph for this function:

◆ split()

std::vector<std::string> split ( const std::string &  str,
char  separator 
)
Here is the caller graph for this function:

◆ trimAxes()

std::vector<hsize_t> trimAxes ( const std::vector< hsize_t > &  dims,
int  N 
)
Here is the caller graph for this function:

◆ useChunks()

bool useChunks ( const std::vector< hsize_t > &  dims)
Here is the caller graph for this function:

◆ writeHdf5Attribute() [1/4]

void writeHdf5Attribute ( H5::Group  group,
std::string  name,
bool  value 
)

◆ writeHdf5Attribute() [2/4]

void writeHdf5Attribute ( H5::Group  group,
std::string  name,
double  value 
)

◆ writeHdf5Attribute() [3/4]

void writeHdf5Attribute ( H5::Group  group,
std::string  name,
int64_t  value 
)

◆ writeHdf5Attribute() [4/4]

void writeHdf5Attribute ( H5::Group  group,
std::string  name,
std::string  value 
)
Here is the caller graph for this function:

◆ writeHdf5Data() [1/3]

void writeHdf5Data ( H5::DataSet &  dataset,
double *  data,
const std::vector< hsize_t > &  dims,
const std::vector< hsize_t > &  count = EMPTY_DIMS,
const std::vector< hsize_t > &  start = EMPTY_DIMS 
)

◆ writeHdf5Data() [2/3]

void writeHdf5Data ( H5::DataSet &  dataset,
float *  data,
const std::vector< hsize_t > &  dims,
const std::vector< hsize_t > &  count = EMPTY_DIMS,
const std::vector< hsize_t > &  start = EMPTY_DIMS 
)
Here is the caller graph for this function:

◆ writeHdf5Data() [3/3]

void writeHdf5Data ( H5::DataSet &  dataset,
int64_t *  data,
const std::vector< hsize_t > &  dims,
const std::vector< hsize_t > &  count = EMPTY_DIMS,
const std::vector< hsize_t > &  start = EMPTY_DIMS 
)