CCfits  2.5
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  protected:
1207  Column (int columnIndex, // The column index, i.e. the integer n in the keyword TCOLn
1208  const String &columnName, // The column name, curiously TTYPEn
1209  ValueType type, const String &format, // The TFORMn keyword.
1210  const String &unit, // The TUNITn keyword
1211  Table* p, // ! The Table containing the Column object
1212  int rpt = 1, long w = 1, const String &comment = "");
1213  Column (Table* p = 0);
1214 
1215  virtual bool compare (const Column &right) const;
1216  fitsfile* fitsPointer ();
1217  // Protected method to set the current HDU to be the one containing this Column object. For use in
1218  // public read/write methods to ensure that data regarding numbers of rows and width relate to the
1219  // right HDU
1220  void makeHDUCurrent ();
1221  virtual std::ostream& put (std::ostream& s) const;
1222  void varLength (bool value);
1223  static const String& TBCOL ();
1224  static const String& TTYPE ();
1225  static const String& TUNIT ();
1226  static const String& TNULL ();
1227  static const String& TLMIN ();
1228  static const String& TLMAX ();
1229  static const String& TDMAX ();
1230  static const String& TDMIN ();
1231  static const std::vector<String>& columnKeys ();
1232  const String& comment () const;
1233 
1234  // Additional Protected Declarations
1235 
1236  private:
1237  Column & operator=(const Column &right);
1238 
1239  // Insert one or more blank rows into a FITS column.
1240  virtual void insertRows (long first, long number = 1) = 0;
1241  virtual void deleteRows (long first, long number = 1) = 0;
1242  static void loadColumnKeys ();
1243  void name (const String& value);
1244  void format (const String& value);
1245  long numberOfElements (long& first, long& last);
1246 
1247  // Data Members for Class Attributes
1248  static const String s_TBCOL;
1249  static const String s_TTYPE;
1250  static const String s_TFORM;
1251  static const String s_TDISP;
1252  static const String s_TUNIT;
1253  static const String s_TSCAL;
1254  static const String s_TZERO;
1255  static const String s_TDIM;
1256  static const String s_TNULL;
1257  static const String s_TLMIN;
1258  static const String s_TLMAX;
1259  static const String s_TDMAX;
1260  static const String s_TDMIN;
1261 
1262  // Additional Private Declarations
1263 
1264  private: //## implementation
1265  // Data Members for Class Attributes
1266  int m_index;
1267  bool m_isRead;
1268  long m_width;
1269  size_t m_repeat;
1270  bool m_varLength;
1271  double m_scale;
1272  double m_zero;
1273  String m_display;
1274  String m_dimen;
1275  ValueType m_type;
1276  static const short LLIMITSHORT;
1277  static const long LLIMITLONG;
1278  static const unsigned short LLIMITUSHORT;
1279  static const unsigned long LLIMITULONG;
1280  static const unsigned char LLIMITUCHAR;
1281  static const float LLIMITFLOAT;
1282  static const double LLIMITDOUBLE;
1283  static const short ULIMITSHORT;
1284  static const long ULIMITLONG;
1285  static const unsigned short ULIMITUSHORT;
1286  static const unsigned long ULIMITULONG;
1287  static const unsigned char ULIMITUCHAR;
1288  static const float ULIMITFLOAT;
1289  static const double ULIMITDOUBLE;
1290  static const int LLIMITINT;
1291  static const int ULIMITINT;
1292  static const unsigned int LLIMITUINT;
1293  static const unsigned int ULIMITUINT;
1294  static const LONGLONG LLIMITLONGLONG;
1295  static const LONGLONG ULIMITLONGLONG;
1296 
1297  // Data Members for Associations
1298  Table* m_parent;
1299  static std::vector<String> s_columnKeys;
1300  String m_comment;
1301  String m_format;
1302  String m_unit;
1303  String m_name;
1304 
1305  // Additional Implementation Declarations
1306 
1307  };
1308 
1309  // Class CCfits::Column::RangeError
1310 
1311  // Class CCfits::Column::InvalidDataType
1312 
1313  // Class CCfits::Column::InvalidRowParameter
1314 
1315  // Class CCfits::Column::WrongColumnType
1316 
1317  // Class CCfits::Column::UnspecifiedLengths
1318 
1319  // Class CCfits::Column::InvalidRowNumber
1320 
1321  // Class CCfits::Column::InsufficientElements
1322 
1323  // Class CCfits::Column::NoNullValue
1324 
1325  // Class CCfits::Column::InvalidNumberOfRows
1326 
1327  // Class CCfits::Column
1328 
1329  inline void Column::setDimen ()
1330  {
1331  // default implementation: do nothing. Overridden by ColumnVectorData.
1332  }
1333 
1334  inline std::ostream& operator << (std::ostream& s, const Column& right)
1335  {
1336 
1337  return right.put(s);
1338  }
1339 
1340  inline bool operator < (const Column& left, const Column& right)
1341  {
1342 
1343  return left.m_index < right.m_index;
1344  }
1345 
1346  inline bool operator > (const Column& left, const Column& right)
1347  {
1348 
1349  return left.m_index > right.m_index;
1350  }
1351 
1352  inline void Column::resetRead ()
1353  {
1354  m_isRead = false;
1355  }
1356 
1357  inline int Column::index () const
1358  {
1359  return m_index;
1360  }
1361 
1362  inline void Column::index (int value)
1363  {
1364  m_index = value;
1365  }
1366 
1367  inline bool Column::isRead () const
1368  {
1369  return m_isRead;
1370  }
1371 
1372  inline void Column::isRead (bool value)
1373  {
1374  m_isRead = value;
1375  }
1376 
1377  inline long Column::width () const
1378  {
1379  return m_width;
1380  }
1381 
1382  inline void Column::width (long value)
1383  {
1384  m_width = value;
1385  }
1386 
1387  inline size_t Column::repeat () const
1388  {
1389  return m_repeat;
1390  }
1391 
1392  inline bool Column::varLength () const
1393  {
1394  return m_varLength;
1395  }
1396 
1397  inline double Column::scale () const
1398  {
1399  return m_scale;
1400  }
1401 
1402  inline void Column::scale (double value)
1403  {
1404  m_scale = value;
1405  int status(0);
1406  if (fits_set_tscale(fitsPointer(),m_index,value,m_zero,&status)) throw FitsError(status);
1407  }
1408 
1409  inline double Column::zero () const
1410  {
1411  return m_zero;
1412  }
1413 
1414  inline void Column::zero (double value)
1415  {
1416  m_zero = value;
1417  }
1418 
1419  inline const String& Column::display () const
1420  {
1421  return m_display;
1422  }
1423 
1424  inline const String& Column::dimen () const
1425  {
1426  return m_dimen;
1427  }
1428 
1429  inline void Column::dimen (const String& value)
1430  {
1431  m_dimen = value;
1432  }
1433 
1434  inline ValueType Column::type () const
1435  {
1436  return m_type;
1437  }
1438 
1439  inline void Column::type (ValueType value)
1440  {
1441  m_type = value;
1442  }
1443 
1444  inline const String& Column::TBCOL ()
1445  {
1446  return s_TBCOL;
1447  }
1448 
1449  inline const String& Column::TTYPE ()
1450  {
1451  return s_TTYPE;
1452  }
1453 
1454  inline const String& Column::TFORM ()
1455  {
1456  return s_TFORM;
1457  }
1458 
1459  inline const String& Column::TDISP ()
1460  {
1461  return s_TDISP;
1462  }
1463 
1464  inline const String& Column::TUNIT ()
1465  {
1466  return s_TUNIT;
1467  }
1468 
1469  inline const String& Column::TSCAL ()
1470  {
1471  return s_TSCAL;
1472  }
1473 
1474  inline const String& Column::TZERO ()
1475  {
1476  return s_TZERO;
1477  }
1478 
1479  inline const String& Column::TDIM ()
1480  {
1481  return s_TDIM;
1482  }
1483 
1484  inline const String& Column::TNULL ()
1485  {
1486  return s_TNULL;
1487  }
1488 
1489  inline const String& Column::TLMIN ()
1490  {
1491  return s_TLMIN;
1492  }
1493 
1494  inline const String& Column::TLMAX ()
1495  {
1496  return s_TLMAX;
1497  }
1498 
1499  inline const String& Column::TDMAX ()
1500  {
1501  return s_TDMAX;
1502  }
1503 
1504  inline const String& Column::TDMIN ()
1505  {
1506  return s_TDMIN;
1507  }
1508 
1509  inline const std::vector<String>& Column::columnKeys ()
1510  {
1511  return s_columnKeys;
1512  }
1513 
1514  inline const String& Column::comment () const
1515  {
1516  return m_comment;
1517  }
1518 
1519  inline const String& Column::format () const
1520  {
1521  return m_format;
1522  }
1523 
1524  inline const String& Column::unit () const
1525  {
1526  return m_unit;
1527  }
1528 
1529  inline const String& Column::name () const
1530  {
1531  return m_name;
1532  }
1533 
1534 } // namespace CCfits
1535 
1536 
1537 #endif
CCfits::Column::~Column
virtual ~Column()
destructor.
Definition: Column.cxx:234
CCfits::Column::getNullValue
bool getNullValue(T *nullVal) const
Get the value of the TNULLn keyword for the column.
Definition: ColumnT.h:1520
CCfits::Column::setDimen
virtual void setDimen()
set the TDIMn keyword.
Definition: Column.h:1329
CCfits::Column::dimen
const String & dimen() const
return TDIMn keyword
Definition: Column.h:1424
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's internal arrays.
CCfits::Column::repeat
size_t repeat() const
get the repeat count for the rows
Definition: Column.h:1387
CCfits::Table::insertRows
void insertRows(long first, long number=1)
insert empty rows into the table
Definition: Table.cxx:337
CCfits::Column::InvalidRowNumber
Exception thrown on attempting to read a row number beyond the end of a table.
Definition: Column.h:909
CCfits::Column::InvalidDataType::InvalidDataType
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
CCfits::Column::comment
const String & comment() const
retrieve comment for Column
Definition: Column.h:1514
CCfits::Column::Column
Column(const Column &right)
copy constructor, used in copying Columns to standard library containers.
Definition: Column.cxx:171
CCfits::Column::RangeError::RangeError
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
CCfits::Column::InvalidNumberOfRows::InvalidNumberOfRows
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
CCfits::Column::WrongColumnType
Exception thrown on attempting to access a scalar column as vector data.
Definition: Column.h:885
CCfits::Column::isRead
bool isRead() const
flag set to true if the entire column data has been read from disk
Definition: Column.h:1367
CCfits::Column::name
const String & name() const
return name of Column (TTYPEn keyword)
Definition: Column.h:1529
CCfits::Column::index
int index() const
get the Column index (the n in TTYPEn etc).
Definition: Column.h:1357
CCfits::Column::resetRead
void resetRead()
reset the Column's isRead flag to false
Definition: Column.h:1352
CCfits::Column::RangeError
exception to be thrown for inputs that cause range errors in column read operations.
Definition: Column.h:849
CCfits::Column::InvalidRowParameter
Exception thrown on incorrect row writing request.
Definition: Column.h:873
CCfits::Column::zero
double zero() const
get TZEROn value
Definition: Column.h:1409
CCfits::ValueType
ValueType
CCfits value types and their CFITSIO equivalents (in caps)
Definition: CCfits.h:81
CCfits::Table
Definition: Table.h:272
CCfits::Column::fitsPointer
fitsfile * fitsPointer()
fits pointer corresponding to fits file containing column data.
Definition: Column.cxx:264
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::WrongColumnType::WrongColumnType
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
CCfits::Column::InvalidRowNumber::InvalidRowNumber
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
CCfits::Column::makeHDUCurrent
void makeHDUCurrent()
make HDU containing this the current HDU of the fits file.
Definition: Column.cxx:270
CCfits::Column::InvalidNumberOfRows
Exception thrown if user enters a non-positive number for the number of rows to write.
Definition: Column.h:945
CCfits::Column::format
const String & format() const
return TFORMn keyword
Definition: Column.h:1519
CCfits::Column::rows
int rows() const
return the number of rows in the table.
Definition: Column.cxx:275
CCfits::Column::InvalidDataType
Exception thrown for invalid data type inputs.
Definition: Column.h:861
CCfits::Column::scale
double scale() const
get TSCALn value
Definition: Column.h:1397
CCfits::Column::type
ValueType type() const
returns the data type of the column
Definition: Column.h:1434
CCfits::FitsError
FitsError is the exception thrown by non-zero cfitsio status codes.
Definition: FitsError.h:113
CCfits::Table::deleteRows
void deleteRows(long first, long number=1)
delete a range of rows in a table.
Definition: Table.cxx:356
CCfits::Column
Abstract base class for Column objects.
Definition: Column.h:842
CCfits::Column::width
long width() const
return column data width
Definition: Column.h:1377
CCfits::Column::NoNullValue::NoNullValue
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
CCfits::Column::varLength
bool varLength() const
boolean, set to true if Column has variable length vector rows.
Definition: Column.h:1392
CCfits::Column::display
const String & display() const
return TDISPn keyword
Definition: Column.h:1419
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 >= 1
Definition: ColumnT.h:1257
CCfits::Column::InvalidRowParameter::InvalidRowParameter
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
CCfits::operator<<
std::ostream & operator<<(std::ostream &s, const Column &right)
output operator for Column objects.
Definition: Column.h:1334
CCfits::Column::unit
const String & unit() const
get units of data in Column (TUNITn keyword)
Definition: Column.h:1524
CCfits::Column::InsufficientElements::InsufficientElements
InsufficientElements(const String &msg, bool silent=true)
Exception ctor, prefixes the string "FitsError: not enough elements supplied for write operation: " ...
Definition: Column.cxx:104
CCfits
Namespace enclosing all CCfits classes and globals definitions.
Definition: AsciiTable.cxx:26
CCfits::Column::put
virtual std::ostream & put(std::ostream &s) const
internal implementation of << operator.
Definition: Column.cxx:302
CCfits::Column::parent
Table * parent() const
return a pointer to the Table which owns this Column
Definition: Column.cxx:312
CCfits::FitsException
FitsException is the base class for all exceptions thrown by this library.
Definition: FitsError.h:94
CCfits::Column::setDisplay
void setDisplay()
set the TDISPn keyword
Definition: Column.cxx:280
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::addNullValue
void addNullValue(T nullVal)
Set the TNULLn keyword for the column.
Definition: ColumnT.h:1485
CCfits::Column::InsufficientElements
Exception thrown if the data supplied for a write operation is less than declared.
Definition: Column.h:921
CCfits::Column::NoNullValue
Exception thrown if a null value is specified without support from existing column header.
Definition: Column.h:933
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