1#ifndef CASACORE_STOKES_I_ST_MAN_COLUMN_H_
2#define CASACORE_STOKES_I_ST_MAN_COLUMN_H_
4#include <casacore/tables/DataMan/StManColumn.h>
6#include <casacore/casa/Arrays/Array.h>
7#include <casacore/casa/Arrays/IPosition.h>
31 casacore::DataType
dtype)
42 if (
shape.size() != 2) {
43 throw std::runtime_error(
"StokesIStMan is used for a column with " +
44 std::to_string(
shape.size()) +
45 " dimensions, but it can only be used for "
46 "columns with exactly 2 dimensions");
108 if (
dtype() == casacore::TpBool) {
109 return (
shape_[1] + 7) / 8;
111 const uint64_t type_size = SizeOfType(
dtype());
112 return shape_[1] * type_size;
120 template <
typename T>
124 const size_t n_values =
shape_[1];
130 template <
typename T>
135 const size_t n_values =
shape_[1];
156 parent_.CalculateAndUpdateStride();
Array class for which the type is determined only at runtime.
void freeStorage(const T *&storage, bool deleteIt) const
If deleteIt is set, delete "storage".
void putStorage(T *&storage, bool deleteAndCopy)
putStorage() is normally called after a call to getStorage() (cf).
T * getStorage(bool &deleteIt)
Generally use of this should be shunned, except to use a FORTRAN routine or something similar.
StManColumn(int dataType)
Default constructor.
void putArrayfloatV(casacore::uInt rowNr, const casacore::Array< float > *dataPtr) final
void putArrayDComplexV(casacore::uInt rowNr, const casacore::Array< casacore::DComplex > *dataPtr) final
BufferedColumnarFile & file_
void getArrayGeneric(casacore::uInt rowNr, casacore::Array< T > *dataPtr)
void getArrayfloatV(casacore::uInt rowNr, casacore::Array< float > *dataPtr) final
void getArrayComplexV(casacore::uInt rowNr, casacore::Array< casacore::Complex > *dataPtr) final
Read the values for a particular row.
void setOffset(uint64_t column_offset)
uint64_t getStoredSizeInBytes() const
const casacore::IPosition & shape() const
void putArrayGeneric(casacore::uInt rowNr, const casacore::Array< T > *dataPtr)
StokesIStManColumn(StokesIStMan &parent, BufferedColumnarFile &file, casacore::DataType dtype)
Constructor, to be overloaded by subclass.
void getArrayBoolV(casacore::uInt rowNr, casacore::Array< casacore::Bool > *dataPtr) final
Get the array value in the given row.
casacore::IPosition shape(casacore::rownr_t) final
Get the shape of the item in the given row.
void putArraydoubleV(casacore::uInt rowNr, const casacore::Array< double > *dataPtr) final
void putArrayBoolV(casacore::uInt rowNr, const casacore::Array< casacore::Bool > *dataPtr) final
Put the array value into the given row.
StokesIStManColumn(const StokesIStManColumn &source)=delete
casacore::Bool isWritable() const final
Whether this column is writable.
void operator=(const StokesIStManColumn &source)=delete
void putArrayComplexV(casacore::uInt rowNr, const casacore::Array< casacore::Complex > *dataPtr) final
Write values into a particular row.
void setShapeColumn(const casacore::IPosition &shape) final
Set the dimensions of values in this column.
casacore::IPosition shape(casacore::uInt) final
Get the dimensions of the values in a particular row.
The Stokes I storage manager behaves like a full set of (4) polarizations but only stores the Stokes ...
bool Bool
Define the standard types used by Casacore.
uInt64 rownr_t
Define the type of a row number in a table.
this file contains all the compiler specific defines
T * storage()
If you really, really, need a "raw" pointer to the beginning of the storage area this will give it to...
T * TransformToStokesI(const T *input, T *buffer, size_t n)
Calculates for every set of 4 input values the Stokes-I values by doing out = 0.5 * (in_pp + in_qq),...
VarBufferedColumnarFile< 100 *1024 > BufferedColumnarFile
void ExpandFromStokesI(T *data, size_t n)
Expands n values from single Stokes I values to have 4 values, in place.