casacore
|
This class is able to store the combination of ANTENNA1 and ANTENNA2 columns in a compressed manner. More...
#include <AntennaPairFile.h>
Public Member Functions | |
AntennaPairFile () noexcept=default | |
AntennaPairFile (AntennaPairFile &&source) noexcept | |
~AntennaPairFile () noexcept | |
AntennaPairFile & | operator= (AntennaPairFile &&rhs) |
void | WriteAntenna1 (uint64_t row, int32_t antenna1) |
void | WriteAntenna2 (uint64_t row, int32_t antenna2) |
void | WritePair (uint64_t row, int32_t antenna1, int32_t antenna2) |
int32_t | ReadAntenna1 (uint64_t row) |
int32_t | ReadAntenna2 (uint64_t row) |
void | Close () |
const std::string & | Filename () const |
uint64_t | NRowsInPattern () const |
The number of rows that form one repeating pattern. | |
Static Public Member Functions | |
static AntennaPairFile | CreateNew (const std::string &filename) |
Create a new antenna-pair file on disk with the given filename. | |
static AntennaPairFile | OpenExisting (const std::string &filename) |
Open an already existing antenna-pair file from disk with the given filename. | |
Private Member Functions | |
AntennaPairFile (const std::string &filename) | |
Create a new file on disk. | |
AntennaPairFile (const std::string &filename, bool) | |
Open an existing file from disk. | |
template<size_t AntennaNumber> | |
void | WriteAntenna (uint64_t row, int32_t antenna) |
template<size_t AntennaNumber> | |
int32_t | ReadAntenna (uint64_t row) |
void | ReadHeader () |
void | WriteHeader () |
void | ReadData () |
void | WriteData () |
Static Private Member Functions | |
static bool | HasUnsetAntenna (const std::array< int32_t, 2 > &pair) |
Private Attributes | |
BufferedColumnarFile | file_ |
uint64_t | rows_in_pattern_ |
This value remains zero until the repeating pattern was found. | |
std::vector< std::array< int32_t, 2 > > | data_ |
Static Private Attributes | |
static constexpr size_t | kHeaderSize |
The header: char[8] "AntPair\0" uint64_t rows_per_block. | |
static constexpr const char | kMagicHeaderTag [8] |
static constexpr int32_t | kUnsetAntenna |
This class is able to store the combination of ANTENNA1 and ANTENNA2 columns in a compressed manner.
It does this by assuming that the pair of antenna indices are repeated, i.e. every timestep in the measurement set follows the same sequence of baselines. By only writing the repeated sequence once, the storage required is reduce to that of only one timestep.
The class checks to see if the writing satisfies the required constraints, and if they do not an exception is thrown.
Definition at line 24 of file AntennaPairFile.h.
|
defaultnoexcept |
Referenced by CreateNew(), and OpenExisting().
|
inlinenoexcept |
Definition at line 28 of file AntennaPairFile.h.
|
inlinenoexcept |
Definition at line 36 of file AntennaPairFile.h.
References Close().
|
inlineprivate |
Create a new file on disk.
Definition at line 104 of file AntennaPairFile.h.
|
inlineprivate |
Open an existing file from disk.
The last parameter is a dummy parameter to distinguish it from the creating constructor.
Definition at line 112 of file AntennaPairFile.h.
References ReadData(), and ReadHeader().
|
inline |
Definition at line 80 of file AntennaPairFile.h.
References casacore::VarBufferedColumnarFile< BufferSize >::Close(), data_, file_, casacore::VarBufferedColumnarFile< BufferSize >::IsOpen(), rows_in_pattern_, WriteData(), and WriteHeader().
Referenced by operator=(), and ~AntennaPairFile().
|
inlinestatic |
Create a new antenna-pair file on disk with the given filename.
Definition at line 51 of file AntennaPairFile.h.
References AntennaPairFile().
|
inline |
Definition at line 92 of file AntennaPairFile.h.
References file_, and casacore::VarBufferedColumnarFile< BufferSize >::Filename().
|
inlinestaticprivate |
Definition at line 118 of file AntennaPairFile.h.
References kUnsetAntenna.
Referenced by WriteAntenna().
|
inline |
The number of rows that form one repeating pattern.
Function is added for testing purposes.
Definition at line 98 of file AntennaPairFile.h.
References rows_in_pattern_.
|
inlinestatic |
Open an already existing antenna-pair file from disk with the given filename.
Definition at line 59 of file AntennaPairFile.h.
References AntennaPairFile().
|
inline |
Definition at line 38 of file AntennaPairFile.h.
References Close(), data_, file_, and rows_in_pattern_.
|
inlineprivate |
Definition at line 184 of file AntennaPairFile.h.
|
inline |
Definition at line 76 of file AntennaPairFile.h.
Referenced by casacore::AntennaPairStManColumn::getInt().
|
inline |
Definition at line 78 of file AntennaPairFile.h.
Referenced by casacore::AntennaPairStManColumn::getInt().
|
inlineprivate |
Definition at line 220 of file AntennaPairFile.h.
Referenced by AntennaPairFile().
|
inlineprivate |
Definition at line 202 of file AntennaPairFile.h.
Referenced by AntennaPairFile().
|
inlineprivate |
AntennaNumber | Number of the antenna inside the pair: zero or one. |
This row is the same as the first row, so this row is the first row of the next repeated pattern, and we have discovered the size of the pattern.
This is a rewrite of an already written value
Definition at line 126 of file AntennaPairFile.h.
References data_, HasUnsetAntenna(), kUnsetAntenna, rows_in_pattern_, WriteData(), and WriteHeader().
|
inline |
Definition at line 63 of file AntennaPairFile.h.
Referenced by casacore::AntennaPairStManColumn::putInt().
|
inline |
Definition at line 67 of file AntennaPairFile.h.
Referenced by casacore::AntennaPairStManColumn::putInt().
|
inlineprivate |
Note that rows_in_pattern_ might still be zero if the pattern has not been finished. This would happen if MS is partially written, reopened and written further. This is rather unlikely to happen, but it is easy to support.
Definition at line 227 of file AntennaPairFile.h.
Referenced by Close(), and WriteAntenna().
|
inlineprivate |
Definition at line 213 of file AntennaPairFile.h.
Referenced by Close(), and WriteAntenna().
|
inline |
Definition at line 71 of file AntennaPairFile.h.
|
private |
Definition at line 250 of file AntennaPairFile.h.
Referenced by Close(), operator=(), and WriteAntenna().
|
private |
Definition at line 245 of file AntennaPairFile.h.
Referenced by Close(), Filename(), and operator=().
|
staticconstexprprivate |
The header: char[8] "AntPair\0" uint64_t rows_per_block.
Definition at line 242 of file AntennaPairFile.h.
|
staticconstexprprivate |
Definition at line 243 of file AntennaPairFile.h.
|
staticconstexprprivate |
Definition at line 244 of file AntennaPairFile.h.
Referenced by HasUnsetAntenna(), and WriteAntenna().
|
private |
This value remains zero until the repeating pattern was found.
Definition at line 249 of file AntennaPairFile.h.
Referenced by Close(), NRowsInPattern(), operator=(), and WriteAntenna().