|
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".
Namespaces | |
| namespace | mx::ioutils::binVTypes |
| Namespace fo the bin-vector type-codes. | |
Typedefs | |
| typedef uint64_t | mx::ioutils::binVTypeT |
| The type of binVector type codes. | |
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. | |
| template<typename dataT > | |
| int | mx::ioutils::readBinVector (std::vector< dataT > &vec, const std::string &fname) |
| Read a BinVector file from disk. | |
| template<typename dataT > | |
| int | mx::ioutils::writeBinVector (const std::string &fname, std::vector< dataT > &vec) |
| Write a BinVector file to disk. | |
| 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 241 of file binVector.hpp.
References MXE_FILERERR, MXE_SIZEERR, mxError, and mxPError.
Referenced by mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::getGridFreq(), mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::getGridPSD(), and mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::intensityPSD().
| 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 336 of file binVector.hpp.
References mxPError.
Referenced by mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::analyzePSDGrid(), and mx::AO::analysis::fourierTemporalPSD< _realT, aosysT >::makePSDGrid().