/usr/share/doc/libcpl-dev/html/group__cpl__fits.html is in libcpl-doc 7.1-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 | <!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"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/>
<title>Common Pipeline Library Reference Manual: FITS related basic routines</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="cpl.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Common Pipeline Library Reference Manual
 <span id="projectnumber">7.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.10 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<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="annotated.html"><span>Classes</span></a></li>
</ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#typedef-members">Typedefs</a> |
<a href="#enum-members">Enumerations</a> |
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">FITS related basic routines</div> </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ga707bbe97f46e6c38492f7f211a642527"><td class="memItemLeft" align="right" valign="top">typedef enum <a class="el" href="group__cpl__fits.html#ga29c73102ccb458b7b82500fa75fd697c">_cpl_fits_mode_</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__cpl__fits.html#ga707bbe97f46e6c38492f7f211a642527">cpl_fits_mode</a></td></tr>
<tr class="memdesc:ga707bbe97f46e6c38492f7f211a642527"><td class="mdescLeft"> </td><td class="mdescRight">The CPL fits mode. It is a bit field. <a href="#ga707bbe97f46e6c38492f7f211a642527">More...</a><br /></td></tr>
<tr class="separator:ga707bbe97f46e6c38492f7f211a642527"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ga29c73102ccb458b7b82500fa75fd697c"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="group__cpl__fits.html#ga29c73102ccb458b7b82500fa75fd697c">_cpl_fits_mode_</a> { <br />
  <a class="el" href="group__cpl__fits.html#gga29c73102ccb458b7b82500fa75fd697ca7e55a86b720cf358df0f5f92e4f8150e">CPL_FITS_STOP_CACHING</a>,
<br />
  <a class="el" href="group__cpl__fits.html#gga29c73102ccb458b7b82500fa75fd697cabfb063c0e6bf2ee95af08f80dfe879d2">CPL_FITS_START_CACHING</a>,
<br />
  <a class="el" href="group__cpl__fits.html#gga29c73102ccb458b7b82500fa75fd697ca220e5dc1a5a2c56a160f461f00bd641f">CPL_FITS_RESTART_CACHING</a>,
<br />
  <a class="el" href="group__cpl__fits.html#gga29c73102ccb458b7b82500fa75fd697ca43d0bcea060ec75963f5f956c02a24f7">CPL_FITS_ONE</a>
