CCfits 2.6

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List

Column.h
1 // Astrophysics Science Division,
2 // NASA/ Goddard Space Flight Center
3 // HEASARC
4 // http://heasarc.gsfc.nasa.gov
5 // e-mail: ccfits@legacy.gsfc.nasa.gov
6 //
7 // Original author: Ben Dorman
8
9 #ifndef COLUMN_H
10 #define COLUMN_H 1
11 #include <iostream>
12
13 // CCfitsHeader
14 #include "CCfits.h"
15 // Table
16 #include "Table.h"
17 // FitsError
18 #include "FitsError.h"
19 // FITSUtil
20 #include "FITSUtil.h"
21
22 #include <complex>
23
24
25 namespace CCfits {
26
27
28
841 class Column
842 {
843
844 public:
845
846
847
848 class RangeError : public FitsException //## Inherits: <unnamed>%3946526D031A
849 {
850 public:
851 RangeError (const String& msg, bool silent = true);
852
853 protected:
854 private:
855 private: //## implementation
856 };
857
858
859
860 class InvalidDataType : public FitsException //## Inherits: <unnamed>%3947CF30033E
861 {
862 public:
863 InvalidDataType (const String& str = string(), bool silent = true);
864
865 protected:
866 private:
867 private: //## implementation
868 };
869
870
871
872 class InvalidRowParameter : public FitsException //## Inherits: <unnamed>%39B5310F01A0
873 {
874 public:
875 InvalidRowParameter (const String& diag, bool silent = true);
876
877 protected:
878 private:
879 private: //## implementation
880 };
881
882
883
884 class WrongColumnType : public FitsException //## Inherits: <unnamed>%39B545780082
885 {
886 public:
887 WrongColumnType (const String& diag, bool silent = true);
888
889 protected:
890 private:
891 private: //## implementation
892 };
893
894
895
896 class UnspecifiedLengths : public FitsException //## Inherits: <unnamed>%3A018C9D007D
897 {
898 public:
899 UnspecifiedLengths (const String& diag, bool silent = true);
900
901 protected:
902 private:
903 private: //## implementation
904 };
905
906
907
908 class InvalidRowNumber : public FitsException //## Inherits: <unnamed>%3B0A850F0307
909 {
910 public:
911 InvalidRowNumber (const String& diag, bool silent = true);
912
913 protected:
914 private:
915 private: //## implementation
916 };
917
918
919
920 class InsufficientElements : public FitsException //## Inherits: <unnamed>%3B0BE611010A
921 {
922 public:
923 InsufficientElements (const String& msg, bool silent = true);
924
925 protected:
926 private:
927 private: //## implementation
928 };
929
930
931
932 class NoNullValue : public FitsException //## Inherits: <unnamed>%3B0D589A0092
933 {
934 public:
935 NoNullValue (const String& diag, bool silent = true);
936
937 protected:
938 private:
939 private: //## implementation
940 };
941
942
943
944 class InvalidNumberOfRows : public FitsException //## Inherits: <unnamed>%3B20EB8B0205
945 {
946 public:
947 InvalidNumberOfRows (int number, bool silent = true);
948
949 protected:
950 private:
951 private: //## implementation
952 };
953 Column(const Column &right);
954 virtual ~Column();
955 bool operator==(const Column &right) const;
956
957 bool operator!=(const Column &right) const;
958
959 virtual void readData (long firstRow, long nelements, long firstElem = 1) = 0;
960 // Virtual copy constructor.
961 virtual Column * clone () const = 0;
962 int rows () const;
963 void setDisplay ();
964 virtual void setDimen ();
965 friend std::ostream& operator << (std::ostream& s, const Column& right);
966
967 // The parent SET function is needed by Table classes, but
968 // should not be part of the user interface. It is deliberately left
969 // out of the document section up top.
970 Table* parent () const;
971 void setParent(Table* parent);
972
973 // Inequality operators for imposing sort order on columns.
974 friend bool operator < (const Column& left, const Column& right);
975 // Inequality operators for imposing sort order on columns.
976 friend bool operator > (const Column& left, const Column& right);
977 void setLimits (ValueType type);
978 void unit (const String& value);
979 void resetRead ();
980 int index () const;
981 void index (int value);
982 bool isRead () const;
983 void isRead (bool value);
984 long width () const;
985 void width (long value);
986 size_t repeat () const;
987 bool varLength () const;
988 double scale () const;
989 void scale (double value);
990 double zero () const;
991 void zero (double value);
992 const String& display () const;
993 const String& dimen () const;
994 void dimen (const String& value);
995 ValueType type () const;
996 void type (ValueType value);
997 static const String& TFORM ();
998 static const String& TDISP ();
999 static const String& TSCAL ();
1000 static const String& TZERO ();
1001 static const String& TDIM ();
1002 const String& format () const;
1003 const String& unit () const;
1004 const String& name () const;
1005
1006 public:
1007 // Additional Public Declarations
1008
1009 // scalar column interface. Column's Data Member is a std::vector<T>,
1010 // input data is std::vector<S>, std::valarray<S> or S* where S is not
1011 // in general the same as T.
1012
1013 template <typename S>
1014 void write (const std::vector<S>& indata, long firstRow);
1015
1016 void write (const std::vector<std::complex<float> >& indata, long firstRow);
1017
1018 void write (const std::vector<std::complex<double> >& indata, long firstRow);
1019
1020 template <typename S>
1021 void write (const std::valarray<S>& indata, long firstRow);
1022
1023 void write (const std::valarray<std::complex<float> >& indata, long firstRow);
1024
1025 void write (const std::valarray<std::complex<double> >& indata, long firstRow);
1026
1027 template <typename S>
1028 void write (S* indata, long nRows, long firstRow);
1029
1030
1031 template <typename S>
1032 void write (const std::vector<S>& indata, long firstRow, S* nullValue);
1033
1034 template <typename S>
1035 void write (const std::valarray<S>& indata, long firstRow, S* nullValue);
1036
1037 template <typename S>
1038 void write (S* indata, long nRows, long firstRow, S* nullValue);
1039 // vector column interface. We provide an interface that allows input of a vector, valarray and C-array.
1040 // there are versions that write variable numbers of elements per row as specified
1041 // in the vectorLengths argument. The user also can directly write a vector<valarray<T> >
1042 // object which is how the data are stored in the ColumnVectorData object.
1043 // this last one is also used internally to implement the variable lengths versions.
1044
1045 // fixed length write to binary table from valarray.
1046
1047
1048 template <typename S>
1049 void write (const std::valarray<S>& indata, long nRows, long firstRow);
1050
1051 void write (const std::valarray<std::complex<float> >& indata, long nRows, long firstRow);
1052
1053 void write (const std::valarray<std::complex<double> >& indata, long nRows, long firstRow);
1054
1055
1056 template <typename S>
1057 void write (const std::vector<S>& indata, long nRows, long firstRow);
1058
1059 void write (const std::vector<std::complex<float> >& indata, long nRows, long firstRow);
1060
1061 void write (const std::vector<std::complex<double> >& indata, long nRows, long firstRow);
1062
1063
1064
1065 template <typename S>
1066 void write (S* indata, long nElements, long nRows, long firstRow);
1067
1068
1069 template <typename S>
1070 void write (const std::valarray<S>& indata, long nRows, long firstRow, S* nullValue);
1071
1072
1073 template <typename S>
1074 void write (const std::vector<S>& indata, long nRows, long firstRow, S* nullValue);
1075
1076 template <typename S>
1077 void write (S* indata, long nElements, long nRows, long firstRow, S* nullValue);
1078
1079 // variable-length write to vector column from valarray or vector.
1080
1081 template <typename S>
1082 void write (const std::valarray<S>& indata,
1083 const std::vector<long>& vectorLengths,
1084 long firstRow);
1085
1086 void write (const std::valarray<std::complex<float> >& indata,
1087 const std::vector<long>& vectorLengths,
1088 long firstRow);
1089
1090 void write (const std::valarray<std::complex<double> >& indata,
1091 const std::vector<long>& vectorLengths,
1092 long firstRow);
1093
1094 template <typename S>
1095 void write (const std::vector<S>& indata,
1096 const std::vector<long>& vectorLengths,
1097 long firstRow);
1098
1099
1100
1101 void write (const std::vector<std::complex<float> >& indata,
1102 const std::vector<long>& vectorLengths,
1103 long firstRow);
1104
1105 void write (const std::vector<std::complex<double> >& indata,
1106 const std::vector<long>& vectorLengths,
1107 long firstRow);
1108
1109 template <typename S>
1110 void write (S* indata, long nElements,
1111 const std::vector<long>& vectorLengths,
1112 long firstRow);
1113
1114 template <typename S>
1115 void writeArrays (const std::vector<std::valarray<S> >& indata, long firstRow);
1116
1117 void writeArrays (const std::vector<std::valarray<std::complex<float> > >& indata, long firstRow);
1118
1119 void writeArrays (const std::vector<std::valarray<std::complex<double> > >& indata, long firstRow);
1120
1121 template <typename S>
1122 void writeArrays (const std::vector<std::valarray<S> >& indata, long firstRow, S* nullValue);
1123
1124 // get specified elements of a scalar column, returned as a std::vector
1125 // S is NOT the type of the column data itself, it is the type of the returned
1126 // data.
1127
1128 template <typename S>
1129 void read(std::vector<S>& vals, long first, long last) ;
1130
1131 // VC++, at least, won't compile these as template covering std::complex instances.
1132 void read(std::vector< std::complex<float> >& , long first, long last);
1133
1134 void read(std::vector< std::complex<double> >& , long first, long last);
1135
1136 void read(std::vector<String>& vals, long first, long last);
1137
1138 // return a set of rows from a scalar column as a valarray.
1139 template <typename S>
1140 void read(std::valarray<S>& vals, long first, long last) ;
1141
1142 void read(std::valarray<std::complex<float> >& vals, long first, long last) ;
1143
1144 void read(std::valarray<std::complex<double> >& vals, long first, long last) ;
1145
1146 // return a single row of a vector column.
1147 template <typename S>
1148 void read(std::valarray<S>& vals, long rows) ;
1149 template <typename S>
1150 void read(std::vector<S>& vals, long rows);
1151 void read(std::valarray<std::complex<float> >& vals, long rows) ;
1152 void read(std::valarray<std::complex<double> >& vals, long rows) ;
1153 void read(std::vector<std::complex<float> >& vals, long rows) ;
1154 void read(std::vector<std::complex<double> >& vals, long rows) ;
1155
1156 // get a set of rows from a vector column.
1157 template <typename S>
1158 void readArrays(std::vector<std::valarray<S> >& vals, long first, long last) ;
1159
1160 void readArrays(std::vector<std::valarray<std::complex<float> > >& vals, long first, long last) ;
1161
1162 void readArrays(std::vector<std::valarray<std::complex<double> > >& vals, long first, long last) ;
1163
1164 // nullValue has no meaning when the target column has floating point/std::complex
1165 // type. Also, implict conversion of std::complex to pure real is not supported
1166 // by cfitsio.
1167
1168 template <typename S>
1169 void read(std::vector<S>& vals, long first, long last, S* nullValue) ;
1170
1171 // return a set of rows from a scalar column as a valarray.
1172 template <typename S>
1173 void read(std::valarray<S>& vals, long first, long last, S* nullValue);
1174
1175 // return a single row of a vector column.
1176 template <typename S>
1177 void read(std::valarray<S>& vals, long rows, S* nullValue) ;
1178
1179 template <typename S>
1180 void read(std::vector<S>& vals, long rows, S* nullValue) ;
1181
1182 // get a set of rows from a vector column.
1183 template <typename S>
1184 void readArrays(std::vector<std::valarray<S> >& vals, long first, long last, S* nullValue);
1185
1186 // add a null value to the column
1187 template <typename T>
1188 void addNullValue(T nullVal);
1189
1190 // get the TNULL setting
1191 template <typename T>
1192 bool getNullValue(T* nullVal) const;
1193
1194 void write (const std::vector<String>& indata, long firstRow);
1195
1196 friend void Table::insertRows(long first, long number);
1197
1198 friend void Table::deleteRows(long first, long number);
1199
1200 friend void Table::deleteRows(const std::vector<long>& rowList);
1201
1202 friend void Table::initRead();
1203
1204 friend void Table::reindex(int startNum, bool isInsert);
1205
1206 friend void Table::updateRows();
1207
1208 protected:
1209 Column (int columnIndex, // The column index, i.e. the integer n in the keyword TCOLn
1210 const String &columnName, // The column name, curiously TTYPEn
1211 ValueType type, const String &format, // The TFORMn keyword.
1212 const String &unit, // The TUNITn keyword
1213 Table* p, // ! The Table containing the Column object
1214 int rpt = 1, long w = 1, const String &comment = "");
1215 Column (Table* p = 0);
1216
1217 virtual bool compare (const Column &right) const;
1218 fitsfile* fitsPointer ();
1219 // Protected method to set the current HDU to be the one containing this Column object. For use in
1220 // public read/write methods to ensure that data regarding numbers of rows and width relate to the
1221 // right HDU
1222 void makeHDUCurrent ();
1223 virtual std::ostream& put (std::ostream& s) const;
1224 void varLength (bool value);
1225 static const String& TBCOL ();
1226 static const String& TTYPE ();
1227 static const String& TUNIT ();
1228 static const String& TNULL ();
1229 static const String& TLMIN ();
1230 static const String& TLMAX ();
1231 static const String& TDMAX ();
1232 static const String& TDMIN ();
1233 static const std::vector<String>& columnKeys ();
1234 const String& comment () const;
1235
1236 // Additional Protected Declarations
1237
1238 private:
1239 Column & operator=(const Column &right);
1240
1241 // Insert one or more blank rows into a FITS column.
1242 virtual void insertRows (long first, long number = 1) = 0;
1243 virtual void deleteRows (long first, long number = 1) = 0;
1244 virtual size_t getStoredDataSize() const = 0;
1245 static void loadColumnKeys ();
1246 void name (const String& value);
1247 void format (const String& value);
1248 long numberOfElements (long& first, long& last);
1249
1250 // Data Members for Class Attributes
1251 static const String s_TBCOL;
1252 static const String s_TTYPE;
1253 static const String s_TFORM;
1254 static const String s_TDISP;
1255 static const String s_TUNIT;
1256 static const String s_TSCAL;
1257 static const String s_TZERO;
1258 static const String s_TDIM;
1259 static const String s_TNULL;
1260 static const String s_TLMIN;
1261 static const String s_TLMAX;
1262 static const String s_TDMAX;
1263 static const String s_TDMIN;
1264
1265 // Additional Private Declarations
1266
1267 private: //## implementation
1268 // Data Members for Class Attributes
1269 int m_index;
1270 bool m_isRead;
1271 long m_width;
1272 size_t m_repeat;
1273 bool m_varLength;
1274 double m_scale;
1275 double m_zero;
1276 String m_display;
1277 String m_dimen;
1278 ValueType m_type;
1279 static const short LLIMITSHORT;
1280 static const long LLIMITLONG;
1281 static const unsigned short LLIMITUSHORT;
1282 static const unsigned long LLIMITULONG;
1283 static const unsigned char LLIMITUCHAR;
1284 static const float LLIMITFLOAT;
1285 static const double LLIMITDOUBLE;
1286 static const short ULIMITSHORT;
1287 static const long ULIMITLONG;
1288 static const unsigned short ULIMITUSHORT;
1289 static const unsigned long ULIMITULONG;
1290 static const unsigned char ULIMITUCHAR;
1291 static const float ULIMITFLOAT;
1292 static const double ULIMITDOUBLE;
1293 static const int LLIMITINT;
1294 static const int ULIMITINT;
1295 static const unsigned int LLIMITUINT;
1296 static const unsigned int ULIMITUINT;
1297 static const LONGLONG LLIMITLONGLONG;
1298 static const LONGLONG ULIMITLONGLONG;
1299
1300 // Data Members for Associations
1301 Table* m_parent;
1302 static std::vector<String> s_columnKeys;
1303 String m_comment;
1304 String m_format;
1305 String m_unit;
1306 String m_name;
1307
1308 // Additional Implementation Declarations
1309
1310 };
1311
1312 // Class CCfits::Column::RangeError
1313
1314 // Class CCfits::Column::InvalidDataType
1315
1316 // Class CCfits::Column::InvalidRowParameter
1317
1318 // Class CCfits::Column::WrongColumnType
1319
1320 // Class CCfits::Column::UnspecifiedLengths
1321
1322 // Class CCfits::Column::InvalidRowNumber
1323
1324 // Class CCfits::Column::InsufficientElements
1325
1326 // Class CCfits::Column::NoNullValue
1327
1328 // Class CCfits::Column::InvalidNumberOfRows
1329
1330 // Class CCfits::Column
1331
1332 inline void Column::setDimen ()
1333 {
1334 // default implementation: do nothing. Overridden by ColumnVectorData.
1335 }
1336
1337 inline std::ostream& operator << (std::ostream& s, const Column& right)
1338 {
1339
1340 return right.put(s);
1341 }
1342
1343 inline bool operator < (const Column& left, const Column& right)
1344 {
1345
1346 return left.m_index < right.m_index;
1347 }
1348
1349 inline bool operator > (const Column& left, const Column& right)
1350 {
1351
1352 return left.m_index > right.m_index;
1353 }
1354
1355 inline void Column::resetRead ()
1356 {
1357 m_isRead = false;
1358 }
1359
1360 inline int Column::index () const
1361 {
1362 return m_index;
1363 }
1364
1365 inline void Column::index (int value)
1366 {
1367 m_index = value;
1368 }
1369
1370 inline bool Column::isRead () const
1371 {
1372 return m_isRead;
1373 }
1374
1375 inline void Column::isRead (bool value)
1376 {
1377 m_isRead = value;
1378 }
1379
1380 inline long Column::width () const
1381 {
1382 return m_width;
1383 }
1384
1385 inline void Column::width (long value)
1386 {
1387 m_width = value;
1388 }
1389
1390 inline size_t Column::repeat () const
1391 {
1392 return m_repeat;
1393 }
1394
1395 inline bool Column::varLength () const
1396 {
1397 return m_varLength;
1398 }
1399
1400 inline double Column::scale () const
1401 {
1402 return m_scale;
1403 }
1404
1405 inline void Column::scale (double value)
1406 {
1407 m_scale = value;
1408 int status(0);
1409 if (fits_set_tscale(fitsPointer(),m_index,value,m_zero,&status)) throw FitsError(status);
1410 }
1411
1412 inline double Column::zero () const
1413 {
1414 return m_zero;
1415 }
1416
1417 inline void Column::zero (double value)
1418 {
1419 m_zero = value;
1420 }
1421
1422 inline const String& Column::display () const
1423 {
1424 return m_display;
1425 }
1426
1427 inline const String& Column::dimen () const
1428 {
1429 return m_dimen;
1430 }
1431
1432 inline void Column::dimen (const String& value)
1433 {
1434 m_dimen = value;
1435 }
1436
1437 inline ValueType Column::type () const
1438 {
1439 return m_type;
1440 }
1441
1442 inline void Column::type (ValueType value)
1443 {
1444 m_type = value;
1445 }
1446
1447 inline const String& Column::TBCOL ()
1448 {
1449 return s_TBCOL;
1450 }
1451
1452 inline const String& Column::TTYPE ()
1453 {
1454 return s_TTYPE;
1455 }
1456
1457 inline const String& Column::TFORM ()
1458 {
1459 return s_TFORM;
1460 }
1461
1462 inline const String& Column::TDISP ()
1463 {
1464 return s_TDISP;
1465 }
1466
1467 inline const String& Column::TUNIT ()
1468 {
1469 return s_TUNIT;
1470 }
1471
1472 inline const String& Column::TSCAL ()
1473 {
1474 return s_TSCAL;
1475 }
1476
1477 inline const String& Column::TZERO ()
1478 {
1479 return s_TZERO;
1480 }
1481
1482 inline const String& Column::TDIM ()
1483 {
1484 return s_TDIM;
1485 }
1486
1487 inline const String& Column::TNULL ()
1488 {
1489 return s_TNULL;
1490 }
1491
1492 inline const String& Column::TLMIN ()
1493 {
1494 return s_TLMIN;
1495 }
1496
1497 inline const String& Column::TLMAX ()
1498 {
1499 return s_TLMAX;
1500 }
1501
1502 inline const String& Column::TDMAX ()
1503 {
1504 return s_TDMAX;
1505 }
1506
1507 inline const String& Column::TDMIN ()
1508 {
1509 return s_TDMIN;
1510 }
1511
1512 inline const std::vector<String>& Column::columnKeys ()
1513 {
1514 return s_columnKeys;
1515 }
1516
1517 inline const String& Column::comment () const
1518 {
1519 return m_comment;
1520 }
1521
1522 inline const String& Column::format () const
1523 {
1524 return m_format;
1525 }
1526
1527 inline const String& Column::unit () const
1528 {
1529 return m_unit;
1530 }
1531
1532 inline const String& Column::name () const
1533 {
1534 return m_name;
1535 }
1536
1537 } // namespace CCfits
1538
1539
1540 #endif
CCfits::Column::~Column
virtual ~Column()
destructor.
Definition: Column.cxx:234
CCfits::Column::NoNullValue
Exception thrown if a null value is specified without support from existing column header...
Definition: Column.h:932
CCfits::Column::name
const String & name() const
return name of Column (TTYPEn keyword)
Definition: Column.h:1532
CCfits::Column::InvalidRowNumber::InvalidRowNumber
InvalidRowNumber(const String &diag, bool silent=true)
Exception ctor, prefixes the string &quot;FitsError: Invalid Row Number - Column: &quot; before the specific me...
Definition: Column.cxx:94
CCfits::Column::InvalidDataType
Exception thrown for invalid data type inputs.
Definition: Column.h:860
CCfits::Column::repeat
size_t repeat() const
get the repeat count for the rows
Definition: Column.h:1390
CCfits::Column::fitsPointer
fitsfile * fitsPointer()
fits pointer corresponding to fits file containing column data.
Definition: Column.cxx:264
CCfits::Column::rows
int rows() const
return the number of rows in the table.
Definition: Column.cxx:275
CCfits::Column::width
long width() const
return column data width
Definition: Column.h:1380
CCfits::Column::resetRead
void resetRead()
reset the Column&#39;s isRead flag to false
Definition: Column.h:1355
CCfits::Table::updateRows
void updateRows()
update the number of rows in the table
Definition: Table.cxx:340
CCfits::Column::makeHDUCurrent
void makeHDUCurrent()
make HDU containing this the current HDU of the fits file.
Definition: Column.cxx:270
CCfits::Column::getNullValue
bool getNullValue(T *nullVal) const
Get the value of the TNULLn keyword for the column.
Definition: ColumnT.h:1520
CCfits::FitsError
FitsError is the exception thrown by non-zero cfitsio status codes.
Definition: FitsError.h:112
CCfits::Column::display
const String & display() const
return TDISPn keyword
Definition: Column.h:1422
CCfits::Column::write
void write(const std::vector< S > &indata, long firstRow)
write a vector of values into a scalar column starting with firstRow
Definition: ColumnT.h:869
CCfits::Column::InvalidNumberOfRows
Exception thrown if user enters a non-positive number for the number of rows to write.
Definition: Column.h:944
CCfits::Column::RangeError::RangeError
RangeError(const String &msg, bool silent=true)
Exception ctor, prefixes the string &quot;FitsError: Range error in operation &quot; before the specific messag...
Definition: Column.cxx:43
CCfits::Column::InsufficientElements
Exception thrown if the data supplied for a write operation is less than declared.
Definition: Column.h:920
CCfits::Column::dimen
const String & dimen() const
return TDIMn keyword
Definition: Column.h:1427
CCfits::Column::scale
double scale() const
get TSCALn value
Definition: Column.h:1400
CCfits::Column::read
void read(std::vector< S > &vals, long first, long last)
Retrieve data from a scalar column into a std::vector.
Definition: ColumnT.h:42
CCfits::Column::isRead
bool isRead() const
flag set to true if the entire column data has been read from disk
Definition: Column.h:1370
CCfits::Column::RangeError
exception to be thrown for inputs that cause range errors in column read operations.
Definition: Column.h:848
CCfits::Column::put
virtual std::ostream & put(std::ostream &s) const
internal implementation of &lt;&lt; operator.
Definition: Column.cxx:302
CCfits::Column::zero
double zero() const
get TZEROn value
Definition: Column.h:1412
CCfits::Column::readArrays
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:680
CCfits::Column::InsufficientElements::InsufficientElements
InsufficientElements(const String &msg, bool silent=true)
Exception ctor, prefixes the string &quot;FitsError: not enough elements supplied for write operation: &quot; ...
Definition: Column.cxx:104
CCfits::FitsException
FitsException is the base class for all exceptions thrown by this library.
Definition: FitsError.h:93
CCfits::Column::writeArrays
void writeArrays(const std::vector< std::valarray< S > > &indata, long firstRow)
write a vector of valarray objects to the column, starting at row firstRow &gt;= 1
Definition: ColumnT.h:1257
CCfits::Column::InvalidRowParameter::InvalidRowParameter
InvalidRowParameter(const String &diag, bool silent=true)
Exception ctor, prefixes the string &quot;FitsError: row offset or length incompatible with column declara...
Definition: Column.cxx:63
CCfits::Column::setDimen
virtual void setDimen()
set the TDIMn keyword.
Definition: Column.h:1332
CCfits::Column::unit
const String & unit() const
get units of data in Column (TUNITn keyword)
Definition: Column.h:1527
CCfits::ValueType
ValueType
CCfits value types and their CFITSIO equivalents (in caps)
Definition: CCfits.h:81
CCfits::Column::NoNullValue::NoNullValue
NoNullValue(const String &diag, bool silent=true)
Exception ctor, prefixes the string &quot;Fits Error: No null value specified for column: &quot; before the spe...
Definition: Column.cxx:114
CCfits::Column::WrongColumnType
Exception thrown on attempting to access a scalar column as vector data.
Definition: Column.h:884
CCfits::operator<<
std::ostream & operator<<(std::ostream &s, const Column &right)
output operator for Column objects.
Definition: Column.h:1337
CCfits::Column::setDisplay
void setDisplay()
set the TDISPn keyword
Definition: Column.cxx:280
CCfits::Column::addNullValue
void addNullValue(T nullVal)
Set the TNULLn keyword for the column.
Definition: ColumnT.h:1485
CCfits::Column::Column
Column(const Column &right)
copy constructor, used in copying Columns to standard library containers.
Definition: Column.cxx:171
CCfits::Table
Definition: Table.h:282
CCfits::Column::index
int index() const
get the Column index (the n in TTYPEn etc).
Definition: Column.h:1360
CCfits::Column::InvalidDataType::InvalidDataType
InvalidDataType(const String &str=string(), bool silent=true)
Exception ctor, prefixes the string &quot;FitsError: Incorrect data type: &quot; before the specific message...
Definition: Column.cxx:53
CCfits::Column::WrongColumnType::WrongColumnType
WrongColumnType(const String &diag, bool silent=true)
Exception ctor, prefixes the string &quot;FitsError: Attempt to return scalar data from vector column...
Definition: Column.cxx:73
CCfits::Column::comment
const String & comment() const
retrieve comment for Column
Definition: Column.h:1517
CCfits::Column::InvalidNumberOfRows::InvalidNumberOfRows
InvalidNumberOfRows(int number, bool silent=true)
Exception ctor, prefixes the string &quot;Fits Error: number of rows to write must be positive &quot; before th...
Definition: Column.cxx:124
CCfits::Column::InvalidRowNumber
Exception thrown on attempting to read a row number beyond the end of a table.
Definition: Column.h:908
CCfits::Column::type
ValueType type() const
returns the data type of the column
Definition: Column.h:1437
CCfits::Column::varLength
bool varLength() const
boolean, set to true if Column has variable length vector rows.
Definition: Column.h:1395
CCfits::Column::format
const String & format() const
return TFORMn keyword
Definition: Column.h:1522
CCfits::Column
Abstract base class for Column objects.
Definition: Column.h:841
CCfits::Column::InvalidRowParameter
Exception thrown on incorrect row writing request.
Definition: Column.h:872
CCfits::Column::readData
virtual void readData(long firstRow, long nelements, long firstElem=1)=0
Read (or reread) data from the disk into the Column object&#39;s internal arrays.
CCfits::Table::insertRows
void insertRows(long first, long number=1)
insert empty rows into the table
Definition: Table.cxx:400
CCfits::Column::parent
Table * parent() const
return a pointer to the Table which owns this Column
Definition: Column.cxx:312
CCfits::Table::deleteRows
void deleteRows(long first, long number=1)
delete a range of rows in a table.
Definition: Table.cxx:419