Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > acb94a8b2a4b1c8c2a966ed9ee99ffe4 > files > 186

lib64wcs-devel-4.18-2.mga4.x86_64.rpm

<!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.4"/>
<title>WCSLIB 4.18: getwcstab.h File Reference</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" />
</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 style="padding-left: 0.5em;">
   <div id="projectname">WCSLIB 4.18
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.4 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_af99bb3c152a306abd27951285ad1127.html">C</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">getwcstab.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;fitsio.h&gt;</code><br/>
</div>
<p><a href="getwcstab_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structwtbarr.html">wtbarr</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Extraction of coordinate lookup tables from BINTABLE.  <a href="structwtbarr.html#details">More...</a><br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</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:a96c804d78d44901bc5d497b30e47b7ad"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="getwcstab_8h.html#a96c804d78d44901bc5d497b30e47b7ad">fits_read_wcstab</a> (fitsfile *fptr, int nwtb, <a class="el" href="structwtbarr.html">wtbarr</a> *wtb, int *status)</td></tr>
<tr class="memdesc:a96c804d78d44901bc5d497b30e47b7ad"><td class="mdescLeft">&#160;</td><td class="mdescRight">FITS '<code><b>TAB</b></code>' table reading routine.  <a href="#a96c804d78d44901bc5d497b30e47b7ad">More...</a><br/></td></tr>
<tr class="separator:a96c804d78d44901bc5d497b30e47b7ad"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p><a class="el" href="getwcstab_8h.html#a96c804d78d44901bc5d497b30e47b7ad" title="FITS &#39;TAB&#39; table reading routine. ">fits_read_wcstab()</a>, an implementation of a FITS table reading routine for '<code><b>TAB</b></code>' coordinates, is provided for CFITSIO programmers. It has been incorporated into CFITSIO as of v3.006 with the definitions in this file, <a class="el" href="getwcstab_8h.html">getwcstab.h</a>, moved into fitsio.h.</p>
<p><a class="el" href="getwcstab_8h.html#a96c804d78d44901bc5d497b30e47b7ad" title="FITS &#39;TAB&#39; table reading routine. ">fits_read_wcstab()</a> is not included in the WCSLIB object library but the source code is presented here as it may be useful for programmers using an older version of CFITSIO than 3.006, or as a programming template for non-CFITSIO programmers. </p>
</div><h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a96c804d78d44901bc5d497b30e47b7ad"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int fits_read_wcstab </td>
          <td>(</td>
          <td class="paramtype">fitsfile *&#160;</td>
          <td class="paramname"><em>fptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>nwtb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structwtbarr.html">wtbarr</a> *&#160;</td>
          <td class="paramname"><em>wtb</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>status</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><b>fits_read_wcstab</b>() extracts arrays from a binary table required in constructing '<code><b>TAB</b></code>' coordinates.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">fptr</td><td>Pointer to the file handle returned, for example, by the fits_open_file() routine in CFITSIO. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">nwtb</td><td>Number of arrays to be read from the binary table(s).</td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">wtb</td><td>Address of the first element of an array of <a class="el" href="structwtbarr.html" title="Extraction of coordinate lookup tables from BINTABLE. ">wtbarr</a> typedefs. This <a class="el" href="structwtbarr.html" title="Extraction of coordinate lookup tables from BINTABLE. ">wtbarr</a> typedef is defined to match the <a class="el" href="structwtbarr.html" title="Extraction of coordinate lookup tables from BINTABLE. ">wtbarr</a> struct defined in WCSLIB. An array of such structs returned by the WCSLIB function <a class="el" href="wcshdr_8h.html#a6dd857f7b61a5b349cc8af5a4b6d8a1c" title="Tabular construction routine. ">wcstab()</a> as discussed in the notes below.</td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">status</td><td>CFITSIO status value.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CFITSIO status value.</dd></dl>
<p><b>Notes:</b> <br/>
 In order to maintain WCSLIB and CFITSIO as independent libraries it is not permissible for any CFITSIO library code to include WCSLIB header files, or vice versa. However, the CFITSIO function <b>fits_read_wcstab</b>() accepts an array of <a class="el" href="structwtbarr.html" title="Extraction of coordinate lookup tables from BINTABLE. ">wtbarr</a> structs defined in <a class="el" href="wcs_8h.html">wcs.h</a> within WCSLIB.</p>
<p>The problem therefore is to define the <a class="el" href="structwtbarr.html" title="Extraction of coordinate lookup tables from BINTABLE. ">wtbarr</a> struct within fitsio.h without including <a class="el" href="wcs_8h.html">wcs.h</a>, especially noting that <a class="el" href="wcs_8h.html">wcs.h</a> will often (but not always) be included together with fitsio.h in an applications program that uses <b>fits_read_wcstab</b>().</p>
<p>The solution adopted is for WCSLIB to define "struct <a class="el" href="structwtbarr.html" title="Extraction of coordinate lookup tables from BINTABLE. ">wtbarr</a>" while fitsio.h defines "typedef <a class="el" href="structwtbarr.html" title="Extraction of coordinate lookup tables from BINTABLE. ">wtbarr</a>" as an untagged struct with identical members. This allows both <a class="el" href="wcs_8h.html">wcs.h</a> and fitsio.h to define a <a class="el" href="structwtbarr.html" title="Extraction of coordinate lookup tables from BINTABLE. ">wtbarr</a> data type without conflict by virtue of the fact that structure tags and typedef names share different name spaces in C; Appendix A, Sect. A11.1 (p227) of the K&amp;R ANSI edition states that:</p>
<p>Identifiers fall into several name spaces that do not interfere with one another; the same identifier may be used for different purposes, even in the same scope, if the uses are in different name spaces. These classes are: objects, functions, typedef names, and enum constants; labels; tags of structures, unions, and enumerations; and members of each structure or union individually.</p>
<p>Therefore, declarations within WCSLIB look like </p>
<div class="fragment"><div class="line"><span class="keyword">struct </span><a class="code" href="structwtbarr.html" title="Extraction of coordinate lookup tables from BINTABLE. ">wtbarr</a> *w;</div>
</div><!-- fragment --><p>while within CFITSIO they are simply </p>
<div class="fragment"><div class="line"><a class="code" href="structwtbarr.html" title="Extraction of coordinate lookup tables from BINTABLE. ">wtbarr</a> *w;</div>
</div><!-- fragment --><p>As suggested by the commonality of the names, these are really the same aggregate data type. However, in passing a (struct <a class="el" href="structwtbarr.html" title="Extraction of coordinate lookup tables from BINTABLE. ">wtbarr</a> *) to <b>fits_read_wcstab</b>() a cast to (wtbarr *) is formally required.</p>
<p>When using WCSLIB and CFITSIO together in C++ the situation is complicated by the fact that typedefs and structs share the same namespace; C++ Annotated Reference Manual, Sect. 7.1.3 (p105). In that case the <a class="el" href="structwtbarr.html" title="Extraction of coordinate lookup tables from BINTABLE. ">wtbarr</a> struct in <a class="el" href="wcs_8h.html">wcs.h</a> is renamed by preprocessor macro substitution to wtbarr_s to distinguish it from the typedef defined in fitsio.h. However, the scope of this macro substitution is limited to <a class="el" href="wcs_8h.html">wcs.h</a> itself and CFITSIO programmer code, whether in C++ or C, should always use the <a class="el" href="structwtbarr.html" title="Extraction of coordinate lookup tables from BINTABLE. ">wtbarr</a> typedef. </p>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sat Jul 13 2013 20:00:26 for WCSLIB 4.18 by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.4
</small></address>
</body>
</html>