17 #include "FitsError.h"
456 friend bool operator<(
const ExtHDU &left,
const ExtHDU &right);
458 friend bool operator>(
const ExtHDU &left,
const ExtHDU &right);
460 friend bool operator<=(
const ExtHDU &left,
const ExtHDU &right);
462 friend bool operator>=(
const ExtHDU &left,
const ExtHDU &right);
464 static void readHduName (
const fitsfile* fptr,
int hduIndex, String& hduName,
int& hduVersion);
465 virtual void readData (
bool readFlag =
false,
const std::vector<String>& keys = std::vector<String>()) = 0;
466 const String&
name ()
const;
474 virtual Column&
column (
const String& colName,
bool caseSensitive =
true)
const;
476 virtual long rows ()
const;
477 virtual void addColumn (
ValueType type,
const String& columnName,
long repeatWidth,
const String& colUnit = String(
""),
long decimals = -1,
size_t columnNumber = 0);
478 virtual void copyColumn(
const Column& inColumn,
int colIndx,
bool insertNewCol=
true);
487 static const String& missHDU ();
488 static void setMissHDU (
const String& value);
499 template <
typename S>
500 void write(
const std::vector<long>& first,
502 const std::valarray<S>& data,
506 template <
typename S>
507 void write(
long first,
509 const std::valarray<S>& data,
512 template <
typename S>
513 void write(
const std::vector<long>& first,
515 const std::valarray<S>& data);
518 template <
typename S>
519 void write(
long first,
521 const std::valarray<S>& data);
523 template <
typename S>
524 void write(
const std::vector<long>& firstVertex,
525 const std::vector<long>& lastVertex,
526 const std::valarray<S>& data);
533 template <
typename S>
534 void read (std::valarray<S>& image) ;
537 void read (std::valarray<S>& image,
543 void read (std::valarray<S>& image,
544 const std::vector<long>& first,
549 void read (std::valarray<S>& image,
550 const std::vector<long>& firstVertex,
551 const std::vector<long>& lastVertex,
552 const std::vector<long>& stride) ;
555 void read (std::valarray<S>& image,
560 void read (std::valarray<S>& image,
561 const std::vector<long>& first,
565 void read (std::valarray<S>& image,
566 const std::vector<long>& firstVertex,
567 const std::vector<long>& lastVertex,
568 const std::vector<long>& stride,
582 virtual std::ostream & put (std::ostream &s)
const = 0;
583 virtual void setColumn (
const String& colname,
Column* value);
584 virtual void checkExtensionType ()
const;
596 virtual void initRead () = 0;
597 void checkXtension ();
607 static String s_missHDU;
620 inline bool operator<(
const ExtHDU &left,
const ExtHDU &right)
622 if (left.m_name < right.m_name)
return true;
623 if (left.m_name > right.m_name)
return false;
624 if (left.m_name == right.m_name)
626 if (left.m_version < right.m_version)
return true;
631 inline bool operator>(
const ExtHDU &left,
const ExtHDU &right)
633 return !operator<=(left,right);
636 inline bool operator<=(
const ExtHDU &left,
const ExtHDU &right)
638 if (left.m_name <= right.m_name)
640 if (left.m_version <= right.m_version)
return true;
645 inline bool operator>=(
const ExtHDU &left,
const ExtHDU &right)
647 return !operator<(left,right);
697 inline const String& ExtHDU::missHDU ()
702 inline void ExtHDU::setMissHDU (
const String& value)
Abstract base class for Column objects.
Definition: Column.h:842
Exception to be thrown on unmatched extension types.
Definition: ExtHDU.h:446
WrongExtensionType(const String &msg, bool silent=true)
Exception ctor, prefixes the string "Fits Error: wrong extension type" before the specific message.
Definition: ExtHDU.cxx:42
base class for all FITS extension HDUs, i.e. Image Extensions and Tables.
Definition: ExtHDU.h:439
virtual long getRowsize() const
return the optimal number of rows to read or write at a time
Definition: ExtHDU.cxx:290
virtual void readData(bool readFlag=false, const std::vector< String > &keys=std::vector< String >())=0
read data from HDU depending on readFlag and keys.
const String & name() const
return the name of the extension.
Definition: ExtHDU.h:651
virtual void addColumn(ValueType type, const String &columnName, long repeatWidth, const String &colUnit=String(""), long decimals=-1, size_t columnNumber=0)
add a new column to an existing table HDU.
Definition: ExtHDU.cxx:248
void read(std::valarray< S > &image)
Read image data into container.
Definition: ExtHDUT.h:18
virtual int numCols() const
return the number of Columns in the Table (the TFIELDS keyword).
Definition: ExtHDU.cxx:298
virtual void makeThisCurrent() const
move the fitsfile pointer to this current HDU.
Definition: ExtHDU.cxx:208
virtual void copyColumn(const Column &inColumn, int colIndx, bool insertNewCol=true)
copy a column (from different or same HDU and file) into an existing table HDU.
Definition: ExtHDU.cxx:255
bool isCompressed() const
return true if image is stored using compression.
Definition: ExtHDU.cxx:312
ExtHDU(const ExtHDU &right)
copy constructor
Definition: ExtHDU.cxx:53
HduType xtension() const
return the extension type
Definition: ExtHDU.h:687
static void readHduName(const fitsfile *fptr, int hduIndex, String &hduName, int &hduVersion)
read extension name.
Definition: ExtHDU.cxx:148
virtual ~ExtHDU()
destructor
Definition: ExtHDU.cxx:131
virtual void deleteColumn(const String &columnName)
delete a column in a Table extension by name.
Definition: ExtHDU.cxx:260
void write(const std::vector< long > &first, long nElements, const std::valarray< S > &data, S *nullValue)
Write a set of pixels to an image extension with the first pixel specified by an n-tuple,...
Definition: ExtHDUT.h:426
long pcount() const
return required pcount keyword value
Definition: ExtHDU.h:657
long gcount() const
return required gcount keyword value
Definition: ExtHDU.h:667
virtual HDU * clone(FITS *p) const =0
virtual copy constructor
int version() const
return the extension version number.
Definition: ExtHDU.h:677
virtual const ColMap & column() const
return a reference to the multimap containing the columns.
Definition: ExtHDU.cxx:306
virtual long rows() const
return the number of rows in the extension.
Definition: ExtHDU.cxx:235
Memory object representation of a disk FITS file.
Definition: FITS.h:629
FitsException is the base class for all exceptions thrown by this library.
Definition: FitsError.h:94
Base class for all HDU [Header-Data Unit] objects.
Definition: HDU.h:674
long bitpix() const
return the data type keyword.
Definition: HDU.h:998
long axes() const
return the number of axes in the HDU data section (always 2 for tables).
Definition: HDU.h:978
Namespace enclosing all CCfits classes and globals definitions.
Definition: AsciiTable.cxx:26
ValueType
CCfits value types and their CFITSIO equivalents (in caps)
Definition: CCfits.h:81
std::multimap< std::string, CCfits::Column * > ColMap
Type definition for a table's column container.
Definition: CCfits.h:142