<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>HippoDraw Class Library</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> <link rel="shortcut icon" href="hippoApp.ico"> </head><body> <!-- Generated by Doxygen 1.6.2 --> <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="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> <li><a href="dirs.html"><span>Directories</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <div class="navpath"><a class="el" href="dir_f31ced79fa1bf97bbae7cff793d8fdf1.html">fits</a> </div> </div> <div class="contents"> <h1>FitsFileBase.cxx</h1><a href="FitsFileBase_8cxx.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <a name="l00014"></a>00014 <span class="preprocessor">#include "<a class="code" href="FitsFileBase_8h.html" title="hippodraw::FitsFileBase interface">FitsFileBase.h</a>"</span> <a name="l00015"></a>00015 <a name="l00016"></a>00016 <span class="preprocessor">#include <iostream></span> <a name="l00017"></a>00017 <a name="l00018"></a>00018 <span class="preprocessor">#include <cassert></span> <a name="l00019"></a>00019 <a name="l00020"></a>00020 <span class="keyword">using</span> std::string; <a name="l00021"></a>00021 <a name="l00022"></a>00022 <span class="keyword">using namespace </span>hippodraw; <a name="l00023"></a>00023 <a name="l00024"></a><a class="code" href="classhippodraw_1_1FitsFileBase.html#a3f1aea352324f53cb7280d09881a8892">00024</a> FitsFileBase::FitsFileBase ( <span class="keyword">const</span> std::string & filename, <span class="keywordtype">bool</span> <a class="code" href="namespacehippodraw_1_1Numeric.html#a339393d88f1319ad9ae63afad77ec304" title="Given the vector it writes it to std stream.">write</a>) <a name="l00025"></a>00025 { <a name="l00026"></a>00026 <span class="keywordflow">if</span> (!write) <a name="l00027"></a>00027 { <a name="l00028"></a>00028 <a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a> = 0; <a name="l00029"></a>00029 fits_open_file( &<a class="code" href="classhippodraw_1_1FitsFileBase.html#ac9c317bd754799e0fc31688c45b8a000" title="Pointer to the fits file data structure.">m_fptr</a>, filename.c_str(), READONLY, &<a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a> ); <a name="l00030"></a>00030 } <a name="l00031"></a>00031 <span class="keywordflow">else</span> <a name="l00032"></a>00032 { <a name="l00033"></a>00033 <a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a> = 0; <a name="l00034"></a>00034 <a name="l00035"></a>00035 <span class="comment">// Overwrite the FITS file.</span> <a name="l00036"></a>00036 std::string fn = <span class="stringliteral">"!"</span>; <a name="l00037"></a>00037 fn += filename; <a name="l00038"></a>00038 fits_create_file( &<a class="code" href="classhippodraw_1_1FitsFileBase.html#ac9c317bd754799e0fc31688c45b8a000" title="Pointer to the fits file data structure.">m_fptr</a>, fn.c_str(), &<a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a> ); <a name="l00039"></a>00039 } <a name="l00040"></a>00040 } <a name="l00041"></a>00041 <a name="l00042"></a><a class="code" href="classhippodraw_1_1FitsFileBase.html#a8c2e12e59b77829995547342235e3a25">00042</a> <a class="code" href="classhippodraw_1_1FitsFileBase.html#a8c2e12e59b77829995547342235e3a25" title="Virtual destructor.">FitsFileBase::~FitsFileBase</a>() <a name="l00043"></a>00043 { <a name="l00044"></a>00044 <span class="keywordflow">if</span> ( <a class="code" href="classhippodraw_1_1FitsFileBase.html#ac9c317bd754799e0fc31688c45b8a000" title="Pointer to the fits file data structure.">m_fptr</a> != 0 ) { <a name="l00045"></a>00045 <a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a> = 0; <a name="l00046"></a>00046 fits_close_file ( <a class="code" href="classhippodraw_1_1FitsFileBase.html#ac9c317bd754799e0fc31688c45b8a000" title="Pointer to the fits file data structure.">m_fptr</a>, &<a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a> ); <a name="l00047"></a>00047 } <a name="l00048"></a>00048 } <a name="l00049"></a>00049 <a name="l00050"></a><a class="code" href="classhippodraw_1_1FitsFileBase.html#a78573fda734a859b9c61e3b3e20a16a0">00050</a> <span class="keywordtype">void</span> <a class="code" href="classhippodraw_1_1FitsFileBase.html#a78573fda734a859b9c61e3b3e20a16a0" title="Clear the entire error message stack.">FitsFileBase::clearErrorMessageStack</a>( <span class="keywordtype">void</span> ) <a name="l00051"></a>00051 { <a name="l00052"></a>00052 fits_clear_errmsg(); <a name="l00053"></a>00053 } <a name="l00054"></a>00054 <a name="l00055"></a>00055 <a name="l00056"></a>00056 <a class="code" href="classhippodraw_1_1FitsFileBase.html#a09204037a28bb5e9ae491bc1b7b78c96" title="The type of HDU.">FitsFileBase::HduType</a> <a name="l00057"></a>00057 <a class="code" href="classhippodraw_1_1FitsFileBase.html#a6de66d7d917a1b1335ad6ac23cfe85ca" title="Converts an integer to HduType.">FitsFileBase::</a> <a name="l00058"></a><a class="code" href="classhippodraw_1_1FitsFileBase.html#a6de66d7d917a1b1335ad6ac23cfe85ca">00058</a> <a class="code" href="classhippodraw_1_1FitsFileBase.html#a6de66d7d917a1b1335ad6ac23cfe85ca" title="Converts an integer to HduType.">convert</a> ( <span class="keywordtype">int</span> i ) <a name="l00059"></a>00059 { <a name="l00060"></a>00060 <span class="keyword">static</span> <a class="code" href="classhippodraw_1_1FitsFileBase.html#a09204037a28bb5e9ae491bc1b7b78c96" title="The type of HDU.">HduType</a> table[] = { <a class="code" href="classhippodraw_1_1Image.html" title="Displays on the Z axis the values of a single column treated as a matrix of values...">Image</a>, <a class="code" href="classhippodraw_1_1FitsFileBase.html#a09204037a28bb5e9ae491bc1b7b78c96ac13ff13e10de52fac596e8007cc1be56" title="ASCII table.">Atable</a>, <a class="code" href="classhippodraw_1_1FitsFileBase.html#a09204037a28bb5e9ae491bc1b7b78c96a31d79f73ab05b7644e6272a6920b40b6" title="Binary table.">Btable</a>, <a class="code" href="classhippodraw_1_1FitsFileBase.html#a09204037a28bb5e9ae491bc1b7b78c96a9e9c76d7349af6fa36f24efbb7e001d7" title="Matchs any.">Any</a> }; <a name="l00061"></a>00061 <a name="l00062"></a>00062 assert ( i < 3 && i >= 0 ); <a name="l00063"></a>00063 <a name="l00064"></a>00064 <span class="keywordflow">return</span> table [ i ]; <a name="l00065"></a>00065 } <a name="l00066"></a>00066 <a name="l00067"></a>00067 <a class="code" href="classhippodraw_1_1FitsFileBase.html#a09204037a28bb5e9ae491bc1b7b78c96" title="The type of HDU.">FitsFileBase::HduType</a> <a name="l00068"></a>00068 <a class="code" href="classhippodraw_1_1FitsFileBase.html#a9f0dd5d5948d4d30e9ac2e71dab8279e" title="Returns the type of HDU.">FitsFileBase::</a> <a name="l00069"></a><a class="code" href="classhippodraw_1_1FitsFileBase.html#a9f0dd5d5948d4d30e9ac2e71dab8279e">00069</a> <a class="code" href="classhippodraw_1_1FitsFileBase.html#a9f0dd5d5948d4d30e9ac2e71dab8279e" title="Returns the type of HDU.">getHduType</a> ()<span class="keyword"> const</span> <a name="l00070"></a>00070 <span class="keyword"></span>{ <a name="l00071"></a>00071 <span class="keywordtype">int</span> hdutype; <a name="l00072"></a>00072 <a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a> = 0; <a name="l00073"></a>00073 fits_get_hdu_type ( <a class="code" href="classhippodraw_1_1FitsFileBase.html#ac9c317bd754799e0fc31688c45b8a000" title="Pointer to the fits file data structure.">m_fptr</a>, &hdutype, &<a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a> ); <a name="l00074"></a>00074 <a name="l00075"></a>00075 <span class="keywordflow">return</span> <a class="code" href="classhippodraw_1_1FitsFileBase.html#a6de66d7d917a1b1335ad6ac23cfe85ca" title="Converts an integer to HduType.">convert</a> ( hdutype ); <a name="l00076"></a>00076 } <a name="l00077"></a>00077 <a name="l00078"></a>00078 <a class="code" href="classhippodraw_1_1FitsFileBase.html#a3154c405c975616503bac23f51b78fc0" title="The type of image in HDU.">FitsFileBase::ImageType</a> <a name="l00079"></a>00079 <a class="code" href="classhippodraw_1_1FitsFileBase.html#acd7569712da82059121400fdf3665b6c" title="Returns the image type.">FitsFileBase::</a> <a name="l00080"></a><a class="code" href="classhippodraw_1_1FitsFileBase.html#acd7569712da82059121400fdf3665b6c">00080</a> <a class="code" href="classhippodraw_1_1FitsFileBase.html#acd7569712da82059121400fdf3665b6c" title="Returns the image type.">getImageType</a> ()<span class="keyword"> const</span> <a name="l00081"></a>00081 <span class="keyword"></span>{ <a name="l00082"></a>00082 <a class="code" href="classhippodraw_1_1FitsFileBase.html#a3154c405c975616503bac23f51b78fc0" title="The type of image in HDU.">ImageType</a> <a class="code" href="namespacenum__util.html#af7e893a8c6a5f6a426480fc85cda4fa1">type</a> = <a class="code" href="classhippodraw_1_1FitsFileBase.html#a3154c405c975616503bac23f51b78fc0a8a422374f8b7f05289355747e5688926" title="not an image HDU">NoImg</a>; <a name="l00083"></a>00083 <span class="keyword">static</span> <a class="code" href="classhippodraw_1_1FitsFileBase.html#a3154c405c975616503bac23f51b78fc0" title="The type of image in HDU.">ImageType</a> table[] <a name="l00084"></a>00084 = { <a class="code" href="classhippodraw_1_1FitsFileBase.html#a3154c405c975616503bac23f51b78fc0a323093e4635591f8f41aeb396f57fc62" title="8 bit integer per pixel">ByteImg</a>, <a class="code" href="classhippodraw_1_1FitsFileBase.html#a3154c405c975616503bac23f51b78fc0a12fe6f7371b1b1d6cddb328d9fb9e3fe" title="16 bit integer per pixel">ShortImg</a>, <a class="code" href="classhippodraw_1_1FitsFileBase.html#a3154c405c975616503bac23f51b78fc0aa522eaf450b9e277708cb495e56db202" title="32 bit integer per pixel">LongImg</a>, <a class="code" href="classhippodraw_1_1FitsFileBase.html#a3154c405c975616503bac23f51b78fc0aa671571998fa8c9d1c4f37249107a786" title="32 bit floating point per pixel">FloatImg</a>, <a class="code" href="classhippodraw_1_1FitsFileBase.html#a3154c405c975616503bac23f51b78fc0a0e383af718730a1a5c5b2a4981d9692d" title="64 bit floating point per pixel">DoubleImg</a> }; <a name="l00085"></a>00085 <a name="l00086"></a>00086 <span class="keywordtype">int</span> bitpix; <a name="l00087"></a>00087 <a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a> = 0; <a name="l00088"></a>00088 fits_get_img_type ( <a class="code" href="classhippodraw_1_1FitsFileBase.html#ac9c317bd754799e0fc31688c45b8a000" title="Pointer to the fits file data structure.">m_fptr</a>, & bitpix, & <a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a> ); <a name="l00089"></a>00089 <span class="keywordflow">if</span> ( bitpix < 5 && bitpix >= 0 ) { <a name="l00090"></a>00090 type = table [ bitpix ]; <a name="l00091"></a>00091 } <a name="l00092"></a>00092 <a name="l00093"></a>00093 <span class="keywordflow">return</span> type; <a name="l00094"></a>00094 } <a name="l00095"></a>00095 <a name="l00096"></a>00096 <span class="keywordtype">int</span> <a name="l00097"></a>00097 <a class="code" href="classhippodraw_1_1FitsFileBase.html#a2aa2f714585973dc2d3ec0b6649a0a8a" title="Returns the number of dimensions (axes) of an image.">FitsFileBase::</a> <a name="l00098"></a><a class="code" href="classhippodraw_1_1FitsFileBase.html#a2aa2f714585973dc2d3ec0b6649a0a8a">00098</a> <a class="code" href="classhippodraw_1_1FitsFileBase.html#a2aa2f714585973dc2d3ec0b6649a0a8a" title="Returns the number of dimensions (axes) of an image.">getImageDimensions</a> ()<span class="keyword"> const</span> <a name="l00099"></a>00099 <span class="keyword"></span>{ <a name="l00100"></a>00100 <span class="keywordtype">int</span> naxis = 0; <a name="l00101"></a>00101 <a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a> = 0; <a name="l00102"></a>00102 fits_get_img_dim ( <a class="code" href="classhippodraw_1_1FitsFileBase.html#ac9c317bd754799e0fc31688c45b8a000" title="Pointer to the fits file data structure.">m_fptr</a>, & naxis, & <a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a> ); <a name="l00103"></a>00103 assert ( <a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a> == 0 ); <a name="l00104"></a>00104 <a name="l00105"></a>00105 <span class="keywordflow">return</span> naxis; <a name="l00106"></a>00106 } <a name="l00107"></a>00107 <a name="l00108"></a>00108 <span class="keywordtype">int</span> <a name="l00109"></a>00109 <a class="code" href="classhippodraw_1_1FitsFileBase.html#addbcf323482d24d5dea44fb6416501ac" title="Returns the number of HDU in the file.">FitsFileBase::</a> <a name="l00110"></a><a class="code" href="classhippodraw_1_1FitsFileBase.html#addbcf323482d24d5dea44fb6416501ac">00110</a> <a class="code" href="classhippodraw_1_1FitsFileBase.html#addbcf323482d24d5dea44fb6416501ac" title="Returns the number of HDU in the file.">getNumberOfHDU</a> ()<span class="keyword"> const</span> <a name="l00111"></a>00111 <span class="keyword"></span>{ <a name="l00112"></a>00112 <span class="keywordtype">int</span> hdunum = 0; <a name="l00113"></a>00113 <a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a> = 0; <a name="l00114"></a>00114 fits_get_num_hdus ( <a class="code" href="classhippodraw_1_1FitsFileBase.html#ac9c317bd754799e0fc31688c45b8a000" title="Pointer to the fits file data structure.">m_fptr</a>, &hdunum, &<a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a> ); <a name="l00115"></a>00115 <a name="l00116"></a>00116 <span class="keywordflow">return</span> hdunum; <a name="l00117"></a>00117 } <a name="l00118"></a>00118 <a name="l00119"></a>00119 <span class="keywordtype">int</span> <a name="l00120"></a>00120 <a class="code" href="classhippodraw_1_1FitsFileBase.html#a3c9252f8852a9922f60ae1174f9fb2f0" title="Move to a specified absolute HDU number in the FITS file and return the cfitsio status...">FitsFileBase::</a> <a name="l00121"></a><a class="code" href="classhippodraw_1_1FitsFileBase.html#a3c9252f8852a9922f60ae1174f9fb2f0">00121</a> <a class="code" href="classhippodraw_1_1FitsFileBase.html#a3c9252f8852a9922f60ae1174f9fb2f0" title="Move to a specified absolute HDU number in the FITS file and return the cfitsio status...">moveToHDU</a> ( <span class="keywordtype">int</span> hdunum ) <a name="l00122"></a>00122 { <a name="l00123"></a>00123 <span class="keywordtype">int</span> hdutype; <a name="l00124"></a>00124 <a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a> = 0; <a name="l00125"></a>00125 fits_movabs_hdu ( <a class="code" href="classhippodraw_1_1FitsFileBase.html#ac9c317bd754799e0fc31688c45b8a000" title="Pointer to the fits file data structure.">m_fptr</a>, hdunum + 1, <span class="comment">// count like Fortran</span> <a name="l00126"></a>00126 &hdutype, &<a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a> ); <a name="l00127"></a>00127 <a name="l00128"></a>00128 <span class="keywordflow">return</span> <a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a>; <a name="l00129"></a>00129 } <a name="l00130"></a>00130 <a name="l00131"></a>00131 <span class="keywordtype">int</span> <a name="l00132"></a>00132 <a class="code" href="classhippodraw_1_1FitsFileBase.html#a3c9252f8852a9922f60ae1174f9fb2f0" title="Move to a specified absolute HDU number in the FITS file and return the cfitsio status...">FitsFileBase::</a> <a name="l00133"></a><a class="code" href="classhippodraw_1_1FitsFileBase.html#a07e4837b4a2ebbc7494b3bcdb6bd1e62">00133</a> <a class="code" href="classhippodraw_1_1FitsFileBase.html#a3c9252f8852a9922f60ae1174f9fb2f0" title="Move to a specified absolute HDU number in the FITS file and return the cfitsio status...">moveToHDU</a> ( <span class="keyword">const</span> std::string & name ) <a name="l00134"></a>00134 { <a name="l00135"></a>00135 <span class="keywordtype">char</span> * extname = const_cast < <span class="keywordtype">char</span> * > ( name.c_str() ); <a name="l00136"></a>00136 <a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a> = 0; <a name="l00137"></a>00137 fits_movnam_hdu ( <a class="code" href="classhippodraw_1_1FitsFileBase.html#ac9c317bd754799e0fc31688c45b8a000" title="Pointer to the fits file data structure.">m_fptr</a>, ANY_HDU, extname, 0, &m_status ); <a name="l00138"></a>00138 <a name="l00139"></a>00139 <span class="keywordflow">return</span> m_status; <a name="l00140"></a>00140 } <a name="l00141"></a>00141 <a name="l00142"></a>00142 <span class="keywordtype">int</span> <a name="l00143"></a>00143 <a class="code" href="classhippodraw_1_1FitsFileBase.html#a4de84bb98538f126568605cbcaebf527" title="Returns the current HDU number.">FitsFileBase::</a> <a name="l00144"></a><a class="code" href="classhippodraw_1_1FitsFileBase.html#a4de84bb98538f126568605cbcaebf527">00144</a> <a class="code" href="classhippodraw_1_1FitsFileBase.html#a4de84bb98538f126568605cbcaebf527" title="Returns the current HDU number.">getHDUNumber</a> ()<span class="keyword"> const</span> <a name="l00145"></a>00145 <span class="keyword"></span>{ <a name="l00146"></a>00146 <span class="keywordtype">int</span> number = 0; <a name="l00147"></a>00147 <span class="comment">//int retval = </span> <a name="l00148"></a>00148 <a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a> = 0; <a name="l00149"></a>00149 fits_get_hdu_num ( <a class="code" href="classhippodraw_1_1FitsFileBase.html#ac9c317bd754799e0fc31688c45b8a000" title="Pointer to the fits file data structure.">m_fptr</a>, &number ); <a name="l00150"></a>00150 <a name="l00151"></a>00151 <span class="keywordflow">return</span> number - 1; <span class="comment">// count like C++</span> <a name="l00152"></a>00152 } <a name="l00153"></a>00153 <a name="l00154"></a><a class="code" href="classhippodraw_1_1FitsFileBase.html#a86ce80496dc0153486981adf8bb555c3">00154</a> <span class="keywordtype">int</span> <a class="code" href="classhippodraw_1_1FitsFileBase.html#a86ce80496dc0153486981adf8bb555c3" title="Return the number of existing keywords (not counting the END keyword).">FitsFileBase::numKeywords</a>()<span class="keyword"> const</span> <a name="l00155"></a>00155 <span class="keyword"></span>{ <a name="l00156"></a>00156 <span class="keywordtype">int</span> keyexist, morekeys; <a name="l00157"></a>00157 <a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a> = 0; <a name="l00158"></a>00158 fits_get_hdrspace( <a class="code" href="classhippodraw_1_1FitsFileBase.html#ac9c317bd754799e0fc31688c45b8a000" title="Pointer to the fits file data structure.">m_fptr</a>, &keyexist, &morekeys, &<a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a> ); <a name="l00159"></a>00159 <span class="keywordflow">return</span> keyexist; <a name="l00160"></a>00160 } <a name="l00161"></a>00161 <a name="l00162"></a>00162 <span class="keywordtype">double</span> <a name="l00163"></a>00163 <a class="code" href="classhippodraw_1_1FitsFileBase.html#a5406f5a1c59dc990c83811b138c61623" title="Read a specified keyword value and return it as a double.">FitsFileBase::</a> <a name="l00164"></a><a class="code" href="classhippodraw_1_1FitsFileBase.html#a5406f5a1c59dc990c83811b138c61623">00164</a> <a class="code" href="classhippodraw_1_1FitsFileBase.html#a5406f5a1c59dc990c83811b138c61623" title="Read a specified keyword value and return it as a double.">doubleValueForKey</a> ( <span class="keyword">const</span> <span class="keywordtype">char</span> * key )<span class="keyword"> const</span> <a name="l00165"></a>00165 <span class="keyword"></span>{ <a name="l00166"></a>00166 <span class="keywordtype">double</span> value; <a name="l00167"></a>00167 <a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a> = 0; <a name="l00168"></a>00168 fits_read_key( <a class="code" href="classhippodraw_1_1FitsFileBase.html#ac9c317bd754799e0fc31688c45b8a000" title="Pointer to the fits file data structure.">m_fptr</a>, TDOUBLE, <a name="l00169"></a>00169 const_cast<char *>(key), &value, 0, &<a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a> ); <a name="l00170"></a>00170 <span class="keywordflow">return</span> value; <a name="l00171"></a>00171 } <a name="l00172"></a>00172 <a name="l00173"></a>00173 <span class="keywordtype">bool</span> <a name="l00174"></a>00174 <a class="code" href="classhippodraw_1_1FitsFileBase.html#a85107333ac3fd32889e6a5c2d9cec948" title="Returns true if the keyword key exists, otherwise returns false.">FitsFileBase::</a> <a name="l00175"></a><a class="code" href="classhippodraw_1_1FitsFileBase.html#a85107333ac3fd32889e6a5c2d9cec948">00175</a> <a class="code" href="classhippodraw_1_1FitsFileBase.html#a85107333ac3fd32889e6a5c2d9cec948" title="Returns true if the keyword key exists, otherwise returns false.">hasKey</a> ( <span class="keyword">const</span> <span class="keywordtype">char</span> * key )<span class="keyword"> const</span> <a name="l00176"></a>00176 <span class="keyword"></span>{ <a name="l00177"></a>00177 <span class="keywordtype">char</span> value [ FLEN_VALUE ]; <a name="l00178"></a>00178 <a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a> = 0; <a name="l00179"></a>00179 fits_read_keyword ( <a class="code" href="classhippodraw_1_1FitsFileBase.html#ac9c317bd754799e0fc31688c45b8a000" title="Pointer to the fits file data structure.">m_fptr</a>, const_cast < char * > ( key ), <a name="l00180"></a>00180 value, 0, & <a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a> ); <a name="l00181"></a>00181 <a name="l00182"></a>00182 <span class="keywordflow">return</span> <a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a> == 0; <a name="l00183"></a>00183 } <a name="l00184"></a>00184 <a name="l00185"></a>00185 <span class="keywordtype">int</span> <a name="l00186"></a>00186 <a class="code" href="classhippodraw_1_1FitsFileBase.html#a0df857269fa4528cb218653240efb9d3" title="Read a specified keyword value and returns it as a int.">FitsFileBase::</a> <a name="l00187"></a><a class="code" href="classhippodraw_1_1FitsFileBase.html#a0df857269fa4528cb218653240efb9d3">00187</a> <a class="code" href="classhippodraw_1_1FitsFileBase.html#a0df857269fa4528cb218653240efb9d3" title="Read a specified keyword value and returns it as a int.">intValueForKey</a> ( <span class="keyword">const</span> <span class="keywordtype">char</span> * key )<span class="keyword"> const</span> <a name="l00188"></a>00188 <span class="keyword"></span>{ <a name="l00189"></a>00189 <span class="keywordtype">int</span> value; <a name="l00190"></a>00190 <a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a> = 0; <a name="l00191"></a>00191 fits_read_key( <a class="code" href="classhippodraw_1_1FitsFileBase.html#ac9c317bd754799e0fc31688c45b8a000" title="Pointer to the fits file data structure.">m_fptr</a>, TINT, <a name="l00192"></a>00192 const_cast<char *>(key), &value, 0, &<a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a> ); <a name="l00193"></a>00193 <a name="l00194"></a>00194 <span class="keywordflow">return</span> value; <a name="l00195"></a>00195 } <a name="l00196"></a>00196 <a name="l00197"></a>00197 <span class="keywordtype">string</span> <a name="l00198"></a>00198 <a class="code" href="classhippodraw_1_1FitsFileBase.html#acb542016c8bb427121d07d26704a4805" title="Read a specified keyword value and returns it as a string.">FitsFileBase::</a> <a name="l00199"></a><a class="code" href="classhippodraw_1_1FitsFileBase.html#acb542016c8bb427121d07d26704a4805">00199</a> <a class="code" href="classhippodraw_1_1FitsFileBase.html#acb542016c8bb427121d07d26704a4805" title="Read a specified keyword value and returns it as a string.">stringValueForKey</a> ( <span class="keyword">const</span> <span class="keywordtype">char</span> * key )<span class="keyword"> const</span> <a name="l00200"></a>00200 <span class="keyword"></span>{ <a name="l00201"></a>00201 <span class="keywordtype">char</span> value [ FLEN_VALUE ]; <a name="l00202"></a>00202 <a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a> = 0; <a name="l00203"></a>00203 fits_read_key ( <a class="code" href="classhippodraw_1_1FitsFileBase.html#ac9c317bd754799e0fc31688c45b8a000" title="Pointer to the fits file data structure.">m_fptr</a>, TSTRING, <a name="l00204"></a>00204 const_cast<char *>(key), &value, 0, &<a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a> ); <a name="l00205"></a>00205 <a name="l00206"></a>00206 <span class="keywordflow">return</span> string ( value ); <a name="l00207"></a>00207 } <a name="l00208"></a>00208 <a name="l00209"></a>00209 <span class="keywordtype">int</span> <a name="l00210"></a>00210 <a class="code" href="classhippodraw_1_1FitsFileBase.html#a8bcf950a774cbd3106d4c68d3b2f38c9" title="Returns the cfitsio status code for the last operation.">FitsFileBase::</a> <a name="l00211"></a><a class="code" href="classhippodraw_1_1FitsFileBase.html#a8bcf950a774cbd3106d4c68d3b2f38c9">00211</a> <a class="code" href="classhippodraw_1_1FitsFileBase.html#a8bcf950a774cbd3106d4c68d3b2f38c9" title="Returns the cfitsio status code for the last operation.">status</a> ()<span class="keyword"> const</span> <a name="l00212"></a>00212 <span class="keyword"></span>{ <a name="l00213"></a>00213 <span class="keywordflow">return</span> <a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a>; <a name="l00214"></a>00214 } <a name="l00215"></a>00215 <a name="l00216"></a>00216 <span class="keywordtype">long</span> <a name="l00217"></a>00217 <a class="code" href="classhippodraw_1_1FitsFileBase.html#a66a062407748e4df52a5632d99607719" title="Returns the number of rows in the table.">FitsFileBase::</a> <a name="l00218"></a><a class="code" href="classhippodraw_1_1FitsFileBase.html#a66a062407748e4df52a5632d99607719">00218</a> <a class="code" href="classhippodraw_1_1FitsFileBase.html#a66a062407748e4df52a5632d99607719" title="Returns the number of rows in the table.">getNumberOfRows</a> ()<span class="keyword"> const</span> <a name="l00219"></a>00219 <span class="keyword"></span>{ <a name="l00220"></a>00220 <span class="keywordtype">long</span> number = 0; <a name="l00221"></a>00221 <a name="l00222"></a>00222 <span class="keywordtype">int</span> hdutype; <a name="l00223"></a>00223 <a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a> = 0; <a name="l00224"></a>00224 fits_get_hdu_type ( <a class="code" href="classhippodraw_1_1FitsFileBase.html#ac9c317bd754799e0fc31688c45b8a000" title="Pointer to the fits file data structure.">m_fptr</a>, &hdutype, &<a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a> ); <a name="l00225"></a>00225 <a name="l00226"></a>00226 <span class="keywordflow">if</span> ( hdutype == IMAGE_HDU ) { <a name="l00227"></a>00227 <span class="keywordtype">int</span> nx = <a class="code" href="classhippodraw_1_1FitsFileBase.html#a0df857269fa4528cb218653240efb9d3" title="Read a specified keyword value and returns it as a int.">intValueForKey</a> ( <span class="stringliteral">"NAXIS1"</span> ); <a name="l00228"></a>00228 <span class="keywordtype">int</span> ny = <a class="code" href="classhippodraw_1_1FitsFileBase.html#a0df857269fa4528cb218653240efb9d3" title="Read a specified keyword value and returns it as a int.">intValueForKey</a> ( <span class="stringliteral">"NAXIS2"</span> ); <a name="l00229"></a>00229 number = nx * ny; <a name="l00230"></a>00230 } <a name="l00231"></a>00231 <span class="keywordflow">else</span> { <span class="comment">// table</span> <a name="l00232"></a>00232 <a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a> = 0; <a name="l00233"></a>00233 fits_get_num_rows ( <a class="code" href="classhippodraw_1_1FitsFileBase.html#ac9c317bd754799e0fc31688c45b8a000" title="Pointer to the fits file data structure.">m_fptr</a>, & number, & <a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a> ); <a name="l00234"></a>00234 } <a name="l00235"></a>00235 <a name="l00236"></a>00236 <span class="keywordflow">return</span> number; <a name="l00237"></a>00237 } <a name="l00238"></a>00238 <a name="l00239"></a>00239 <span class="keywordtype">int</span> <a name="l00240"></a>00240 <a class="code" href="classhippodraw_1_1FitsFileBase.html#ae42967e4d735061505ec6cde5e7b28eb" title="Returns the number of columns in a table.">FitsFileBase::</a> <a name="l00241"></a><a class="code" href="classhippodraw_1_1FitsFileBase.html#ae42967e4d735061505ec6cde5e7b28eb">00241</a> <a class="code" href="classhippodraw_1_1FitsFileBase.html#ae42967e4d735061505ec6cde5e7b28eb" title="Returns the number of columns in a table.">getNumberOfColumns</a> ()<span class="keyword"> const</span> <a name="l00242"></a>00242 <span class="keyword"></span>{ <a name="l00243"></a>00243 <span class="keywordtype">int</span> ncols = 0; <a name="l00244"></a>00244 <a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a> = 0; <a name="l00245"></a>00245 fits_get_num_cols ( <a class="code" href="classhippodraw_1_1FitsFileBase.html#ac9c317bd754799e0fc31688c45b8a000" title="Pointer to the fits file data structure.">m_fptr</a>, &ncols, &<a class="code" href="classhippodraw_1_1FitsFileBase.html#a9fe0cdf49723f51eb797adbee7e7e2e6" title="The status return code from the last cfitsio operation.">m_status</a> ); <a name="l00246"></a>00246 <a name="l00247"></a>00247 <span class="keywordflow">return</span> ncols; <a name="l00248"></a>00248 } </pre></div></div> <hr size="1"><address style="align: right;"><small> Generated for HippoDraw Class Library by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border=0> </a> </small></address> </body> </html>