21 #include "HDUCreator.h"
23 #include "FitsError.h"
34 # include <sys/stat.h>
678 NoSuchHDU (
const String& diag,
bool silent =
true);
702 CantOpen (
const String& diag,
bool silent =
true);
713 CantCreate (
const String& diag,
bool silent =
false);
720 FITS (
const String &
name, RWmode mode = Read,
bool readDataFlag =
false,
const std::vector<String>& primaryKeys = std::vector<String>());
724 FITS (
const String &name, RWmode mode,
const string &hduName,
bool readDataFlag =
false,
const std::vector<String>& hduKeys = std::vector<String>(),
const std::vector<String>& primaryKey = std::vector<String>(),
int version = 1);
728 FITS (
const String &name, RWmode mode,
const std::vector<String>& hduNames,
bool readDataFlag =
false,
const std::vector<String>& primaryKey = std::vector<String>());
731 FITS (
const String& fileName,
const FITS& source);
735 FITS (
const String &name, RWmode mode,
const std::vector<String>& hduNames,
const std::vector<std::vector<String> >& hduKeys,
bool readDataFlag =
false,
const std::vector<String>& primaryKeys = std::vector<String>(),
const std::vector<int>& hduVersions = std::vector<int>());
738 FITS (
const String& name,
int bitpix,
int naxis,
long *naxes);
742 FITS (
const string &name, RWmode mode,
int hduIndex,
bool readDataFlag =
false,
const std::vector<String>& hduKeys = std::vector<String>(),
const std::vector<String>& primaryKey = std::vector<String>());
749 FITS (
const String &name, RWmode mode,
const std::vector<String>& searchKeys,
const std::vector<String> &searchValues,
bool readDataFlag =
false,
const std::vector<String>& hduKeys = std::vector<String>(),
const std::vector<String>& primaryKey = std::vector<string>(),
int version = 1);
755 void read (
const String &hduName,
bool readDataFlag =
false,
const std::vector<String> &keys = std::vector<String>(),
int version = 1);
758 void read (
const std::vector<String> &hduNames,
bool readDataFlag =
false);
760 void read (
const std::vector<String> &hduNames,
const std::vector<std::vector<String> > &keys,
bool readDataFlag =
false,
const std::vector<int>& hduVersions = std::vector<int>());
762 void read (
int hduIndex,
764 bool readDataFlag =
false,
const std::vector<String> &keys = std::vector<String>());
771 void read (
const std::vector<String>& searchKeys,
const std::vector<String> &searchValues,
bool readDataFlag =
false,
const std::vector<String>& hduKeys = std::vector<String>(),
int version = 1);
775 const ExtHDU&
extension (
const String& hduName,
int version = 1)
const;
779 friend std::ostream& operator << (std::ostream& s,
const FITS& right);
782 const std::vector<String>& columnName = std::vector<String>(),
783 const std::vector<String>& columnFmt = std::vector<String>(),
784 const std::vector<String>& columnUnit = std::vector<String>(),
785 HduType type = BinaryTbl,
int version = 1);
787 ExtHDU*
addImage (
const String& hduName,
int bpix, std::vector<long>& naxes,
int version = 1);
796 const String& name () const;
798 Table&
filter (const String& expression,
ExtHDU& inputTable,
bool overwrite = true,
bool readData = false);
818 FITS & operator=(const
FITS &right);
820 void unmapExtension (
ExtHDU& doomed);
821 int nextVersionNumber (const String& inputName) const;
824 void read (
bool readDataFlag = false, const std::vector<String>& keys = std::vector<String>());
827 int open (RWmode mode = Read);
837 int close () throw ();
838 std::ostream & put (std::ostream &s) const;
839 ExtHDU& extbyVersion (const String& hduName,
int version) const;
841 void readExtensions (
bool readDataFlag = false);
843 void swap (
FITS& right);
844 ExtMap& extensionMap ();
845 String nameOfUnmapped (
int hduNum) const;
846 void cloneHeader (const
ExtHDU& source);
853 ExtHDU* checkAlreadyRead(const
int hduIdx,
854 const String& hduName =
string(""), const
int version=1) const throw();
860 static
bool s_verboseMode;
863 FITSBase* m_FITSImpl;
866 friend
void HDU::makeThisCurrent() const;
882 return extbyVersion(hduName,version);
885 inline std::ostream& operator << (std::ostream& s,
const FITS& right)
893 return s_verboseMode;
898 s_verboseMode = value;
fitsfile * fitsPointer() const
return the CFITSIO fitsfile pointer for this FITS object
Definition: FITS.cxx:791
CantOpen(const String &diag, bool silent=true)
Exception ctor prefixes the string: "FITS Error: Cannot create file " before specific message...
Definition: FITS.cxx:67
int getCompressionType() const
Get the int specifying the compression algorithm to be used when adding an image extension.
Definition: FITS.cxx:1422
void setCompressionType(int compType)
set the compression algorithm to be used when adding image extensions to the FITS object...
Definition: FITS.cxx:1391
thrown on failure to open existing file
Definition: FITS.h:699
Table * addTable(const String &hduName, int rows, const std::vector< String > &columnName=std::vector< String >(), const std::vector< String > &columnFmt=std::vector< String >(), const std::vector< String > &columnUnit=std::vector< String >(), HduType type=BinaryTbl, int version=1)
Add a table extension to an existing FITS object. Add extension to FITS object for file with w or rw ...
Definition: FITS.cxx:915
void getTileDimensions(std::vector< long > &tileSizes) const
Get the current settings of dimension sizes for tiles used in image compression.
Definition: FITS.cxx:1433
void resetPosition()
explicit call to set the fits file pointer to the primary.
Definition: FITS.cxx:1036
void setNoiseBits(int noiseBits)
Set the cfitsio noisebits parameter used when compressing floating-point images.
Definition: FITS.cxx:1413
OperationNotSupported(const String &msg, bool silent=true)
Exception ctor, prefixes the string "FITS Error: Operation not supported:" before the specific messag...
Definition: FITS.cxx:57
ExtHDU & currentExtension()
return a non-const reference to whichever is the current extension.
Definition: FITS.cxx:1250
ExtHDU * addImage(const String &hduName, int bpix, std::vector< long > &naxes, int version=1)
Add an image extension to an existing FITS object. (File with w or rw access).
Definition: FITS.cxx:947
void destroy()
Erase FITS object and close corresponding file.
Definition: FITS.cxx:984
static bool verboseMode()
return verbose setting for library
Definition: FITS.h:891
Base class for all HDU [Header-Data Unit] objects.
Definition: HDU.h:543
thrown for unsupported operations, such as attempted to select rows from an image extension...
Definition: FITS.h:687
CantCreate(const String &diag, bool silent=false)
Exception ctor prefixes the string: "FITS Error: Cannot create file " before specific message...
Definition: FITS.cxx:77
static void clearErrors()
clear the error stack and set status to zero.
Definition: FITS.cxx:386
Memory object representation of a disk FITS file.
Definition: FITS.h:668
FitsException is the base class for all exceptions thrown by this library.
Definition: FitsError.h:93
Table & filter(const String &expression, ExtHDU &inputTable, bool overwrite=true, bool readData=false)
Filter the rows of the inputTable with the condition expression, and return a reference to the result...
Definition: FITS.cxx:1118
base class for all FITS extension HDUs, i.e. Image Extensions and Tables.
Definition: ExtHDU.h:421
static void setVerboseMode(bool value)
set verbose setting for library
Definition: FITS.h:896
const String & name() const
return filename of file corresponding to FITS object
Definition: FITS.cxx:1048
void read(const String &hduName, bool readDataFlag=false, const std::vector< String > &keys=std::vector< String >(), int version=1)
get data from single HDU from disk file.
Definition: FITS.cxx:441
thrown on failure to create new file
Definition: FITS.h:711
const PHDU & pHDU() const
return a const reference to the primary HDU.
Definition: FITS.cxx:829
NoSuchHDU(const String &diag, bool silent=true)
Exception ctor, prefixes the string "FITS Error: Cannot read HDU in FITS file:" before the specific m...
Definition: FITS.cxx:46
void setTileDimensions(const std::vector< long > &tileSizes)
Set the dimensions of the tiles into which the image is divided during compression.
Definition: FITS.cxx:1400
void flush()
flush buffer contents to disk
Definition: FITS.cxx:1001
class representing the primary HDU for a FITS file.
Definition: PHDU.h:267
void deleteExtension(const String &doomed, int version=1)
Delete extension specified by name and version number.
Definition: FITS.cxx:391
FITS(const String &name, RWmode mode=Read, bool readDataFlag=false, const std::vector< String > &primaryKeys=std::vector< String >())
basic constructor
Definition: FITS.cxx:88
const ExtMap & extension() const
return const reference to the extension container
Definition: FITS.cxx:1030
~FITS()
destructor
Definition: FITS.cxx:351
const String & currentExtensionName() const
return the name of the extension that the fitsfile is currently addressing.
Definition: FITS.cxx:1007
exception thrown by HDU retrieval methods.
Definition: FITS.h:675
void copy(const HDU &source)
copy the HDU source into the FITS object.
Definition: FITS.cxx:1054
int getNoiseBits() const
Get the cfitsio noisebits parameter used when compressing floating-point images.
Definition: FITS.cxx:1451