18 #include "FitsError.h" 837 RangeError (
const String& msg,
bool silent =
true);
885 UnspecifiedLengths (
const String& diag,
bool silent =
true);
921 NoNullValue (
const String& diag,
bool silent =
true);
941 bool operator==(
const Column &right)
const;
943 bool operator!=(
const Column &right)
const;
945 virtual void readData (
long firstRow,
long nelements,
long firstElem = 1) = 0;
947 virtual Column * clone ()
const = 0;
951 friend std::ostream& operator << (std::ostream& s,
const Column& right);
954 friend bool operator < (
const Column& left,
const Column& right);
956 friend bool operator > (
const Column& left,
const Column& right);
958 void unit (
const String& value);
961 void index (
int value);
965 void width (
long value);
968 double scale ()
const;
969 void scale (
double value);
970 double zero ()
const;
971 void zero (
double value);
972 const String&
display ()
const;
973 const String&
dimen ()
const;
974 void dimen (
const String& value);
977 static const String& TFORM ();
978 static const String& TDISP ();
979 static const String& TSCAL ();
980 static const String& TZERO ();
981 static const String& TDIM ();
982 const String&
format ()
const;
983 const String&
unit ()
const;
984 const String&
name ()
const;
993 template <
typename S>
994 void write (
const std::vector<S>& indata,
long firstRow);
996 void write (
const std::vector<std::complex<float> >& indata,
long firstRow);
998 void write (
const std::vector<std::complex<double> >& indata,
long firstRow);
1000 template <
typename S>
1001 void write (
const std::valarray<S>& indata,
long firstRow);
1003 void write (
const std::valarray<std::complex<float> >& indata,
long firstRow);
1005 void write (
const std::valarray<std::complex<double> >& indata,
long firstRow);
1007 template <
typename S>
1008 void write (S* indata,
long nRows,
long firstRow);
1011 template <
typename S>
1012 void write (
const std::vector<S>& indata,
long firstRow, S* nullValue);
1014 template <
typename S>
1015 void write (
const std::valarray<S>& indata,
long firstRow, S* nullValue);
1017 template <
typename S>
1018 void write (S* indata,
long nRows,
long firstRow, S* nullValue);
1028 template <
typename S>
1029 void write (
const std::valarray<S>& indata,
long nRows,
long firstRow);
1031 void write (
const std::valarray<std::complex<float> >& indata,
long nRows,
long firstRow);
1033 void write (
const std::valarray<std::complex<double> >& indata,
long nRows,
long firstRow);
1036 template <
typename S>
1037 void write (
const std::vector<S>& indata,
long nRows,
long firstRow);
1039 void write (
const std::vector<std::complex<float> >& indata,
long nRows,
long firstRow);
1041 void write (
const std::vector<std::complex<double> >& indata,
long nRows,
long firstRow);
1045 template <
typename S>
1046 void write (S* indata,
long nElements,
long nRows,
long firstRow);
1049 template <
typename S>
1050 void write (
const std::valarray<S>& indata,
long nRows,
long firstRow, S* nullValue);
1053 template <
typename S>
1054 void write (
const std::vector<S>& indata,
long nRows,
long firstRow, S* nullValue);
1056 template <
typename S>
1057 void write (S* indata,
long nElements,
long nRows,
long firstRow, S* nullValue);
1061 template <
typename S>
1062 void write (
const std::valarray<S>& indata,
1063 const std::vector<long>& vectorLengths,
1066 void write (
const std::valarray<std::complex<float> >& indata,
1067 const std::vector<long>& vectorLengths,
1070 void write (
const std::valarray<std::complex<double> >& indata,
1071 const std::vector<long>& vectorLengths,
1074 template <
typename S>
1075 void write (
const std::vector<S>& indata,
1076 const std::vector<long>& vectorLengths,
1081 void write (
const std::vector<std::complex<float> >& indata,
1082 const std::vector<long>& vectorLengths,
1085 void write (
const std::vector<std::complex<double> >& indata,
1086 const std::vector<long>& vectorLengths,
1089 template <
typename S>
1090 void write (S* indata,
long nElements,
1091 const std::vector<long>& vectorLengths,
1094 template <
typename S>
1095 void writeArrays (
const std::vector<std::valarray<S> >& indata,
long firstRow);
1097 void writeArrays (
const std::vector<std::valarray<std::complex<float> > >& indata,
long firstRow);
1099 void writeArrays (
const std::vector<std::valarray<std::complex<double> > >& indata,
long firstRow);
1101 template <
typename S>
1102 void writeArrays (
const std::vector<std::valarray<S> >& indata,
long firstRow, S* nullValue);
1108 template <
typename S>
1109 void read(std::vector<S>& vals,
long first,
long last) ;
1112 void read(std::vector< std::complex<float> >& ,
long first,
long last);
1114 void read(std::vector< std::complex<double> >& ,
long first,
long last);
1116 void read(std::vector<String>& vals,
long first,
long last);
1119 template <
typename S>
1120 void read(std::valarray<S>& vals,
long first,
long last) ;
1122 void read(std::valarray<std::complex<float> >& vals,
long first,
long last) ;
1124 void read(std::valarray<std::complex<double> >& vals,
long first,
long last) ;
1127 template <
typename S>
1128 void read(std::valarray<S>& vals,
long rows) ;
1130 void read(std::valarray<std::complex<float> >& vals,
long rows) ;
1132 void read(std::valarray<std::complex<double> >& vals,
long rows) ;
1135 template <
typename S>
1136 void readArrays(std::vector<std::valarray<S> >& vals,
long first,
long last) ;
1138 void readArrays(std::vector<std::valarray<std::complex<float> > >& vals,
long first,
long last) ;
1140 void readArrays(std::vector<std::valarray<std::complex<double> > >& vals,
long first,
long last) ;
1146 template <
typename S>
1147 void read(std::vector<S>& vals,
long first,
long last, S* nullValue) ;
1150 template <
typename S>
1151 void read(std::valarray<S>& vals,
long first,
long last, S* nullValue);
1154 template <
typename S>
1155 void read(std::valarray<S>& vals,
long rows, S* nullValue) ;
1158 template <
typename S>
1159 void readArrays(std::vector<std::valarray<S> >& vals,
long first,
long last, S* nullValue);
1162 template <
typename T>
1166 template <
typename T>
1169 void write (
const std::vector<String>& indata,
long firstRow);
1177 friend void Table::initRead();
1179 friend void Table::reindex();
1181 friend void Table::copyData(
const Table& right);
1184 const String &columnName,
1188 int rpt = 1,
long w = 1,
const String &
comment =
"");
1191 virtual bool compare (
const Column &right)
const;
1197 virtual std::ostream&
put (std::ostream& s)
const;
1199 static const String& TBCOL ();
1200 static const String& TTYPE ();
1201 static const String& TUNIT ();
1202 static const String& TNULL ();
1203 static const String& TLMIN ();
1204 static const String& TLMAX ();
1205 static const String& TDMAX ();
1206 static const String& TDMIN ();
1207 static const std::vector<String>& columnKeys ();
1208 const String&
comment ()
const;
1216 virtual void insertRows (
long first,
long number = 1) = 0;
1217 virtual void deleteRows (
long first,
long number = 1) = 0;
1218 static void loadColumnKeys ();
1219 void name (
const String& value);
1220 void format (
const String& value);
1221 long numberOfElements (
long& first,
long& last);
1224 static const String s_TBCOL;
1225 static const String s_TTYPE;
1226 static const String s_TFORM;
1227 static const String s_TDISP;
1228 static const String s_TUNIT;
1229 static const String s_TSCAL;
1230 static const String s_TZERO;
1231 static const String s_TDIM;
1232 static const String s_TNULL;
1233 static const String s_TLMIN;
1234 static const String s_TLMAX;
1235 static const String s_TDMAX;
1236 static const String s_TDMIN;
1252 static const short LLIMITSHORT;
1253 static const long LLIMITLONG;
1254 static const unsigned short LLIMITUSHORT;
1255 static const unsigned long LLIMITULONG;
1256 static const unsigned char LLIMITUCHAR;
1257 static const float LLIMITFLOAT;
1258 static const double LLIMITDOUBLE;
1259 static const short ULIMITSHORT;
1260 static const long ULIMITLONG;
1261 static const unsigned short ULIMITUSHORT;
1262 static const unsigned long ULIMITULONG;
1263 static const unsigned char ULIMITUCHAR;
1264 static const float ULIMITFLOAT;
1265 static const double ULIMITDOUBLE;
1266 static const int LLIMITINT;
1267 static const int ULIMITINT;
1268 static const unsigned int LLIMITUINT;
1269 static const unsigned int ULIMITUINT;
1270 static const LONGLONG LLIMITLONGLONG;
1271 static const LONGLONG ULIMITLONGLONG;
1275 static std::vector<String> s_columnKeys;
1310 inline std::ostream& operator << (std::ostream& s,
const Column& right)
1313 return right.
put(s);
1316 inline bool operator < (
const Column& left,
const Column& right)
1319 return left.m_index < right.m_index;
1322 inline bool operator > (
const Column& left,
const Column& right)
1325 return left.m_index > right.m_index;
1420 inline const String& Column::TBCOL ()
1425 inline const String& Column::TTYPE ()
1430 inline const String& Column::TFORM ()
1435 inline const String& Column::TDISP ()
1440 inline const String& Column::TUNIT ()
1445 inline const String& Column::TSCAL ()
1450 inline const String& Column::TZERO ()
1455 inline const String& Column::TDIM ()
1460 inline const String& Column::TNULL ()
1465 inline const String& Column::TLMIN ()
1470 inline const String& Column::TLMAX ()
1475 inline const String& Column::TDMAX ()
1480 inline const String& Column::TDMIN ()
1485 inline const std::vector<String>& Column::columnKeys ()
1487 return s_columnKeys;
virtual ~Column()
destructor.
Definition: Column.cxx:234
Exception thrown if a null value is specified without support from existing column header...
Definition: Column.h:918
const String & name() const
return name of Column (TTYPEn keyword)
Definition: Column.h:1505
Exception thrown for invalid data type inputs.
Definition: Column.h:846
size_t repeat() const
get the repeat count for the rows
Definition: Column.h:1363
fitsfile * fitsPointer()
fits pointer corresponding to fits file containing column data.
Definition: Column.cxx:264
int rows() const
return the number of rows in the table.
Definition: Column.cxx:275
long width() const
return column data width
Definition: Column.h:1353
void resetRead()
reset the Column's isRead flag to false
Definition: Column.h:1328
void makeHDUCurrent()
make HDU containing this the current HDU of the fits file.
Definition: Column.cxx:270
bool getNullValue(T *nullVal) const
Get the value of the TNULLn keyword for the column.
Definition: ColumnT.h:1363
FitsError is the exception thrown by non-zero cfitsio status codes.
Definition: FitsError.h:112
const String & display() const
return TDISPn keyword
Definition: Column.h:1395
void write(const std::vector< S > &indata, long firstRow)
write a vector of values into a scalar column starting with firstRow
Definition: ColumnT.h:711
Exception thrown if user enters a non-positive number for the number of rows to write.
Definition: Column.h:930
RangeError(const String &msg, bool silent=true)
Exception ctor, prefixes the string "FitsError: Range error in operation " before the specific messag...
Definition: Column.cxx:43
Exception thrown if the data supplied for a write operation is less than declared.
Definition: Column.h:906
const String & dimen() const
return TDIMn keyword
Definition: Column.h:1400
double scale() const
get TSCALn value
Definition: Column.h:1373
void read(std::vector< S > &vals, long first, long last)
Retrieve data from a scalar column into a std::vector.
Definition: ColumnT.h:42
bool isRead() const
flag set to true if the entire column data has been read from disk
Definition: Column.h:1343
exception to be thrown for inputs that cause range errors in column read operations.
Definition: Column.h:834
virtual std::ostream & put(std::ostream &s) const
internal implementation of << operator.
Definition: Column.cxx:302
double zero() const
get TZEROn value
Definition: Column.h:1385
void readArrays(std::vector< std::valarray< S > > &vals, long first, long last)
return a set of rows of a vector column into a vector of valarrays
Definition: ColumnT.h:522
FitsException is the base class for all exceptions thrown by this library.
Definition: FitsError.h:93
Namespace enclosing all CCfits classes and globals definitions.
Definition: AsciiTable.cxx:26
void writeArrays(const std::vector< std::valarray< S > > &indata, long firstRow)
write a vector of valarray objects to the column, starting at row firstRow >= 1
Definition: ColumnT.h:1100
virtual void setDimen()
set the TDIMn keyword.
Definition: Column.h:1305
const String & unit() const
get units of data in Column (TUNITn keyword)
Definition: Column.h:1500
ValueType
CCfits value types and their CFITSIO equivalents (in caps)
Definition: CCfits.h:79
Exception thrown on attempting to access a scalar column as vector data.
Definition: Column.h:870
void setDisplay()
set the TDISPn keyword
Definition: Column.cxx:280
void addNullValue(T nullVal)
Set the TNULLn keyword for the column.
Definition: ColumnT.h:1328
Column(const Column &right)
copy constructor, used in copying Columns to standard library containers.
Definition: Column.cxx:171
int index() const
get the Column index (the n in TTYPEn etc).
Definition: Column.h:1333
const String & comment() const
retrieve comment for Column
Definition: Column.h:1490
Exception thrown on attempting to read a row number beyond the end of a table.
Definition: Column.h:894
ValueType type() const
returns the data type of the column
Definition: Column.h:1410
bool varLength() const
boolean, set to true if Column has variable length vector rows.
Definition: Column.h:1368
const String & format() const
return TFORMn keyword
Definition: Column.h:1495
Abstract base class for Column objects.
Definition: Column.h:827
Exception thrown on incorrect row writing request.
Definition: Column.h:858
virtual void readData(long firstRow, long nelements, long firstElem=1)=0
Read (or reread) data from the disk into the Column object's internal arrays.
void insertRows(long first, long number=1)
insert empty rows into the table
Definition: Table.cxx:331
Table * parent() const
return a pointer to the Table which owns this Column
Definition: Column.cxx:312
void deleteRows(long first, long number=1)
delete a range of rows in a table.
Definition: Table.cxx:350