<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>CCfits: FITS.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.6.1 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> </ul> </div> <h1>FITS.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// Read the documentation to learn more about C++ code generator</span> <a name="l00002"></a>00002 <span class="comment">// versioning.</span> <a name="l00003"></a>00003 <span class="comment">// This is version 2.2 release dated Sep 2009</span> <a name="l00004"></a>00004 <span class="comment">// Astrophysics Science Division,</span> <a name="l00005"></a>00005 <span class="comment">// NASA/ Goddard Space Flight Center</span> <a name="l00006"></a>00006 <span class="comment">// HEASARC</span> <a name="l00007"></a>00007 <span class="comment">// http://heasarc.gsfc.nasa.gov</span> <a name="l00008"></a>00008 <span class="comment">// e-mail: ccfits@legacy.gsfc.nasa.gov</span> <a name="l00009"></a>00009 <span class="comment">//</span> <a name="l00010"></a>00010 <span class="comment">// Original author: Ben Dorman</span> <a name="l00011"></a>00011 <a name="l00012"></a>00012 <span class="preprocessor">#ifndef FITS_H</span> <a name="l00013"></a>00013 <span class="preprocessor"></span><span class="preprocessor">#define FITS_H 1</span> <a name="l00014"></a>00014 <span class="preprocessor"></span> <a name="l00015"></a>00015 <span class="comment">// exception</span> <a name="l00016"></a>00016 <span class="preprocessor">#include <exception></span> <a name="l00017"></a>00017 <span class="comment">// string</span> <a name="l00018"></a>00018 <span class="preprocessor">#include <string></span> <a name="l00019"></a>00019 <span class="comment">// map</span> <a name="l00020"></a>00020 <span class="preprocessor">#include <map></span> <a name="l00021"></a>00021 <span class="comment">// ExtHDU</span> <a name="l00022"></a>00022 <span class="preprocessor">#include "ExtHDU.h"</span> <a name="l00023"></a>00023 <span class="comment">// HDUCreator</span> <a name="l00024"></a>00024 <span class="preprocessor">#include "HDUCreator.h"</span> <a name="l00025"></a>00025 <span class="comment">// FitsError</span> <a name="l00026"></a>00026 <span class="preprocessor">#include "FitsError.h"</span> <a name="l00027"></a>00027 <a name="l00028"></a>00028 <span class="keyword">namespace </span>CCfits { <a name="l00029"></a>00029 <span class="keyword">class </span>FITSBase; <a name="l00030"></a>00030 <span class="keyword">class </span>PHDU; <a name="l00031"></a>00031 <span class="keyword">class </span>Table; <a name="l00032"></a>00032 <a name="l00033"></a>00033 } <span class="comment">// namespace CCfits</span> <a name="l00034"></a>00034 <span class="comment">//class PHDU;</span> <a name="l00035"></a>00035 <span class="keyword">extern</span> <span class="stringliteral">"C"</span> <a name="l00036"></a>00036 { <a name="l00037"></a>00037 <span class="preprocessor"># include <sys/stat.h></span> <a name="l00038"></a>00038 } <a name="l00039"></a>00039 <span class="preprocessor">#include <memory></span> <a name="l00040"></a>00040 <a name="l00041"></a>00041 <a name="l00042"></a>00042 <span class="keyword">namespace </span>CCfits { <a name="l00658"></a>00658 <span class="comment">// ! The FITS object class. Contains a primary HDU and Extensions indexed by name.</span> <a name="l00659"></a>00659 <a name="l00660"></a>00660 <a name="l00661"></a>00661 <a name="l00662"></a><a class="code" href="classCCfits_1_1FITS.html">00662</a> <span class="keyword">class </span><a class="code" href="classCCfits_1_1FITS.html" title="Memory object representation of a disk FITS file.">FITS</a> <a name="l00663"></a>00663 { <a name="l00664"></a>00664 <a name="l00665"></a>00665 <span class="keyword">public</span>: <a name="l00666"></a>00666 <a name="l00667"></a>00667 <a name="l00668"></a>00668 <a name="l00669"></a><a class="code" href="classCCfits_1_1FITS_1_1NoSuchHDU.html">00669</a> <span class="keyword">class </span><a class="code" href="classCCfits_1_1FITS_1_1NoSuchHDU.html" title="exception thrown by HDU retrieval methods.">NoSuchHDU</a> : <span class="keyword">public</span> <a class="code" href="classCCfits_1_1FitsException.html" title="FitsException is the base class for all exceptions thrown by this library.">FitsException</a> <span class="comment">//## Inherits: <unnamed>%396C90CB0236</span> <a name="l00670"></a>00670 { <a name="l00671"></a>00671 <span class="keyword">public</span>: <a name="l00672"></a>00672 <a class="code" href="classCCfits_1_1FITS_1_1NoSuchHDU.html#a31041cf0343276271be5093265cb0694" title="Exception ctor, prefixes the string &quot;FITS Error: Cannot read HDU in FITS file:&quot;...">NoSuchHDU</a> (<span class="keyword">const</span> String& diag, <span class="keywordtype">bool</span> silent = <span class="keyword">true</span>); <a name="l00673"></a>00673 <a name="l00674"></a>00674 <span class="keyword">protected</span>: <a name="l00675"></a>00675 <span class="keyword">private</span>: <a name="l00676"></a>00676 <span class="keyword">private</span>: <span class="comment">//## implementation</span> <a name="l00677"></a>00677 }; <a name="l00678"></a>00678 <a name="l00679"></a>00679 <a name="l00680"></a>00680 <a name="l00681"></a><a class="code" href="classCCfits_1_1FITS_1_1OperationNotSupported.html">00681</a> <span class="keyword">class </span><a class="code" href="classCCfits_1_1FITS_1_1OperationNotSupported.html" title="thrown for unsupported operations, such as attempted to select rows from an image...">OperationNotSupported</a> : <span class="keyword">public</span> <a class="code" href="classCCfits_1_1FitsException.html" title="FitsException is the base class for all exceptions thrown by this library.">FitsException</a> <span class="comment">//## Inherits: <unnamed>%39806C7600D5</span> <a name="l00682"></a>00682 { <a name="l00683"></a>00683 <span class="keyword">public</span>: <a name="l00684"></a>00684 <a class="code" href="classCCfits_1_1FITS_1_1OperationNotSupported.html#ac22e7f9c90baefeaae301e82c7f6c95f" title="Exception ctor, prefixes the string &quot;FITS Error: Operation not supported:&quot;...">OperationNotSupported</a> (<span class="keyword">const</span> String& msg, <span class="keywordtype">bool</span> silent = <span class="keyword">true</span>); <a name="l00685"></a>00685 <a name="l00686"></a>00686 <span class="keyword">protected</span>: <a name="l00687"></a>00687 <span class="keyword">private</span>: <a name="l00688"></a>00688 <span class="keyword">private</span>: <span class="comment">//## implementation</span> <a name="l00689"></a>00689 }; <a name="l00690"></a>00690 <a name="l00691"></a>00691 <a name="l00692"></a>00692 <a name="l00693"></a><a class="code" href="classCCfits_1_1FITS_1_1CantOpen.html">00693</a> <span class="keyword">class </span><a class="code" href="classCCfits_1_1FITS_1_1CantOpen.html" title="thrown on failure to open existing file">CantOpen</a> : <span class="keyword">public</span> <a class="code" href="classCCfits_1_1FitsException.html" title="FitsException is the base class for all exceptions thrown by this library.">FitsException</a> <span class="comment">//## Inherits: <unnamed>%39C8EB1D02C0</span> <a name="l00694"></a>00694 { <a name="l00695"></a>00695 <span class="keyword">public</span>: <a name="l00696"></a>00696 <a class="code" href="classCCfits_1_1FITS_1_1CantOpen.html#ac51f3d69a93cfbf1e14990e314d92df9" title="Exception ctor prefixes the string: &quot;FITS Error: Cannot create file &quot; before...">CantOpen</a> (<span class="keyword">const</span> String& diag, <span class="keywordtype">bool</span> silent = <span class="keyword">true</span>); <a name="l00697"></a>00697 <a name="l00698"></a>00698 <span class="keyword">protected</span>: <a name="l00699"></a>00699 <span class="keyword">private</span>: <a name="l00700"></a>00700 <span class="keyword">private</span>: <span class="comment">//## implementation</span> <a name="l00701"></a>00701 }; <a name="l00702"></a>00702 <a name="l00703"></a>00703 <a name="l00704"></a>00704 <a name="l00705"></a><a class="code" href="structCCfits_1_1FITS_1_1CantCreate.html">00705</a> <span class="keyword">struct </span><a class="code" href="structCCfits_1_1FITS_1_1CantCreate.html" title="thrown on failure to create new file">CantCreate</a> : <span class="keyword">public</span> <a class="code" href="classCCfits_1_1FitsException.html" title="FitsException is the base class for all exceptions thrown by this library.">FitsException</a> <span class="comment">//## Inherits: <unnamed>%39C8EB10020B</span> <a name="l00706"></a>00706 { <a name="l00707"></a>00707 <a class="code" href="structCCfits_1_1FITS_1_1CantCreate.html#a9c7e9923d86095cb065ba3be679edc44" title="Exception ctor prefixes the string: &quot;FITS Error: Cannot create file &quot; before...">CantCreate</a> (<span class="keyword">const</span> String& diag, <span class="keywordtype">bool</span> silent = <span class="keyword">false</span>); <a name="l00708"></a>00708 <a name="l00709"></a>00709 <span class="keyword">public</span>: <a name="l00710"></a>00710 <span class="keyword">protected</span>: <a name="l00711"></a>00711 <span class="keyword">private</span>: <a name="l00712"></a>00712 <span class="keyword">private</span>: <span class="comment">//## implementation</span> <a name="l00713"></a>00713 }; <a name="l00714"></a>00714 <a class="code" href="classCCfits_1_1FITS.html#a913bc6d48a4ff69013e49e1ae4fbb696" title="basic constructor">FITS</a> (<span class="keyword">const</span> String &<a class="code" href="classCCfits_1_1FITS.html#a46ee9a7cb851501eb921149f1173d11d" title="return filename of file corresponding to FITS object">name</a>, RWmode mode = Read, <span class="keywordtype">bool</span> readDataFlag = <span class="keyword">false</span>, <span class="keyword">const</span> std::vector<String>& primaryKeys = std::vector<String>()); <a name="l00715"></a>00715 <span class="comment">// Open a file and read a specified HDU.</span> <a name="l00716"></a>00716 <span class="comment">//</span> <a name="l00717"></a>00717 <span class="comment">// Optional parameter allows the reading of specified primary HDU keys.</span> <a name="l00718"></a>00718 <a class="code" href="classCCfits_1_1FITS.html#a913bc6d48a4ff69013e49e1ae4fbb696" title="basic constructor">FITS</a> (<span class="keyword">const</span> String &name, RWmode mode, <span class="keyword">const</span> <span class="keywordtype">string</span> &hduName, <span class="keywordtype">bool</span> readDataFlag = <span class="keyword">false</span>, <span class="keyword">const</span> std::vector<String>& hduKeys = std::vector<String>(), <span class="keyword">const</span> std::vector<String>& primaryKey = std::vector<String>(), <span class="keywordtype">int</span> version = 1); <a name="l00719"></a>00719 <span class="comment">// Read data from a set of specified HDUs. keywords can only be specified for the primary here.</span> <a name="l00720"></a>00720 <span class="comment">// The code will call a different constructor for the case where keywords are required for</span> <a name="l00721"></a>00721 <span class="comment">// the extensions.</span> <a name="l00722"></a>00722 <a class="code" href="classCCfits_1_1FITS.html#a913bc6d48a4ff69013e49e1ae4fbb696" title="basic constructor">FITS</a> (<span class="keyword">const</span> String &name, RWmode mode, <span class="keyword">const</span> std::vector<String>& hduNames, <span class="keywordtype">bool</span> readDataFlag = <span class="keyword">false</span>, <span class="keyword">const</span> std::vector<String>& primaryKey = std::vector<String>()); <a name="l00723"></a>00723 <span class="comment">// Initialize a new FITS file object with the primary from a</span> <a name="l00724"></a>00724 <span class="comment">// different file.</span> <a name="l00725"></a>00725 <a class="code" href="classCCfits_1_1FITS.html#a913bc6d48a4ff69013e49e1ae4fbb696" title="basic constructor">FITS</a> (<span class="keyword">const</span> String& fileName, <span class="keyword">const</span> <a class="code" href="classCCfits_1_1FITS.html" title="Memory object representation of a disk FITS file.">FITS</a>& source); <a name="l00726"></a>00726 <span class="comment">// Fully general FITS HDU reader. May read any part of fits file by</span> <a name="l00727"></a>00727 <span class="comment">// supplying HDU names and version numbers, and optionally</span> <a name="l00728"></a>00728 <span class="comment">// the data read flag.</span> <a name="l00729"></a>00729 <a class="code" href="classCCfits_1_1FITS.html#a913bc6d48a4ff69013e49e1ae4fbb696" title="basic constructor">FITS</a> (<span class="keyword">const</span> String &name, RWmode mode, <span class="keyword">const</span> std::vector<String>& hduNames, <span class="keyword">const</span> std::vector<std::vector<String> >& hduKeys, <span class="keywordtype">bool</span> readDataFlag = <span class="keyword">false</span>, <span class="keyword">const</span> std::vector<String>& primaryKeys = std::vector<String>(), <span class="keyword">const</span> std::vector<int>& hduVersions = std::vector<int>()); <a name="l00730"></a>00730 <span class="comment">// Writing constructor. Takes a name and information to create an empty</span> <a name="l00731"></a>00731 <span class="comment">// Primary HDU which can then be filled with calls to HDU methods.</span> <a name="l00732"></a>00732 <a class="code" href="classCCfits_1_1FITS.html#a913bc6d48a4ff69013e49e1ae4fbb696" title="basic constructor">FITS</a> (<span class="keyword">const</span> String& name, <span class="keywordtype">int</span> bitpix, <span class="keywordtype">int</span> naxis, <span class="keywordtype">long</span> *naxes); <a name="l00733"></a>00733 <span class="comment">// Open a file and read a specified HDU.</span> <a name="l00734"></a>00734 <span class="comment">//</span> <a name="l00735"></a>00735 <span class="comment">// Optional parameter allows the reading of specified primary HDU keys.</span> <a name="l00736"></a>00736 <a class="code" href="classCCfits_1_1FITS.html#a913bc6d48a4ff69013e49e1ae4fbb696" title="basic constructor">FITS</a> (<span class="keyword">const</span> <span class="keywordtype">string</span> &name, RWmode mode, <span class="keywordtype">int</span> hduIndex, <span class="keywordtype">bool</span> readDataFlag = <span class="keyword">false</span>, <span class="keyword">const</span> std::vector<String>& hduKeys = std::vector<String>(), <span class="keyword">const</span> std::vector<String>& primaryKey = std::vector<String>()); <a name="l00737"></a>00737 <span class="comment">// Open a file and read a HDU that contains specified</span> <a name="l00738"></a>00738 <span class="comment">// search keywords with [optional] specified values</span> <a name="l00739"></a>00739 <span class="comment">// (sometimes one just wants to know that the keyword is present).</span> <a name="l00740"></a>00740 <span class="comment">//</span> <a name="l00741"></a>00741 <span class="comment">// Optional parameters allows the reading of specified primary HDU keys and specified keywords in</span> <a name="l00742"></a>00742 <span class="comment">// the HDU of interest.</span> <a name="l00743"></a>00743 <a class="code" href="classCCfits_1_1FITS.html#a913bc6d48a4ff69013e49e1ae4fbb696" title="basic constructor">FITS</a> (<span class="keyword">const</span> String &name, RWmode mode, <span class="keyword">const</span> std::vector<String>& searchKeys, <span class="keyword">const</span> std::vector<String> &searchValues, <span class="keywordtype">bool</span> readDataFlag = <span class="keyword">false</span>, <span class="keyword">const</span> std::vector<String>& hduKeys = std::vector<String>(), <span class="keyword">const</span> std::vector<String>& primaryKey = std::vector<string>(), <span class="keywordtype">int</span> version = 1); <a name="l00744"></a>00744 <a class="code" href="classCCfits_1_1FITS.html#a53b2988c54661d9e03af4a152da5dbae" title="destructor">~FITS</a>(); <a name="l00745"></a>00745 <a name="l00746"></a>00746 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classCCfits_1_1FITS.html#a6f151c247fb7d0b13cd7c1d5994417d1" title="clear the error stack and set status to zero.">clearErrors</a> (); <a name="l00747"></a>00747 <span class="keywordtype">void</span> <a class="code" href="classCCfits_1_1FITS.html#aac73f0a1f2742c0f1ea5eeb5bc0f8df5" title="Delete extension specified by name and version number.">deleteExtension</a> (<span class="keyword">const</span> String& doomed, <span class="keywordtype">int</span> version = 1); <a name="l00748"></a>00748 <span class="comment">// Read keys and data from a single ExtHDU in the file.</span> <a name="l00749"></a>00749 <span class="keywordtype">void</span> <a class="code" href="classCCfits_1_1FITS.html#a3640e3ad1c29931b37a13ac91106504e" title="get data from single HDU from disk file.">read</a> (<span class="keyword">const</span> String &hduName, <span class="keywordtype">bool</span> readDataFlag = <span class="keyword">false</span>, <span class="keyword">const</span> std::vector<String> &keys = std::vector<String>(), <span class="keywordtype">int</span> version = 1); <a name="l00750"></a>00750 <span class="comment">// Read multiple ExtHDUs. If the version number needs to be specified then one must call a</span> <a name="l00751"></a>00751 <span class="comment">// different method.</span> <a name="l00752"></a>00752 <span class="keywordtype">void</span> <a class="code" href="classCCfits_1_1FITS.html#a3640e3ad1c29931b37a13ac91106504e" title="get data from single HDU from disk file.">read</a> (<span class="keyword">const</span> std::vector<String> &hduNames, <span class="keywordtype">bool</span> readDataFlag = <span class="keyword">false</span>); <a name="l00753"></a>00753 <span class="comment">// Read selected data from multiple ExtHDUs</span> <a name="l00754"></a>00754 <span class="keywordtype">void</span> <a class="code" href="classCCfits_1_1FITS.html#a3640e3ad1c29931b37a13ac91106504e" title="get data from single HDU from disk file.">read</a> (<span class="keyword">const</span> std::vector<String> &hduNames, <span class="keyword">const</span> std::vector<std::vector<String> > &keys, <span class="keywordtype">bool</span> readDataFlag = <span class="keyword">false</span>, <span class="keyword">const</span> std::vector<int>& hduVersions = std::vector<int>()); <a name="l00755"></a>00755 <span class="comment">// Read keys and data from a single ExtHDU in the file.</span> <a name="l00756"></a>00756 <span class="keywordtype">void</span> <a class="code" href="classCCfits_1_1FITS.html#a3640e3ad1c29931b37a13ac91106504e" title="get data from single HDU from disk file.">read</a> (<span class="keywordtype">int</span> hduIndex, <span class="comment">// Construct and Read HDU specified by number. One can add further HDUs by number using</span> <a name="l00757"></a>00757 <span class="comment">// the HDUCreator factory.</span> <a name="l00758"></a>00758 <span class="keywordtype">bool</span> readDataFlag = <span class="keyword">false</span>, <span class="keyword">const</span> std::vector<String> &keys = std::vector<String>()); <a name="l00759"></a>00759 <span class="comment">// Open a file and read a HDU that contains specified</span> <a name="l00760"></a>00760 <span class="comment">// search keywords with [optional] specified values</span> <a name="l00761"></a>00761 <span class="comment">// (sometimes one just wants to know that the keyword is present).</span> <a name="l00762"></a>00762 <span class="comment">//</span> <a name="l00763"></a>00763 <span class="comment">// Optional parameters allows the reading of specified primary HDU keys and specified keywords in</span> <a name="l00764"></a>00764 <span class="comment">// the HDU of interest.</span> <a name="l00765"></a>00765 <span class="keywordtype">void</span> <a class="code" href="classCCfits_1_1FITS.html#a3640e3ad1c29931b37a13ac91106504e" title="get data from single HDU from disk file.">read</a> (<span class="keyword">const</span> std::vector<String>& searchKeys, <span class="keyword">const</span> std::vector<String> &searchValues, <span class="keywordtype">bool</span> readDataFlag = <span class="keyword">false</span>, <span class="keyword">const</span> std::vector<String>& hduKeys = std::vector<String>(), <span class="keywordtype">int</span> version = 1); <a name="l00766"></a>00766 <span class="keyword">const</span> <a class="code" href="classCCfits_1_1ExtHDU.html" title="base class for all FITS extension HDUs, i.e. Image Extensions and Tables.">ExtHDU</a>& <a class="code" href="classCCfits_1_1FITS.html#a5e4b2efb2d9c75db28fe264cb8576280" title="return const reference to the extension container">extension</a> (<span class="keywordtype">int</span> i) <span class="keyword">const</span>; <a name="l00767"></a>00767 fitsfile* <a class="code" href="classCCfits_1_1FITS.html#a10cc4bf1ef07a50ea79d3bfaa57a844f" title="return the CFITSIO fitsfile pointer for this FITS object">fitsPointer</a> () <span class="keyword">const</span>; <a name="l00768"></a>00768 <a class="code" href="classCCfits_1_1ExtHDU.html" title="base class for all FITS extension HDUs, i.e. Image Extensions and Tables.">ExtHDU</a>& <a class="code" href="classCCfits_1_1FITS.html#a5e4b2efb2d9c75db28fe264cb8576280" title="return const reference to the extension container">extension</a> (<span class="keywordtype">int</span> i); <a name="l00769"></a>00769 <span class="keyword">const</span> <a class="code" href="classCCfits_1_1ExtHDU.html" title="base class for all FITS extension HDUs, i.e. Image Extensions and Tables.">ExtHDU</a>& <a class="code" href="classCCfits_1_1FITS.html#a5e4b2efb2d9c75db28fe264cb8576280" title="return const reference to the extension container">extension</a> (<span class="keyword">const</span> String& hduName, <span class="keywordtype">int</span> version = 1) <span class="keyword">const</span>; <a name="l00770"></a>00770 <span class="keyword">const</span> <a class="code" href="classCCfits_1_1PHDU.html" title="class representing the primary HDU for a FITS file.">PHDU</a>& <a class="code" href="classCCfits_1_1FITS.html#a18d1d822d3eecbf6298f974504863c05" title="return a const reference to the primary HDU.">pHDU</a> () <span class="keyword">const</span>; <a name="l00771"></a>00771 <a class="code" href="classCCfits_1_1PHDU.html" title="class representing the primary HDU for a FITS file.">PHDU</a>& <a class="code" href="classCCfits_1_1FITS.html#a18d1d822d3eecbf6298f974504863c05" title="return a const reference to the primary HDU.">pHDU</a> (); <a name="l00772"></a>00772 <a class="code" href="classCCfits_1_1ExtHDU.html" title="base class for all FITS extension HDUs, i.e. Image Extensions and Tables.">ExtHDU</a>& <a class="code" href="classCCfits_1_1FITS.html#a5e4b2efb2d9c75db28fe264cb8576280" title="return const reference to the extension container">extension</a> (<span class="keyword">const</span> String& hduName, <span class="keywordtype">int</span> version = 1); <a name="l00773"></a>00773 <span class="keyword">friend</span> std::ostream& operator << (std::ostream& s, <span class="keyword">const</span> <a class="code" href="classCCfits_1_1FITS.html" title="Memory object representation of a disk FITS file.">FITS</a>& right); <a name="l00774"></a>00774 <span class="comment">// ! add a new Table extension to a FITS object</span> <a name="l00775"></a>00775 <a class="code" href="classCCfits_1_1Table.html">Table</a>* <a class="code" href="classCCfits_1_1FITS.html#a867732f42c7863550baf28795efc6876" title="Add a table extension to an existing FITS object. Add extension to FITS object for...">addTable</a> (<span class="keyword">const</span> String& hduName, <span class="keywordtype">int</span> rows, <span class="comment">// ! Number of rows in new table. Mandatory</span> <a name="l00776"></a>00776 <span class="keyword">const</span> std::vector<String>& columnName = std::vector<String>(), <span class="comment">// ! Optional set of column names for new table</span> <a name="l00777"></a>00777 <span class="keyword">const</span> std::vector<String>& columnFmt = std::vector<String>(), <span class="comment">// ! Column formats for column units. Mandatory if columnName is specified</span> <a name="l00778"></a>00778 <span class="keyword">const</span> std::vector<String>& columnUnit = std::vector<String>(), <span class="comment">// ! Column formats for column units. Optional</span> <a name="l00779"></a>00779 HduType type = BinaryTbl, <span class="keywordtype">int</span> version = 1); <a name="l00780"></a>00780 <span class="comment">// ! add a new ImageExt (image extension) to the FITS object. A "writing" method.</span> <a name="l00781"></a>00781 <a class="code" href="classCCfits_1_1ExtHDU.html" title="base class for all FITS extension HDUs, i.e. Image Extensions and Tables.">ExtHDU</a>* <a class="code" href="classCCfits_1_1FITS.html#afe53063dd05cf44654a311e5d17d4da8" title="Add an image extension to an existing FITS object. (File with w or rw access).">addImage</a> (<span class="keyword">const</span> String& hduName, <span class="keywordtype">int</span> bpix, std::vector<long>& naxes, <span class="keywordtype">int</span> version = 1); <a name="l00782"></a>00782 <span class="comment">// Force destruction of the FITS object. Essentially</span> <a name="l00783"></a>00783 <span class="comment">// is a manual destructor call.</span> <a name="l00784"></a>00784 <span class="keywordtype">void</span> <a class="code" href="classCCfits_1_1FITS.html#afbc014a0dd8bfcc9d883e550f971f669" title="Erase FITS object and close corresponding file.">destroy</a> () throw (); <a name="l00785"></a>00785 <span class="keywordtype">void</span> <a class="code" href="classCCfits_1_1FITS.html#a2df185878082d2dabe76f3f25600311b" title="flush buffer contents to disk">flush</a> (); <a name="l00786"></a>00786 const String& <a class="code" href="classCCfits_1_1FITS.html#afc795a249942094157a54fedb6325eb0" title="return the name of the extension that the fitsfile is currently addressing.">currentExtensionName</a> () const; <a name="l00787"></a>00787 const ExtMap& <a class="code" href="classCCfits_1_1FITS.html#a5e4b2efb2d9c75db28fe264cb8576280" title="return const reference to the extension container">extension</a> () const; <a name="l00788"></a>00788 <span class="keywordtype">void</span> <a class="code" href="classCCfits_1_1FITS.html#a9d5050b4a572ea98e0c830295894c142" title="explicit call to set the fits file pointer to the primary.">resetPosition</a> (); <a name="l00789"></a>00789 <span class="keywordtype">void</span> <a class="code" href="classCCfits_1_1FITS.html#afc795a249942094157a54fedb6325eb0" title="return the name of the extension that the fitsfile is currently addressing.">currentExtensionName</a> (const String& extName); <a name="l00790"></a>00790 const String& name () const; <a name="l00791"></a>00791 <span class="keywordtype">void</span> <a class="code" href="classCCfits_1_1FITS.html#a80ed085f917280e58c6bddf95de93c3c" title="copy the HDU source into the FITS object.">copy</a> (const <a class="code" href="classCCfits_1_1HDU.html" title="Base class for all HDU [Header-Data Unit] objects.">HDU</a>& source); <a name="l00792"></a>00792 <a class="code" href="classCCfits_1_1Table.html">Table</a>& <a class="code" href="classCCfits_1_1FITS.html#add1f740bb5706da76773951cbb1f5f89" title="Filter the rows of the inputTable with the condition expression, and return a reference...">filter</a> (const String& expression, <a class="code" href="classCCfits_1_1ExtHDU.html" title="base class for all FITS extension HDUs, i.e. Image Extensions and Tables.">ExtHDU</a>& inputTable, <span class="keywordtype">bool</span> overwrite = true, <span class="keywordtype">bool</span> readData = false); <a name="l00793"></a>00793 <a class="code" href="classCCfits_1_1ExtHDU.html" title="base class for all FITS extension HDUs, i.e. Image Extensions and Tables.">ExtHDU</a>& <a class="code" href="classCCfits_1_1FITS.html#a7d675f1654f0678461bac0d47e202d49" title="return a non-const reference to whichever is the current extension.">currentExtension</a> (); <a name="l00794"></a>00794 <span class="keywordtype">void</span> <a class="code" href="classCCfits_1_1FITS.html#aac73f0a1f2742c0f1ea5eeb5bc0f8df5" title="Delete extension specified by name and version number.">deleteExtension</a> (<span class="keywordtype">int</span> doomed); <a name="l00795"></a>00795 <span class="keywordtype">void</span> <a class="code" href="classCCfits_1_1FITS.html#ad65169c171ad79257367716d8f93b3f2" title="set the compression algorithm to be used when adding image extensions to the FITS...">setCompressionType</a> (<span class="keywordtype">int</span> compType); <a name="l00796"></a>00796 <span class="keywordtype">void</span> <a class="code" href="classCCfits_1_1FITS.html#aa0bfb6b1a6dc55c585482ba703773f50" title="Set the dimensions of the tiles into which the image is divided during compression...">setTileDimensions</a> (const std::vector<<span class="keywordtype">long</span>>& tileSizes); <a name="l00797"></a>00797 <span class="keywordtype">void</span> <a class="code" href="classCCfits_1_1FITS.html#a224f6b22c1c3129c07c077d4b5617d2f" title="Set the cfitsio noisebits parameter used when compressing floating-point images.">setNoiseBits</a> (<span class="keywordtype">int</span> noiseBits); <a name="l00798"></a>00798 <span class="keywordtype">int</span> <a class="code" href="classCCfits_1_1FITS.html#a785184269e4cdf607cb844b5b45ad105" title="Get the int specifying the compression algorithm to be used when adding an image...">getCompressionType</a> () const; <a name="l00799"></a>00799 <span class="keywordtype">void</span> <a class="code" href="classCCfits_1_1FITS.html#a879b8f7cb81cfbc781e8a7b6c6982ca9" title="Get the current settings of dimension sizes for tiles used in image compression.">getTileDimensions</a> (std::vector<<span class="keywordtype">long</span>>& tileSizes) const; <a name="l00800"></a>00800 <span class="keywordtype">int</span> <a class="code" href="classCCfits_1_1FITS.html#a4af2b8fb489f7fbfeabc1a381c94834c" title="Get the cfitsio noisebits parameter used when compressing floating-point images.">getNoiseBits</a> () const; <a name="l00801"></a>00801 static <span class="keywordtype">bool</span> <a class="code" href="classCCfits_1_1FITS.html#ac897e39e93234792d519913e656be5fc" title="return verbose setting for library">verboseMode</a> (); <a name="l00802"></a>00802 static <span class="keywordtype">void</span> <a class="code" href="classCCfits_1_1FITS.html#ab0e7b06ebbb6097ed6fa2fd555af4ca3" title="set verbose setting for library">setVerboseMode</a> (<span class="keywordtype">bool</span> value); <a name="l00803"></a>00803 <a name="l00804"></a>00804 public: <a name="l00805"></a>00805 <span class="comment">// Additional Public Declarations</span> <a name="l00806"></a>00806 <a name="l00807"></a>00807 protected: <a name="l00808"></a>00808 <span class="comment">// Additional Protected Declarations</span> <a name="l00809"></a>00809 <a name="l00810"></a>00810 private: <a name="l00811"></a>00811 <a class="code" href="classCCfits_1_1FITS.html" title="Memory object representation of a disk FITS file.">FITS</a>(const <a class="code" href="classCCfits_1_1FITS.html" title="Memory object representation of a disk FITS file.">FITS</a> &right); <a name="l00812"></a>00812 <a class="code" href="classCCfits_1_1FITS.html" title="Memory object representation of a disk FITS file.">FITS</a> & operator=(const <a class="code" href="classCCfits_1_1FITS.html" title="Memory object representation of a disk FITS file.">FITS</a> &right); <a name="l00813"></a>00813 <a name="l00814"></a>00814 <span class="keywordtype">void</span> unmapExtension (<a class="code" href="classCCfits_1_1ExtHDU.html" title="base class for all FITS extension HDUs, i.e. Image Extensions and Tables.">ExtHDU</a>& doomed); <a name="l00815"></a>00815 <span class="keywordtype">int</span> nextVersionNumber (const String& inputName) const; <a name="l00816"></a>00816 <span class="comment">// read the primary HDU. Read the image if</span> <a name="l00817"></a>00817 <span class="comment">// readDataFlag is true.</span> <a name="l00818"></a>00818 <span class="keywordtype">void</span> <a class="code" href="classCCfits_1_1FITS.html#a3640e3ad1c29931b37a13ac91106504e" title="get data from single HDU from disk file.">read</a> (<span class="keywordtype">bool</span> readDataFlag = false, const std::vector<String>& keys = std::vector<String>()); <a name="l00819"></a>00819 <span class="comment">// Returns index of current HDU where primary = 0. (Extended file syntax may cause a shift to an</span> <a name="l00820"></a>00820 <span class="comment">// extension.)</span> <a name="l00821"></a>00821 <span class="keywordtype">int</span> open (RWmode mode = Read); <a name="l00822"></a>00822 <span class="comment">// Create returns true if a new file was created or an</span> <a name="l00823"></a>00823 <span class="comment">// existing file overwritten, false if appending.</span> <a name="l00824"></a>00824 <span class="comment">//</span> <a name="l00825"></a>00825 <span class="comment">//</span> <a name="l00826"></a>00826 <span class="comment">// It throws exception CantCreate or CantOpen if either fails.</span> <a name="l00827"></a>00827 <span class="keywordtype">bool</span> create (); <a name="l00828"></a>00828 <span class="comment">// Close the fits file.</span> <a name="l00829"></a>00829 <span class="comment">//</span> <a name="l00830"></a>00830 <span class="comment">// Called in destructors so must not throw.</span> <a name="l00831"></a>00831 <span class="keywordtype">int</span> close () throw (); <a name="l00832"></a>00832 std::ostream & put (std::ostream &s) const; <a name="l00833"></a>00833 <a class="code" href="classCCfits_1_1ExtHDU.html" title="base class for all FITS extension HDUs, i.e. Image Extensions and Tables.">ExtHDU</a>& extbyVersion (const String& hduName, <span class="keywordtype">int</span> version) const; <a name="l00834"></a>00834 <span class="keywordtype">void</span> <a class="code" href="classCCfits_1_1FITS.html#a18d1d822d3eecbf6298f974504863c05" title="return a const reference to the primary HDU.">pHDU</a> (<a class="code" href="classCCfits_1_1PHDU.html" title="class representing the primary HDU for a FITS file.">PHDU</a>* value); <a name="l00835"></a>00835 <span class="keywordtype">void</span> readExtensions (<span class="keywordtype">bool</span> readDataFlag = false); <a name="l00836"></a>00836 <a class="code" href="classCCfits_1_1ExtHDU.html" title="base class for all FITS extension HDUs, i.e. Image Extensions and Tables.">ExtHDU</a>* addExtension (<a class="code" href="classCCfits_1_1ExtHDU.html" title="base class for all FITS extension HDUs, i.e. Image Extensions and Tables.">ExtHDU</a>* ext); <a name="l00837"></a>00837 <span class="keywordtype">void</span> swap (<a class="code" href="classCCfits_1_1FITS.html" title="Memory object representation of a disk FITS file.">FITS</a>& right); <a name="l00838"></a>00838 ExtMap& extensionMap (); <a name="l00839"></a>00839 String nameOfUnmapped (<span class="keywordtype">int</span> hduNum) const; <a name="l00840"></a>00840 <span class="keywordtype">void</span> cloneHeader (const <a class="code" href="classCCfits_1_1ExtHDU.html" title="base class for all FITS extension HDUs, i.e. Image Extensions and Tables.">ExtHDU</a>& source); <a name="l00841"></a>00841 <a name="l00842"></a>00842 <span class="comment">// Additional Private Declarations</span> <a name="l00843"></a>00843 <a name="l00844"></a>00844 private: <span class="comment">//## implementation</span> <a name="l00845"></a>00845 <span class="comment">// Data Members for Class Attributes</span> <a name="l00846"></a>00846 static <span class="keywordtype">bool</span> s_verboseMode; <a name="l00847"></a>00847 <a name="l00848"></a>00848 <span class="comment">// Data Members for Associations</span> <a name="l00849"></a>00849 FITSBase* m_FITSImpl; <a name="l00850"></a>00850 <a name="l00851"></a>00851 <span class="comment">// Additional Implementation Declarations</span> <a name="l00852"></a>00852 friend <span class="keywordtype">void</span> <a class="code" href="classCCfits_1_1HDU.html" title="Base class for all HDU [Header-Data Unit] objects.">HDU</a>::makeThisCurrent() const; <a name="l00853"></a>00853 }; <a name="l00854"></a>00854 <a name="l00855"></a>00855 <span class="comment">// Class CCfits::FITS::NoSuchHDU </span> <a name="l00856"></a>00856 <a name="l00857"></a>00857 <span class="comment">// Class CCfits::FITS::OperationNotSupported </span> <a name="l00858"></a>00858 <a name="l00859"></a>00859 <span class="comment">// Class CCfits::FITS::CantOpen </span> <a name="l00860"></a>00860 <a name="l00861"></a>00861 <span class="comment">// Class CCfits::FITS::CantCreate </span> <a name="l00862"></a>00862 <a name="l00863"></a>00863 <span class="comment">// Class CCfits::FITS </span> <a name="l00864"></a>00864 <a name="l00865"></a><a class="code" href="classCCfits_1_1FITS.html#a21ee1ab28908eb2ed74b5f88cfcc97bf">00865</a> inline <a class="code" href="classCCfits_1_1ExtHDU.html" title="base class for all FITS extension HDUs, i.e. Image Extensions and Tables.">ExtHDU</a>& <a class="code" href="classCCfits_1_1FITS.html" title="Memory object representation of a disk FITS file.">FITS</a>::<a class="code" href="classCCfits_1_1FITS.html#a5e4b2efb2d9c75db28fe264cb8576280" title="return const reference to the extension container">extension</a> (const String& hduName, <span class="keywordtype">int</span> version) <a name="l00866"></a>00866 { <a name="l00867"></a>00867 <a name="l00868"></a>00868 <span class="keywordflow">return</span> extbyVersion(hduName,version); <a name="l00869"></a>00869 } <a name="l00870"></a>00870 <a name="l00871"></a>00871 <span class="keyword">inline</span> std::ostream& operator << (std::ostream& s, <span class="keyword">const</span> <a class="code" href="classCCfits_1_1FITS.html" title="Memory object representation of a disk FITS file.">FITS</a>& right) <a name="l00872"></a>00872 { <a name="l00873"></a>00873 <a name="l00874"></a>00874 <span class="keywordflow">return</span> right.put(s); <a name="l00875"></a>00875 } <a name="l00876"></a>00876 <a name="l00877"></a><a class="code" href="classCCfits_1_1FITS.html#ac897e39e93234792d519913e656be5fc">00877</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classCCfits_1_1FITS.html#ac897e39e93234792d519913e656be5fc" title="return verbose setting for library">FITS::verboseMode</a> () <a name="l00878"></a>00878 { <a name="l00879"></a>00879 <span class="keywordflow">return</span> s_verboseMode; <a name="l00880"></a>00880 } <a name="l00881"></a>00881 <a name="l00882"></a><a class="code" href="classCCfits_1_1FITS.html#ab0e7b06ebbb6097ed6fa2fd555af4ca3">00882</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classCCfits_1_1FITS.html#ab0e7b06ebbb6097ed6fa2fd555af4ca3" title="set verbose setting for library">FITS::setVerboseMode</a> (<span class="keywordtype">bool</span> value) <a name="l00883"></a>00883 { <a name="l00884"></a>00884 s_verboseMode = value; <a name="l00885"></a>00885 } <a name="l00886"></a>00886 <a name="l00887"></a>00887 } <span class="comment">// namespace CCfits</span> <a name="l00888"></a>00888 <a name="l00889"></a>00889 <a name="l00890"></a>00890 <span class="preprocessor">#endif</span> </pre></div></div> <hr size="1"/><address style="text-align: right;"><small>Generated on Wed Sep 9 11:59:40 2009 for CCfits by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address> </body> </html>