28 #ifndef TABLES_COMPRESSFLOAT_H
29 #define TABLES_COMPRESSFLOAT_H
32 #include <casacore/casa/aips.h>
33 #include <casacore/tables/DataMan/BaseMappedArrayEngine.h>
34 #include <casacore/tables/Tables/ScalarColumn.h>
35 #include <casacore/casa/Arrays/Array.h>
149 const String& storedColumnName,
164 const String& storedColumnName,
165 const String& scaleColumnName,
166 const String& offsetColumnName,
Float getOffset(rownr_t rownr)
Get the offset value for this row.
virtual Record dataManagerSpec() const
Record a record containing data manager specifications.
virtual void getArray(rownr_t rownr, Array< Float > &array)
Get an array in the given row.
virtual void getColumnSlice(const Slicer &slicer, Array< Float > &array)
Get a section of all arrays in the column.
Float getScale(rownr_t rownr)
Get the scale value for this row.
virtual void getArrayColumn(Array< Float > &array)
Get an entire column.
CompressFloat(const String &virtualColumnName, const String &storedColumnName, const String &scaleColumnName, const String &offsetColumnName, Bool autoScale=True)
Construct an engine to scale the arrays in a column.
static DataManager * makeObject(const String &dataManagerType, const Record &spec)
Define the "constructor" to construct this engine when a table is read back.
virtual void getSlice(rownr_t rownr, const Slicer &slicer, Array< Float > &array)
Get a section of the array in the given row.
CompressFloat(const CompressFloat &)
Copy constructor is only used by clone().
virtual void reopenRW()
Reopen the engine for read/write access.
void findMinMax(Float &minVal, Float &maxVal, const Array< Float > &array) const
Find minimum and maximum from the array data.
void scaleColumnOnGet(Array< Float > &array, const Array< Short > &target)
Scale and/or offset target to array for the entire column.
virtual void putSlice(rownr_t rownr, const Slicer &slicer, const Array< Float > &array)
Put into a section of the array in the given row.
ScalarColumn< Float > * scaleColumn_p
ScalarColumn< Float > * offsetColumn_p
static String className()
Return the name of the class.
virtual void putArray(rownr_t rownr, const Array< Float > &array)
Put an array in the given row.
virtual DataManager * clone() const
Clone the engine object.
virtual void prepare()
Preparing consists of setting the writable switch and adding the initial number of rows in case of cr...
void scaleColumnOnPut(const Array< Float > &array, Array< Short > &target)
Scale and/or offset array to target for the entire column.
~CompressFloat()
Destructor is mandatory.
void scaleOnPut(Float scale, Float offset, const Array< Float > &array, Array< Short > &target)
Scale and/or offset array to target.
virtual void putColumnSliceCells(const RefRows &rownrs, const Slicer &slicer, const Array< Float > &data)
Put into a section of some arrays in the column.
void putFullPart(rownr_t rownr, const Slicer &slicer, Array< Float > &fullArray, const Array< Float > &partArray, Float minVal, Float maxVal)
Fill the array part into the full array and put it using the given min/max values.
static void registerClass()
Register the class name and the static makeObject "constructor".
virtual String dataManagerName() const
Get the name given to the engine (is the virtual column name).
virtual void getArrayColumnCells(const RefRows &rownrs, Array< Float > &data)
Get some array values in the column.
void putPart(rownr_t rownr, const Slicer &slicer, const Array< Float > &array, Float scale, Float offset)
Put a part of an array in a row using given scale/offset values.
virtual void putArrayColumnCells(const RefRows &rownrs, const Array< Float > &data)
Put some array values in the column.
CompressFloat(const String &virtualColumnName, const String &storedColumnName, Float scale, Float offset=0)
Construct an engine to scale all arrays in a column with the given offset and scale factor.
virtual void putArrayColumn(const Array< Float > &array)
Put an entire column.
virtual void putColumnSlice(const Slicer &slicer, const Array< Float > &array)
Put a section of all arrays in the column.
virtual void addRowInit(rownr_t startRow, rownr_t nrrow)
Add rows to the table.
virtual void getColumnSliceCells(const RefRows &rownrs, const Slicer &slicer, Array< Float > &data)
Get a section of some arrays in the column.
virtual void create64(rownr_t initialNrrow)
Initialize the object for a new table.
void scaleOnGet(Float scale, Float offset, Array< Float > &array, const Array< Short > &target)
Scale and/or offset target to array.
void makeScaleOffset(Float &scale, Float &offset, Float minVal, Float maxVal) const
Make scale and offset from the minimum and maximum of the array data.
virtual String dataManagerType() const
Return the type name of the engine (i.e.
CompressFloat(const Record &spec)
Construct from a record specification as created by getmanagerSpec().
CompressFloat & operator=(const CompressFloat &)
Assignment is not needed and therefore forbidden (so it is made private and not implemented).
Abstract base class for a data manager.
String: the storage and methods of handling collections of characters.
this file contains all the compiler specific defines
TableExprNode array(const TableExprNode &values, const TableExprNodeSet &shape)
Create an array of the given shape and fill it with the values.
bool Bool
Define the standard types used by Casacore.
uInt64 rownr_t
Define the type of a row number in a table.