mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
|
A simple binary file format for storing vectors of data on disk. More...
A simple binary file format for storing vectors of data on disk.
The binVector file format is very simple: the first 8 bytes contain a unit64_t integer which specifies the type of the data. The second 8 bytes contain a uint64_t integer which specifies the length L of the data vector. The remaining L*sizeof(dataT) bytes contain the data.
The suggested extension for BinVector files is ".binv".
Typedefs | |
typedef uint64_t | mx::ioutils::binVTypeT |
The type of binVector type codes. More... | |
Enumerations | |
enum | : binVTypeT |
The pre-defined type codes for binVector. More... | |
Functions | |
template<typename dataT > | |
binVTypeT | mx::ioutils::binVectorTypeCode () |
Get the integer type code corresponding to the type. More... | |
template<typename dataT > | |
int | mx::ioutils::readBinVector (std::vector< dataT > &vec, const std::string &fname) |
Read a BinVector file from disk. More... | |
template<typename dataT > | |
int | mx::ioutils::writeBinVector (const std::string &fname, std::vector< dataT > &vec) |
Write a BinVector file to disk. More... | |
typedef uint64_t mx::ioutils::binVTypeT |
The type of binVector type codes.
Definition at line 62 of file binVector.hpp.
anonymous enum : binVTypeT |
The pre-defined type codes for binVector.
Definition at line 73 of file binVector.hpp.
binVTypeT mx::ioutils::binVectorTypeCode | ( | ) |
Get the integer type code corresponding to the type.
dataT | is the type |
int mx::ioutils::readBinVector | ( | std::vector< dataT > & | vec, |
const std::string & | fname | ||
) |
Read a BinVector file from disk.
[out] | vec | vec is a vector which will be resized and populated. |
[in] | fname | fname is the name (full-path) of the file. |
Definition at line 240 of file binVector.hpp.
Referenced by mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::getGridFreq(), and mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::getGridPSD().
int mx::ioutils::writeBinVector | ( | const std::string & | fname, |
std::vector< dataT > & | vec | ||
) |
Write a BinVector file to disk.
[in] | fname | fname is the name (full-path) of the file. |
[in] | vec | vec is the vector which will be written to disk. |
Definition at line 334 of file binVector.hpp.
Referenced by mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::makePSDGrid().