CCfits 2.6
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
25namespace CCfits {
26
27
28
60
67
68
69
78
87
88
89
90
99
100
111
112
121
122
139
148
149
156
165
166
167
178
187
188
198
207
208
215
216
225
235
236
243
255
278
292
300
308
314
320
328
337
338
346
354
372
373
374
375
393
394
395
396
397
408
409
410
422
437
438
446
447
464
472
485
493
516
528
540
554
562
563
575
588
602
603
604
611
617
618
625
630
631
639
640
648
656
657
668
669
679
680
681
689
690
695
696
720
726
727
728
736
744
753
761
769
770
776
787
795
796
806
817
826
827
833
838
839
840
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
InsufficientElements(const String &msg, bool silent=true)
Exception ctor, prefixes the string "FitsError: not enough elements supplied for write operation: " ...
Definition Column.cxx:104
InvalidDataType(const String &str=string(), bool silent=true)
Exception ctor, prefixes the string "FitsError: Incorrect data type: " before the specific message.
Definition Column.cxx:53
InvalidNumberOfRows(int number, bool silent=true)
Exception ctor, prefixes the string "Fits Error: number of rows to write must be positive " before th...
Definition Column.cxx:124
InvalidRowNumber(const String &diag, bool silent=true)
Exception ctor, prefixes the string "FitsError: Invalid Row Number - Column: " before the specific me...
Definition Column.cxx:94
InvalidRowParameter(const String &diag, bool silent=true)
Exception ctor, prefixes the string "FitsError: row offset or length incompatible with column declara...
Definition Column.cxx:63
NoNullValue(const String &diag, bool silent=true)
Exception ctor, prefixes the string "Fits Error: No null value specified for column: " before the spe...
Definition Column.cxx:114
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
WrongColumnType(const String &diag, bool silent=true)
Exception ctor, prefixes the string "FitsError: Attempt to return scalar data from vector column,...
Definition Column.cxx:73
Abstract base class for Column objects.
Definition Column.h:842
Column(const Column &right)
copy constructor, used in copying Columns to standard library containers.
Definition Column.cxx:171
const String & unit() const
get units of data in Column (TUNITn keyword)
Definition Column.h:1527
virtual void setDimen()
set the TDIMn keyword.
Definition Column.h:1332
const String & comment() const
retrieve comment for Column
Definition Column.h:1517
const String & format() const
return TFORMn keyword
Definition Column.h:1522
void setDisplay()
set the TDISPn keyword
Definition Column.cxx:280
ValueType type() const
returns the data type of the column
Definition Column.h:1437
void addNullValue(T nullVal)
Set the TNULLn keyword for the column.
Definition ColumnT.h:1485
void makeHDUCurrent()
make HDU containing this the current HDU of the fits file.
Definition Column.cxx:270
void resetRead()
reset the Column's isRead flag to false
Definition Column.h:1355
bool getNullValue(T *nullVal) const
Get the value of the TNULLn keyword for the column.
Definition ColumnT.h:1520
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
int rows() const
return the number of rows in the table.
Definition Column.cxx:275
const String & display() const
return TDISPn keyword
Definition Column.h:1422
double zero() const
get TZEROn value
Definition Column.h:1412
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
long width() const
return column data width
Definition Column.h:1380
Table * parent() const
return a pointer to the Table which owns this Column
Definition Column.cxx:312
const String & name() const
return name of Column (TTYPEn keyword)
Definition Column.h:1532
size_t repeat() const
get the repeat count for the rows
Definition Column.h:1390
bool isRead() const
flag set to true if the entire column data has been read from disk
Definition Column.h:1370
int index() const
get the Column index (the n in TTYPEn etc).
Definition Column.h:1360
void read(std::vector< S > &vals, long first, long last)
Retrieve data from a scalar column into a std::vector.
Definition ColumnT.h:42
const String & dimen() const
return TDIMn keyword
Definition Column.h:1427
bool varLength() const
boolean, set to true if Column has variable length vector rows.
Definition Column.h:1395
fitsfile * fitsPointer()
fits pointer corresponding to fits file containing column data.
Definition Column.cxx:264
virtual std::ostream & put(std::ostream &s) const
internal implementation of << operator.
Definition Column.cxx:302
double scale() const
get TSCALn value
Definition Column.h:1400
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 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:1257
virtual ~Column()
destructor.
Definition Column.cxx:234
FitsError is the exception thrown by non-zero cfitsio status codes.
Definition FitsError.h:113
FitsException is the base class for all exceptions thrown by this library.
Definition FitsError.h:94
FitsException(const string &msg, bool &silent)
Definition FitsError.cxx:42
Definition Table.h:283
void insertRows(long first, long number=1)
insert empty rows into the table
Definition Table.cxx:400
void updateRows()
update the number of rows in the table
Definition Table.cxx:340
void deleteRows(long first, long number=1)
delete a range of rows in a table.
Definition Table.cxx:419
Namespace enclosing all CCfits classes and globals definitions.
Definition AsciiTable.cxx:26
std::ostream & operator<<(std::ostream &s, const Column &right)
output operator for Column objects.
Definition Column.h:1337
ValueType
CCfits value types and their CFITSIO equivalents (in caps).
Definition CCfits.h:81