wcslib (8.2.2)

(root)/
share/
doc/
wcslib-8.2.2/
html/
structs.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>WCSLIB: WCSLIB data structures</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="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.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 id="projectrow">
  <td id="projectalign">
   <div id="projectname">WCSLIB<span id="projectnumber">&#160;8.2.2</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="index.html">WCSLIB 8.2.2 and PGSBOX 8.2.2</a></li>  </ul>
</div>
</div><!-- top -->
<div><div class="header">
  <div class="headertitle"><div class="title">WCSLIB data structures</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>The WCSLIB routines are based on data structures specific to them: wcsprm for the <a class="el" href="wcs_8h.html">wcs.h</a>,c routines, celprm for <a class="el" href="cel_8h.html">cel.h</a>,c, and likewise spcprm, linprm, prjprm, tabprm, and disprm, with struct definitions contained in the corresponding header files: <a class="el" href="wcs_8h.html">wcs.h</a>, <a class="el" href="cel_8h.html">cel.h</a>, etc. The structs store the parameters that define a coordinate transformation and also intermediate values derived from those parameters. As a high-level object, the wcsprm struct contains linprm, tabprm, spcprm, and celprm structs, and in turn the linprm struct contains disprm structs, and the celprm struct contains a prjprm struct. Hence the wcsprm struct contains everything needed for a complete coordinate description.</p>
<p>Applications programmers who use the top- and middle-level routines generally only need to pass wcsprm structs from one routine that fills them to another that uses them. However, since these structs are fundamental to WCSLIB it is worthwhile knowing something about the way they work.</p>
<p>Three basic operations apply to all WCSLIB structs:</p>
<ul>
<li>Initialize. Each struct has a specific initialization routine, e.g. <a class="el" href="wcs_8h.html#aab11243b60b10065fc85347bb3efa912" title="Default constructor for the wcsprm struct.">wcsinit()</a>, <a class="el" href="cel_8h.html#a1fe1b137ade45ea28e61f44d4708fb77" title="Default constructor for the celprm struct.">celini()</a>, <a class="el" href="spc_8h.html#a30c95d776068ef3cc959a50af9995fa9" title="Default constructor for the spcprm struct.">spcini()</a>, etc. These allocate memory (if required) and set all struct members to default values.</li>
<li>Fill in the required values. Each struct has members whose values must be provided. For example, for wcsprm these values correspond to FITS WCS header keyvalues as are provided by the top-level header parsing routine, <a class="el" href="wcshdr_8h.html#ac75623ee805ab7d43b0bba684c719a60" title="FITS WCS parser routine for image headers.">wcspih()</a>.</li>
<li>Compute intermediate values. Specific setup routines, e.g. <a class="el" href="wcs_8h.html#ae5cc3f5d249755583403cdf54d2ebb91" title="Setup routine for the wcsprm struct.">wcsset()</a>, <a class="el" href="cel_8h.html#ab0f67d1727750616f71c7bfcb3a037b6" title="Setup routine for the celprm struct.">celset()</a>, <a class="el" href="spc_8h.html#af2ee6399a65f2467841be79e4bbb41c3" title="Setup routine for the spcprm struct.">spcset()</a>, etc., compute intermediate values from the values provided. In particular, <a class="el" href="wcs_8h.html#ae5cc3f5d249755583403cdf54d2ebb91" title="Setup routine for the wcsprm struct.">wcsset()</a> analyses the FITS WCS keyvalues provided, fills the required values in the lower-level structs contained in wcsprm, and invokes the setup routine for each of them.</li>
</ul>
<p>Each struct contains a <em>flag</em> member that records its setup state. This is cleared by the initialization routine and checked by the routines that use the struct; they will invoke the setup routine automatically if necessary, hence it need not be invoked specifically by the application programmer. However, if any of the required values in a struct are changed then either the setup routine must be invoked on it, or else the <em>flag</em> must be zeroed to signal that the struct needs to be reset.</p>
<p>The initialization routine may be invoked repeatedly on a struct if it is desired to reuse it. However, the <em>flag</em> member of structs that contain allocated memory (wcsprm, linprm, tabprm, and disprm) must be set to -1 before the first initialization to initialize memory management, but not subsequently or else memory leaks will result.</p>
<p>Each struct has one or more service routines: to do deep copies from one to another, to print its contents, and to free allocated memory. Refer to the header files for a detailed description. </p>
</div></div><!-- contents -->
</div><!-- PageDoc -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Nov 29 2023 19:09:57 for WCSLIB by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
</small></address>
</body>
</html>