#include <Column.h>
Public Methods | |
Column (const Column &right) | |
virtual | ~Column () |
virtual void | readData (long firstRow, long nelements, long firstElem=1)=0 |
int | rows () const |
void | setDisplay () |
virtual void | setDimen () |
int | index () const |
bool | isRead () const |
long | width () const |
size_t | repeat () const |
bool | varLength () const |
double | scale () const |
double | zero () const |
const string& | display () const |
const string& | dimen () const |
ValueType | type () const |
const std::string& | name () const |
const std::string& | unit () const |
const std::string& | format () const |
template<typename S> void | write (const std::vector< S > &indata, long firstRow) |
template<typename S> void | write (const std::valarray< S > &indata, long firstRow) |
template<typename S> void | write (S *indata, long nRows, long firstRow) |
template<typename S> void | write (const std::vector< S > &indata, long firstRow, S *nullValue) |
template<typename S> void | write (const std::valarray< S > &indata, long firstRow, S *nullValue) |
template<typename S> void | write (S *indata, long nRows, long firstRow, S *nullValue) |
template<typename S> void | write (const std::valarray< S > &indata, long nRows, long firstRow) |
template<typename S> void | write (const std::vector< S > &indata, long nRows, long firstRow) |
template<typename S> void | write (S *indata, long nElements, long nRows, long firstRow) |
template<typename S> void | write (const std::valarray< S > &indata, long nRows, long firstRow, S *nullValue) |
template<typename S> void | write (const std::vector< S > &indata, long nRows, long firstRow, S *nullValue) |
template<typename S> void | write (S *indata, long nElements, long nRows, long firstRow, S *nullValue) |
template<typename S> void | write (const std::valarray< S > &indata, const std::vector< long > &vectorLengths, long firstRow) |
template<typename S> void | write (const std::vector< S > &indata, const std::vector< long > &vectorLengths, long firstRow) |
template<typename S> void | write (S *indata, long nElements, const std::vector< long > &vectorLengths, long firstRow) |
template<typename S> void | writeArrays (const std::vector< std::valarray< S > > &indata, long firstRow) |
template<typename S> void | writeArrays (const std::vector< std::valarray< S > > &indata, long firstRow, S *nullValue) |
template<typename S> void | read (std::vector< S > &vals, long first, long last) |
template<typename S> void | read (std::valarray< S > &vals, long first, long last) |
template<typename S> void | read (std::valarray< S > &vals, long rows) |
template<typename S> void | readArrays (std::vector< std::valarray< S > > &vals, long first, long last) |
template<typename S> void | read (std::vector< S > &vals, long first, long last, S *nullValue) |
template<typename S> void | read (std::valarray< S > &vals, long first, long last, S *nullValue) |
template<typename S> void | read (std::valarray< S > &vals, long rows, S *nullValue) |
template<typename S> void | readArrays (std::vector< std::valarray< S > > &vals, long first, long last, S *nullValue) |
template<typename T> void | addNullValue (T nullVal) |
Protected Methods | |
Column (int columnIndex, const string &columnName, ValueType type, const string &format, const string &unit, Table *p, int rpt=1, long w=1, const string &comment="") | |
Column (Table *p=0) | |
fitsfile* | fitsPointer () |
void | makeHDUCurrent () |
virtual std::ostream& | put (std::ostream &s) const |
const std::string& | comment () const |
Columns are the data containers used in FITS tables. Columns of scalar type (one entry per cell) are implemented by the template subclass ColumnData<T>. Columns of vector type (vector and variable rows) are implemented with the template subclass ColumnVectorData<T>. AsciiTables may only contain Columns of type ColumnData<T>, where T is an implemented FITS data type (see the CCfits.h header for a complete list. This requirement is enforced by ensuring that AsciiTable's addColumn method may only create an AsciiTable compatible column. The ColumnData<T> class stores its data in a std::vector<T> object.
BinTables may contain either ColumnData<T> or ColumnVectorData<T>. For ColumnVectorData, T must be a numeric type: string vectors are handled by ColumnData<T>; string arrays are not supported. The internal representation of the data is a std::vector<std::valarray<T> > object. The std::valarray class is designed for efficient numeric processing and has many vectorized numeric and transcendental functions defined on it.
Member template functions for read/write operations are provided in multiple overloads as the interface to data operations. Implicit data type conversions are supported but where they are required make the operations less efficient. Reading numeric column data as character arrays, supported by cfitsio, is not supported by CCfits.
As a base class, Column provides protected accessor/mutator inline functions to allow only its subclasses to access data members.
|
copy constructor, used in copying Columns to standard library containers.
The copy constructor is for internal use only: it does not affect the disk fits file associated with the object. |
|
destructor.
|
|
new column creation constructor.
This constructor allows the specification of:
|
|
Simple constructor to be called by subclass reading ctors.
|
|
Set the TNULLn keyword for the column.
Only relevant for integer valued columns, TNULLn is the value used by cfitsio in undefined processing. All entries in the table equal to an input "null value" are set equal to the value of TNULLn. (For floating point columns a system NaN values is used). |
|
retrieve comment for Column.
|
|
return TDIMn keyword.
represents dimensions of data arrays in vector columns. for scalar columns, returns a default value. |
|
return TDISPn keyword.
TDISPn is suggested format for output of column data. |
|
fits pointer corresponding to fits file containing column data.
|
|
return TFORMn keyword.
TFORMn specifies data format stored in disk file. |
|
get the Column index (the n in TTYPEn etc).
|
|
flag set to true if the entire column data has been read from disk.
|
|
make HDU containing this the current HDU of the fits file.
|
|
return name of Column (TTYPEn keyword).
|
|
internal implementation of << operator.
|
|
return a single row of a vector column into a std::valarray, setting undefined values.
|
|
Retrieve data from a scalar column into a std::valarray, setting undefined values.
|
|
Retrieve data from a scalar column into a std::vector, setting nullvalue.
As above, only a pointer to a null value is also recognized. If the column is of integer type, then any column value that equals this null value is set equal to the value of the TNULLn keyword. An exception is thrown if TNULLn is not specified. See cfitsio documentation for further details
|
|
return a single row of a vector column into a std::valarray.
|
|
Retrieve data from a scalar column into a std::valarray.
|
|
Retrieve data from a scalar column into a std::vector.
This and the following functions perform implicit data conversions. An exception will be thrown if no conversion exists.
|
|
return a set of rows of a vector column into a container, setting undefined values.
|
|
return a set of rows of a vector column into a vector of valarrays.
|
|
read method.
|
|
get the repeat count for the rows.
|
|
return number of rows in the Column.
|
|
get TSCALn value.
TSCALn is used to convert a data array represented on disk in integer format as floating. Useful for compact storage of digitized data. |
|
set the TDIMn keyword.
|
|
set the TDISPn keyword.
|
|
returns the data type of the column.
|
|
get units of data in Column (TUNITn keyword).
|
|
boolean, set to true if Column has variable length vector rows.
|
|
return column data width.
|
|
write a C-array of values of size nElements into a column with specified number of entries written per row.
|
|
write a vector of values into a column with specified number of entries written per row.
|
|
write a valarray of values into a column with specified number of entries written per row.
Data are written into vectorLengths.size() rows, with vectorLength[n] elements written to row n+firstRow -1. Although clearly designed for wrapping calls to multiple variable-width vector column rows, the code is written to write a variable number of elements to fixed-width column rows (cfitsio requires these operations to be done on a row-by-row basis). Since cfitsio does not support null value processing for variable width columns this function and its variants do not have version which process undefined values
|
|
write a C array of values into a range of rows of a vector column, processing undefined values.
|
|
write a vector of values into a range of rows of a vector column, processing undefined values.
see valarray version for details. |
|
write a valarray of values into a range of rows of a vector column.
see version without undefined processing for details. |
|
write a C array of values into a range of rows of a vector column.
Details are as for vector input; only difference is the need to supply the size of the C-array.
|
|
write a vector of values into a range of rows of a vector column.
see valarray version for details. |
|
write a valarray of values into a range of rows of a vector column.
This and the equivalent vector version write a vector of values into nRows. The primary use of this is for fixed width columns, in which case Column's repeat attribute is used to determine how many elements are written to each row; if indata.size() is too small an exception will be thrown. If the column is variable width, the call will write indata.size()/nRows elements to each row.
|
|
write a C array into a scalar Column, processing undefined values.
|
|
write a valarray of values into a scalar column starting with firstRow with undefined values set to nullValue.
|
|
write a vector of values into a row starting with firstRow with undefined values set to nullValue.
|
|
write a C array of size nRows into a scalar Column starting with row firstRow.
|
|
write a valarray of values into a scalar column starting with firstRow.
|
|
write a vector of values into a row starting with firstRow.
|
|
write a vector of valarray objects to the column, starting at row firstRow >= 1, processing undefined values.
|
|
write a vector of valarray objects to the column, starting at row firstRow >= 1.
|
|
get TZEROn value.
TZEROn is an integer offset used in the implementation of unsigned data |