<br />
}<tr class="memdesc:ga29c73102ccb458b7b82500fa75fd697c"><td class="mdescLeft"> </td><td class="mdescRight">The values of the CPL fits mode. The values can be combined with bitwise or. <a href="group__cpl__fits.html#ga29c73102ccb458b7b82500fa75fd697c">More...</a><br /></td></tr>
<tr class="separator:ga29c73102ccb458b7b82500fa75fd697c"><td class="memSeparator" colspan="2"> </td></tr>
</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gae342bb78fa9b023951187d2fef522a9c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__cpl__type.html#gacc431432a4fedf19ec6f7668dda3fbf0">cpl_size</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__cpl__fits.html#gae342bb78fa9b023951187d2fef522a9c">cpl_fits_count_extensions</a> (const char *filename)</td></tr>
<tr class="memdesc:gae342bb78fa9b023951187d2fef522a9c"><td class="mdescLeft"> </td><td class="mdescRight">Get the number of extensions contained in a FITS file. <a href="#gae342bb78fa9b023951187d2fef522a9c">More...</a><br /></td></tr>
<tr class="separator:gae342bb78fa9b023951187d2fef522a9c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga0b2ea87210bdba5ca8b6898ce5761f6d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__cpl__type.html#gacc431432a4fedf19ec6f7668dda3fbf0">cpl_size</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__cpl__fits.html#ga0b2ea87210bdba5ca8b6898ce5761f6d">cpl_fits_find_extension</a> (const char *filename, const char *extname)</td></tr>
<tr class="memdesc:ga0b2ea87210bdba5ca8b6898ce5761f6d"><td class="mdescLeft"> </td><td class="mdescRight">Get the place of a given extension in a FITS file. <a href="#ga0b2ea87210bdba5ca8b6898ce5761f6d">More...</a><br /></td></tr>
<tr class="separator:ga0b2ea87210bdba5ca8b6898ce5761f6d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga385797fec4786aeaa79b7e84351a5698"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__cpl__fits.html#ga385797fec4786aeaa79b7e84351a5698">cpl_fits_get_extension_nb</a> (const char *filename, const char *extname)</td></tr>
<tr class="memdesc:ga385797fec4786aeaa79b7e84351a5698"><td class="mdescLeft"> </td><td class="mdescRight">Get the place of a given extension in a FITS file. <a href="#ga385797fec4786aeaa79b7e84351a5698">More...</a><br /></td></tr>
<tr class="separator:ga385797fec4786aeaa79b7e84351a5698"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga32efe0c225c2f126407b5d083e9295a7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__cpl__fits.html#ga707bbe97f46e6c38492f7f211a642527">cpl_fits_mode</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__cpl__fits.html#ga32efe0c225c2f126407b5d083e9295a7">cpl_fits_get_mode</a> (void)</td></tr>
<tr class="memdesc:ga32efe0c225c2f126407b5d083e9295a7"><td class="mdescLeft"> </td><td class="mdescRight">Get the FITS I/O mode. <a href="#ga32efe0c225c2f126407b5d083e9295a7">More...</a><br /></td></tr>
<tr class="separator:ga32efe0c225c2f126407b5d083e9295a7"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga62553d46c6ea7a30eed9491336a28b90"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__cpl__fits.html#ga62553d46c6ea7a30eed9491336a28b90">cpl_fits_get_nb_extensions</a> (const char *filename)</td></tr>
<tr class="memdesc:ga62553d46c6ea7a30eed9491336a28b90"><td class="mdescLeft"> </td><td class="mdescRight">Get the number of extensions contained in a FITS file. <a href="#ga62553d46c6ea7a30eed9491336a28b90">More...</a><br /></td></tr>
<tr class="separator:ga62553d46c6ea7a30eed9491336a28b90"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga16d1819d6013c6851542370630d376d9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__cpl__error.html#ga44b4287e8a7a22122b94c220a1dd9459">cpl_error_code</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__cpl__fits.html#ga16d1819d6013c6851542370630d376d9">cpl_fits_set_mode</a> (<a class="el" href="group__cpl__fits.html#ga707bbe97f46e6c38492f7f211a642527">cpl_fits_mode</a> mode)</td></tr>
<tr class="memdesc:ga16d1819d6013c6851542370630d376d9"><td class="mdescLeft"> </td><td class="mdescRight">Set the FITS I/O mode. <a href="#ga16d1819d6013c6851542370630d376d9">More...</a><br /></td></tr>
<tr class="separator:ga16d1819d6013c6851542370630d376d9"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>This module provides functions to get basic information on FITS files</p>
<dl class="section user"><dt>Synopsis:</dt><dd><div class="fragment"><div class="line"><span class="preprocessor">#include "cpl_fits.h"</span></div>
</div><!-- fragment --> </dd></dl>
<h2 class="groupheader">Typedef Documentation</h2>
<a class="anchor" id="ga707bbe97f46e6c38492f7f211a642527"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef enum <a class="el" href="group__cpl__fits.html#ga29c73102ccb458b7b82500fa75fd697c">_cpl_fits_mode_</a> <a class="el" href="group__cpl__fits.html#ga707bbe97f46e6c38492f7f211a642527">cpl_fits_mode</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>The CPL fits mode. It is a bit field. </p>
</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a class="anchor" id="ga29c73102ccb458b7b82500fa75fd697c"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="group__cpl__fits.html#ga29c73102ccb458b7b82500fa75fd697c">_cpl_fits_mode_</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>The values of the CPL fits mode. The values can be combined with bitwise or. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a class="anchor" id="gga29c73102ccb458b7b82500fa75fd697ca7e55a86b720cf358df0f5f92e4f8150e"></a>CPL_FITS_STOP_CACHING </td><td class="fielddoc">
<p>Stop the caching of open FITS files </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga29c73102ccb458b7b82500fa75fd697cabfb063c0e6bf2ee95af08f80dfe879d2"></a>CPL_FITS_START_CACHING </td><td class="fielddoc">
<p>Start the caching of open FITS files </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga29c73102ccb458b7b82500fa75fd697ca220e5dc1a5a2c56a160f461f00bd641f"></a>CPL_FITS_RESTART_CACHING </td><td class="fielddoc">
<p>Restart the caching of open FITS files </p>
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="gga29c73102ccb458b7b82500fa75fd697ca43d0bcea060ec75963f5f956c02a24f7"></a>CPL_FITS_ONE </td><td class="fielddoc">
<p>Apply the mode change only to the current thread </p>
</td></tr>
</table>
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="gae342bb78fa9b023951187d2fef522a9c"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group__cpl__type.html#gacc431432a4fedf19ec6f7668dda3fbf0">cpl_size</a> cpl_fits_count_extensions </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>filename</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the number of extensions contained in a FITS file. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">filename</td><td>The file name </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of extensions or -1 in case of error </dd></dl>
<dl class="section note"><dt>Note</dt><dd>For a valid fits file without extensions zero is returned</dd></dl>
<p>Possible <a class="el" href="group__cpl__error.html#ga49a0c316d52d2afbfd9fd94b95344900" title="Available error codes. ">_cpl_error_code_</a> set in this function:</p><ul>
<li>CPL_ERROR_NULL_INPUT if the input pointer is NULL</li>
<li>CPL_ERROR_FILE_IO If the FITS file could not be opened</li>
<li>CPL_ERROR_BAD_FILE_FORMAT if the input FITS file is otherwise invalid </li>
</ul>
<p>References <a class="el" href="group__cpl__error.html#gafb123879d8683c6d63681f433dc19bd0">cpl_ensure</a>, <a class="el" href="group__cpl__error.html#gga49a0c316d52d2afbfd9fd94b95344900a1749117c10756ba66ad8ec26c6daf578">CPL_ERROR_BAD_FILE_FORMAT</a>, <a class="el" href="group__cpl__error.html#gga49a0c316d52d2afbfd9fd94b95344900aa54303ad2fb0efc3f8c57c788b342c81">CPL_ERROR_FILE_IO</a>, and <a class="el" href="group__cpl__error.html#gga49a0c316d52d2afbfd9fd94b95344900a7b054cf7927d1bd0a9b3693a6715be84">CPL_ERROR_NULL_INPUT</a>.</p>
<p>Referenced by <a class="el" href="group__cpl__fits.html#ga62553d46c6ea7a30eed9491336a28b90">cpl_fits_get_nb_extensions()</a>, and <a class="el" href="group__cpl__frame.html#ga90b49290d6eca586163de2e239f9050d">cpl_frame_get_nextensions()</a>.</p>
</div>
</div>
<a class="anchor" id="ga0b2ea87210bdba5ca8b6898ce5761f6d"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group__cpl__type.html#gacc431432a4fedf19ec6f7668dda3fbf0">cpl_size</a> cpl_fits_find_extension </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>filename</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>extname</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the place of a given extension in a FITS file. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">filename</td><td>The file name </td></tr>
<tr><td class="paramname">extname</td><td>The extension name </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The extension number, 0 if not found or -1 on error</dd></dl>
<p>Possible <a class="el" href="group__cpl__error.html#ga49a0c316d52d2afbfd9fd94b95344900" title="Available error codes. ">_cpl_error_code_</a> set in this function:</p><ul>
<li>CPL_ERROR_NULL_INPUT if an input pointer is NULL</li>
<li>CPL_ERROR_FILE_IO if the file is not FITS </li>
</ul>
<p>References <a class="el" href="group__cpl__error.html#gafb123879d8683c6d63681f433dc19bd0">cpl_ensure</a>, <a class="el" href="group__cpl__error.html#gga49a0c316d52d2afbfd9fd94b95344900aa54303ad2fb0efc3f8c57c788b342c81">CPL_ERROR_FILE_IO</a>, and <a class="el" href="group__cpl__error.html#gga49a0c316d52d2afbfd9fd94b95344900a7b054cf7927d1bd0a9b3693a6715be84">CPL_ERROR_NULL_INPUT</a>.</p>
<p>Referenced by <a class="el" href="group__cpl__fits.html#ga385797fec4786aeaa79b7e84351a5698">cpl_fits_get_extension_nb()</a>, and <a class="el" href="group__cpl__multiframe.html#gaf31f40d46becde0579351cbb4e4ecc0c">cpl_multiframe_append_datagroup()</a>.</p>
</div>
</div>
<a class="anchor" id="ga385797fec4786aeaa79b7e84351a5698"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int cpl_fits_get_extension_nb </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>filename</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>extname</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the place of a given extension in a FITS file. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">filename</td><td>The file name </td></tr>
<tr><td class="paramname">extname</td><td>The extension name </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the extension place or -1 in case of error </dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__cpl__fits.html#ga0b2ea87210bdba5ca8b6898ce5761f6d" title="Get the place of a given extension in a FITS file. ">cpl_fits_find_extension</a> </dd></dl>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000002">Deprecated:</a></b></dt><dd>Replace this call with <a class="el" href="group__cpl__fits.html#ga0b2ea87210bdba5ca8b6898ce5761f6d" title="Get the place of a given extension in a FITS file. ">cpl_fits_find_extension()</a>.</dd></dl>
<p>References <a class="el" href="group__cpl__fits.html#ga0b2ea87210bdba5ca8b6898ce5761f6d">cpl_fits_find_extension()</a>.</p>
</div>
</div>
<a class="anchor" id="ga32efe0c225c2f126407b5d083e9295a7"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group__cpl__fits.html#ga707bbe97f46e6c38492f7f211a642527">cpl_fits_mode</a> cpl_fits_get_mode </td>
<td>(</td>
<td class="paramtype">void </td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the FITS I/O mode. </p>
<dl class="section return"><dt>Returns</dt><dd>One of: CPL_FITS_STOP_CACHING, CPL_FITS_START_CACHING </dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__cpl__fits.html#ga16d1819d6013c6851542370630d376d9" title="Set the FITS I/O mode. ">cpl_fits_set_mode()</a> </dd></dl>
<p>References <a class="el" href="group__cpl__fits.html#gga29c73102ccb458b7b82500fa75fd697cabfb063c0e6bf2ee95af08f80dfe879d2">CPL_FITS_START_CACHING</a>, and <a class="el" href="group__cpl__fits.html#gga29c73102ccb458b7b82500fa75fd697ca7e55a86b720cf358df0f5f92e4f8150e">CPL_FITS_STOP_CACHING</a>.</p>
</div>
</div>
<a class="anchor" id="ga62553d46c6ea7a30eed9491336a28b90"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int cpl_fits_get_nb_extensions </td>
<td>(</td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>filename</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the number of extensions contained in a FITS file. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">filename</td><td>The file name </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the number of extensions or -1 in case of error </dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__cpl__fits.html#gae342bb78fa9b023951187d2fef522a9c" title="Get the number of extensions contained in a FITS file. ">cpl_fits_count_extensions()</a> </dd></dl>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000001">Deprecated:</a></b></dt><dd>Replace this call with <a class="el" href="group__cpl__fits.html#gae342bb78fa9b023951187d2fef522a9c" title="Get the number of extensions contained in a FITS file. ">cpl_fits_count_extensions()</a>.</dd></dl>
<p>References <a class="el" href="group__cpl__fits.html#gae342bb78fa9b023951187d2fef522a9c">cpl_fits_count_extensions()</a>.</p>
</div>
</div>
<a class="anchor" id="ga16d1819d6013c6851542370630d376d9"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group__cpl__error.html#ga44b4287e8a7a22122b94c220a1dd9459">cpl_error_code</a> cpl_fits_set_mode </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__cpl__fits.html#ga707bbe97f46e6c38492f7f211a642527">cpl_fits_mode</a> </td>
<td class="paramname"><em>mode</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the FITS I/O mode. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">mode</td><td>The FITS I/O mode: CPL_FITS_STOP_CACHING, CPL_FITS_START_CACHING, CPL_FITS_RESTART_CACHING </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CPL_ERROR_NONE or the relevant <a class="el" href="group__cpl__error.html#ga49a0c316d52d2afbfd9fd94b95344900" title="Available error codes. ">_cpl_error_code_</a> on error </dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__cpl__init.html#gaca7531b1ca5c83c1de76eabf8d347bc2" title="Initialise the CPL core library. ">cpl_init()</a> to control the FITS I/O mode when CPL is started</dd></dl>
<p>Normally when a FITS file is processed with a CPL call the file is openened and closed during that call. However repeated calls on FITS data with many extensions causes the FITS headers to be parsed many times which can lead to a significant performance penalty. If instead this function is called with CPL_FITS_START_CACHING, CPL will use internal storage to keep the FITS files open between calls and only close them when the FITS I/O mode is changed (or <a class="el" href="group__cpl__init.html#gaa4a8d9e17d7d35676b3d0bbb7a885128" title="Stop the internal subsystems of CPL. ">cpl_end()</a> is called).</p>
<p>If a CPL function that creates a FITS file is called any previously opened handles to that file are closed. If a CPL function that appends to a FITS file is called any previously opened read-only handles to that file are closed. If a CPL function that reads from a FITS file is called any previously opened read/write-handle to that file is used for the read. Any additional concurrent reads causes the file to also be opened for reading. This means that there is also a performance gain when alternating between appending to and reading from the same file. This optimized I/O mode cannot be used if the CPL application accesses a FITS file without using CPL. An incomplete list of such access is: Calls to rename(), remove(), unlink(), fopen() and access via another process started with for example system() or popen().</p>
<p>The caching of opened FITS files may be used in a multi-threaded environment to the extent that the underlying FITS library (CFITSIO) supports it. One implication of this is that multiple threads may only call CPL FITS saving functions on the same file using proper synchronization such as the OpenMP 'ordered' construct. CPL makes no attempt to verify that a CPL based application performs thread parallel FITS I/O correctly.</p>
<p>The mode CPL_FITS_STOP_CACHING causes all cached filed to be closed. Beware that this can cause an I/O error for a file that has otherwise not been accessed for some time.</p>
<p>Since CPL_FITS_STOP_CACHING closes all cached FITS files, the caller must ensure that this does not interfere with the concurrent use of those same files in another thread.</p>
<p>The mode CPL_FITS_RESTART_CACHING has the same effect as a call with CPL_FITS_STOP_CACHING followed by a call with CPL_FITS_START_CACHING.</p>
<p>The modes CPL_FITS_RESTART_CACHING and CPL_FITS_ONE may be combined. This causes all files cached by the calling thread to be closed. The caching remains active (for all threads), so subsequently opened files will be cached.</p>
<p>CPL_FITS_RESTART_CACHING can be used after an external modification of a FITS file also cached by CPL, thus allowing the caching to work together with the above mentioned external access to the same FITS files.</p>
<p>Possible <a class="el" href="group__cpl__error.html#ga49a0c316d52d2afbfd9fd94b95344900" title="Available error codes. ">_cpl_error_code_</a> set in this function:</p><ul>
<li>CPL_ERROR_ILLEGAL_INPUT if the mode is zero</li>
<li>CPL_ERROR_UNSUPPORTED_MODE if the mode is not supported</li>
<li>CPL_ERROR_INVALID_TYPE if mode is 1, e.g. due to a logical or (||) of the allowed options.</li>
<li>CPL_ERROR_BAD_FILE_FORMAT if the I/O caused by CPL_FITS_STOP_CACHING failed </li>
</ul>
<p>References <a class="el" href="group__cpl__error.html#gga49a0c316d52d2afbfd9fd94b95344900ae6ab32df318c1af9afcddcb8249cad51">CPL_ERROR_ILLEGAL_INPUT</a>, <a class="el" href="group__cpl__error.html#gga49a0c316d52d2afbfd9fd94b95344900a7907a24014a3a45aebe5ee1842f0c6f3">CPL_ERROR_INVALID_TYPE</a>, <a class="el" href="group__cpl__error.html#gga49a0c316d52d2afbfd9fd94b95344900a0239c1c63e9d21e98e45221a3ad60406">CPL_ERROR_NONE</a>, <a class="el" href="group__cpl__error.html#gga49a0c316d52d2afbfd9fd94b95344900a74ef8e37f3412e85cfc22840d13bdd0c">CPL_ERROR_UNSUPPORTED_MODE</a>, <a class="el" href="group__cpl__fits.html#gga29c73102ccb458b7b82500fa75fd697ca43d0bcea060ec75963f5f956c02a24f7">CPL_FITS_ONE</a>, <a class="el" href="group__cpl__fits.html#gga29c73102ccb458b7b82500fa75fd697ca220e5dc1a5a2c56a160f461f00bd641f">CPL_FITS_RESTART_CACHING</a>, <a class="el" href="group__cpl__fits.html#gga29c73102ccb458b7b82500fa75fd697cabfb063c0e6bf2ee95af08f80dfe879d2">CPL_FITS_START_CACHING</a>, and <a class="el" href="group__cpl__fits.html#gga29c73102ccb458b7b82500fa75fd697ca7e55a86b720cf358df0f5f92e4f8150e">CPL_FITS_STOP_CACHING</a>.</p>
<p>Referenced by <a class="el" href="group__cpl__init.html#gaa4a8d9e17d7d35676b3d0bbb7a885128">cpl_end()</a>, and <a class="el" href="group__cpl__init.html#gaca7531b1ca5c83c1de76eabf8d347bc2">cpl_init()</a>.</p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10
</small></address>
</body>
</html>
|