wcslib (8.2.2)
<!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: wcsfix.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="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"> 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&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&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="dir_af99bb3c152a306abd27951285ad1127.html">C</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#define-members">Macros</a> |
<a href="#enum-members">Enumerations</a> |
<a href="#func-members">Functions</a> |
<a href="#var-members">Variables</a> </div>
<div class="headertitle"><div class="title">wcsfix.h File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include "<a class="el" href="wcs_8h_source.html">wcs.h</a>"</code><br />
<code>#include "<a class="el" href="wcserr_8h_source.html">wcserr.h</a>"</code><br />
</div>
<p><a href="wcsfix_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 id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:af23e7b02522c40fa5dfbf3d569348844" id="r_af23e7b02522c40fa5dfbf3d569348844"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="wcsfix_8h.html#af23e7b02522c40fa5dfbf3d569348844">CDFIX</a>   0</td></tr>
<tr class="memdesc:af23e7b02522c40fa5dfbf3d569348844"><td class="mdescLeft"> </td><td class="mdescRight">Index of <a class="el" href="wcsfix_8h.html#a25714f1558ecbee6c1b1fef0abf8ea7f" title="Fix erroneously omitted CDi_ja keywords.">cdfix()</a> status value in vector returned by <a class="el" href="wcsfix_8h.html#a89e1b5b4d2fa89af03f5d1143352b05f" title="Translate a non-standard WCS struct.">wcsfix()</a>. <br /></td></tr>
<tr class="separator:af23e7b02522c40fa5dfbf3d569348844"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7181ebe5e9f0a4058642c56dc848bd5c" id="r_a7181ebe5e9f0a4058642c56dc848bd5c"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="wcsfix_8h.html#a7181ebe5e9f0a4058642c56dc848bd5c">DATFIX</a>   1</td></tr>
<tr class="memdesc:a7181ebe5e9f0a4058642c56dc848bd5c"><td class="mdescLeft"> </td><td class="mdescRight">Index of <a class="el" href="wcsfix_8h.html#a77b614a15de67b42040c2be46cbfca1a" title="Translate DATE-OBS and derive MJD-OBS or vice versa.">datfix()</a> status value in vector returned by <a class="el" href="wcsfix_8h.html#a89e1b5b4d2fa89af03f5d1143352b05f" title="Translate a non-standard WCS struct.">wcsfix()</a>. <br /></td></tr>
<tr class="separator:a7181ebe5e9f0a4058642c56dc848bd5c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac293192284a2143faaf5b3b1d0be9262" id="r_ac293192284a2143faaf5b3b1d0be9262"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="wcsfix_8h.html#ac293192284a2143faaf5b3b1d0be9262">OBSFIX</a>   2</td></tr>
<tr class="separator:ac293192284a2143faaf5b3b1d0be9262"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8f4a947e2605b35ffa92f08b113d60b2" id="r_a8f4a947e2605b35ffa92f08b113d60b2"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="wcsfix_8h.html#a8f4a947e2605b35ffa92f08b113d60b2">UNITFIX</a>   3</td></tr>
<tr class="memdesc:a8f4a947e2605b35ffa92f08b113d60b2"><td class="mdescLeft"> </td><td class="mdescRight">Index of <a class="el" href="wcsfix_8h.html#a883167275c4d3855ba453364db3d8d66" title="Correct aberrant CUNITia keyvalues.">unitfix()</a> status value in vector returned by <a class="el" href="wcsfix_8h.html#a89e1b5b4d2fa89af03f5d1143352b05f" title="Translate a non-standard WCS struct.">wcsfix()</a>. <br /></td></tr>
<tr class="separator:a8f4a947e2605b35ffa92f08b113d60b2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0816c5f2354ee6c0044e11867d7558ea" id="r_a0816c5f2354ee6c0044e11867d7558ea"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="wcsfix_8h.html#a0816c5f2354ee6c0044e11867d7558ea">SPCFIX</a>   4</td></tr>
<tr class="memdesc:a0816c5f2354ee6c0044e11867d7558ea"><td class="mdescLeft"> </td><td class="mdescRight">Index of <a class="el" href="wcsfix_8h.html#af011e4065b6179e19d2964bc9646b6af" title="Translate AIPS-convention spectral types.">spcfix()</a> status value in vector returned by <a class="el" href="wcsfix_8h.html#a89e1b5b4d2fa89af03f5d1143352b05f" title="Translate a non-standard WCS struct.">wcsfix()</a>. <br /></td></tr>
<tr class="separator:a0816c5f2354ee6c0044e11867d7558ea"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af1b99efe520fbd2d4bd0e5a35f87e186" id="r_af1b99efe520fbd2d4bd0e5a35f87e186"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="wcsfix_8h.html#af1b99efe520fbd2d4bd0e5a35f87e186">CELFIX</a>   5</td></tr>
<tr class="memdesc:af1b99efe520fbd2d4bd0e5a35f87e186"><td class="mdescLeft"> </td><td class="mdescRight">Index of <a class="el" href="wcsfix_8h.html#ac1df72303f64e50d5e3cb320c126443b" title="Translate AIPS-convention celestial projection types.">celfix()</a> status value in vector returned by <a class="el" href="wcsfix_8h.html#a89e1b5b4d2fa89af03f5d1143352b05f" title="Translate a non-standard WCS struct.">wcsfix()</a>. <br /></td></tr>
<tr class="separator:af1b99efe520fbd2d4bd0e5a35f87e186"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4d37e0274dff84649cba075b8761b3fa" id="r_a4d37e0274dff84649cba075b8761b3fa"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="wcsfix_8h.html#a4d37e0274dff84649cba075b8761b3fa">CYLFIX</a>   6</td></tr>
<tr class="memdesc:a4d37e0274dff84649cba075b8761b3fa"><td class="mdescLeft"> </td><td class="mdescRight">Index of <a class="el" href="wcsfix_8h.html#a07281faacbec1df800a417bf157751d7" title="Fix malformed cylindrical projections.">cylfix()</a> status value in vector returned by <a class="el" href="wcsfix_8h.html#a89e1b5b4d2fa89af03f5d1143352b05f" title="Translate a non-standard WCS struct.">wcsfix()</a>. <br /></td></tr>
<tr class="separator:a4d37e0274dff84649cba075b8761b3fa"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0ed13e54c3eacb9325afbae78ef33b61" id="r_a0ed13e54c3eacb9325afbae78ef33b61"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="wcsfix_8h.html#a0ed13e54c3eacb9325afbae78ef33b61">NWCSFIX</a>   7</td></tr>
<tr class="memdesc:a0ed13e54c3eacb9325afbae78ef33b61"><td class="mdescLeft"> </td><td class="mdescRight">Number of elements in the status vector returned by <a class="el" href="wcsfix_8h.html#a89e1b5b4d2fa89af03f5d1143352b05f" title="Translate a non-standard WCS struct.">wcsfix()</a>. <br /></td></tr>
<tr class="separator:a0ed13e54c3eacb9325afbae78ef33b61"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3229b126ed844da0a2d4f7abff1de7d0" id="r_a3229b126ed844da0a2d4f7abff1de7d0"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="wcsfix_8h.html#a3229b126ed844da0a2d4f7abff1de7d0">cylfix_errmsg</a>   <a class="el" href="wcsfix_8h.html#a256ce6281894f65dd15396cc0994e875">wcsfix_errmsg</a></td></tr>
<tr class="memdesc:a3229b126ed844da0a2d4f7abff1de7d0"><td class="mdescLeft"> </td><td class="mdescRight">Deprecated. <br /></td></tr>
<tr class="separator:a3229b126ed844da0a2d4f7abff1de7d0"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="enum-members" name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:a0399bbea1e28abad3259a8ea05b25183" id="r_a0399bbea1e28abad3259a8ea05b25183"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="wcsfix_8h.html#a0399bbea1e28abad3259a8ea05b25183">wcsfix_errmsg_enum</a> { <br />
  <a class="el" href="wcsfix_8h.html#a0399bbea1e28abad3259a8ea05b25183a1e29d170017673feccf26343a7fd9528">FIXERR_OBSGEO_FIX</a> = -5
, <a class="el" href="wcsfix_8h.html#a0399bbea1e28abad3259a8ea05b25183a1edfc4a839295befd132ce460d253311">FIXERR_DATE_FIX</a> = -4
, <a class="el" href="wcsfix_8h.html#a0399bbea1e28abad3259a8ea05b25183a7906f35912dd0fb39954bfd5140672a7">FIXERR_SPC_UPDATE</a> = -3
, <a class="el" href="wcsfix_8h.html#a0399bbea1e28abad3259a8ea05b25183a1e255b3aa269ff0c251ada8a6c3f9602">FIXERR_UNITS_ALIAS</a> = -2
, <br />
  <a class="el" href="wcsfix_8h.html#a0399bbea1e28abad3259a8ea05b25183aec3fdc50ed9f4ca8d80d7ce7751ef0e3">FIXERR_NO_CHANGE</a> = -1
, <a class="el" href="wcsfix_8h.html#a0399bbea1e28abad3259a8ea05b25183aee9fbc64e56bb6d307d06d8ef8e8b244">FIXERR_SUCCESS</a> = 0
, <a class="el" href="wcsfix_8h.html#a0399bbea1e28abad3259a8ea05b25183af574a836e251e8a0257da97580bb9354">FIXERR_NULL_POINTER</a> = 1
, <a class="el" href="wcsfix_8h.html#a0399bbea1e28abad3259a8ea05b25183a1e4cf4eeb3cd2f4d8c2c1f040aa62f6c">FIXERR_MEMORY</a> = 2
, <br />
  <a class="el" href="wcsfix_8h.html#a0399bbea1e28abad3259a8ea05b25183a8553bf40509263e3c3a198810f83d26e">FIXERR_SINGULAR_MTX</a> = 3
, <a class="el" href="wcsfix_8h.html#a0399bbea1e28abad3259a8ea05b25183a421fc9b9a2aac54bc832b3c1180f8f07">FIXERR_BAD_CTYPE</a> = 4
, <a class="el" href="wcsfix_8h.html#a0399bbea1e28abad3259a8ea05b25183a26d787caed068586fbef3d3c0fbce41f">FIXERR_BAD_PARAM</a> = 5
, <a class="el" href="wcsfix_8h.html#a0399bbea1e28abad3259a8ea05b25183a5dd410d6f1a55543c4f7d0f82435eb40">FIXERR_BAD_COORD_TRANS</a> = 6
, <br />
  <a class="el" href="wcsfix_8h.html#a0399bbea1e28abad3259a8ea05b25183a81b5390b4f770515ae950d9e382b2885">FIXERR_ILL_COORD_TRANS</a> = 7
, <a class="el" href="wcsfix_8h.html#a0399bbea1e28abad3259a8ea05b25183a3f4b7a9a303943f6c12ea51cce2240cf">FIXERR_BAD_CORNER_PIX</a> = 8
, <a class="el" href="wcsfix_8h.html#a0399bbea1e28abad3259a8ea05b25183ad6bf7801d043f41f67c54677d6cfcb75">FIXERR_NO_REF_PIX_COORD</a> = 9
, <a class="el" href="wcsfix_8h.html#a0399bbea1e28abad3259a8ea05b25183a15a9e5f9cbb559ef53018e9aade43e88">FIXERR_NO_REF_PIX_VAL</a> = 10
<br />
}</td></tr>
<tr class="separator:a0399bbea1e28abad3259a8ea05b25183"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a89e1b5b4d2fa89af03f5d1143352b05f" id="r_a89e1b5b4d2fa89af03f5d1143352b05f"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="wcsfix_8h.html#a89e1b5b4d2fa89af03f5d1143352b05f">wcsfix</a> (int ctrl, const int naxis[], struct <a class="el" href="structwcsprm.html">wcsprm</a> *wcs, int stat[])</td></tr>
<tr class="memdesc:a89e1b5b4d2fa89af03f5d1143352b05f"><td class="mdescLeft"> </td><td class="mdescRight">Translate a non-standard WCS struct. <br /></td></tr>
<tr class="separator:a89e1b5b4d2fa89af03f5d1143352b05f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a62298e0fb06332a282d9daab718a1286" id="r_a62298e0fb06332a282d9daab718a1286"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="wcsfix_8h.html#a62298e0fb06332a282d9daab718a1286">wcsfixi</a> (int ctrl, const int naxis[], struct <a class="el" href="structwcsprm.html">wcsprm</a> *wcs, int stat[], struct <a class="el" href="structwcserr.html">wcserr</a> info[])</td></tr>
<tr class="memdesc:a62298e0fb06332a282d9daab718a1286"><td class="mdescLeft"> </td><td class="mdescRight">Translate a non-standard WCS struct. <br /></td></tr>
<tr class="separator:a62298e0fb06332a282d9daab718a1286"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a25714f1558ecbee6c1b1fef0abf8ea7f" id="r_a25714f1558ecbee6c1b1fef0abf8ea7f"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="wcsfix_8h.html#a25714f1558ecbee6c1b1fef0abf8ea7f">cdfix</a> (struct <a class="el" href="structwcsprm.html">wcsprm</a> *wcs)</td></tr>
<tr class="memdesc:a25714f1558ecbee6c1b1fef0abf8ea7f"><td class="mdescLeft"> </td><td class="mdescRight">Fix erroneously omitted <code><b>CD</b>i<b>_</b>ja</code> keywords. <br /></td></tr>
<tr class="separator:a25714f1558ecbee6c1b1fef0abf8ea7f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a77b614a15de67b42040c2be46cbfca1a" id="r_a77b614a15de67b42040c2be46cbfca1a"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="wcsfix_8h.html#a77b614a15de67b42040c2be46cbfca1a">datfix</a> (struct <a class="el" href="structwcsprm.html">wcsprm</a> *wcs)</td></tr>
<tr class="memdesc:a77b614a15de67b42040c2be46cbfca1a"><td class="mdescLeft"> </td><td class="mdescRight">Translate <code><b>DATE-OBS</b></code> and derive <code><b>MJD-OBS</b></code> or vice versa. <br /></td></tr>
<tr class="separator:a77b614a15de67b42040c2be46cbfca1a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a52691a17e224d8f4f1d1f897798efa49" id="r_a52691a17e224d8f4f1d1f897798efa49"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="wcsfix_8h.html#a52691a17e224d8f4f1d1f897798efa49">obsfix</a> (int ctrl, struct <a class="el" href="structwcsprm.html">wcsprm</a> *wcs)</td></tr>
<tr class="memdesc:a52691a17e224d8f4f1d1f897798efa49"><td class="mdescLeft"> </td><td class="mdescRight">complete the <code><b>OBS</b></code>GEO-[XYZLBH] vector of observatory coordinates. <br /></td></tr>
<tr class="separator:a52691a17e224d8f4f1d1f897798efa49"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a883167275c4d3855ba453364db3d8d66" id="r_a883167275c4d3855ba453364db3d8d66"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="wcsfix_8h.html#a883167275c4d3855ba453364db3d8d66">unitfix</a> (int ctrl, struct <a class="el" href="structwcsprm.html">wcsprm</a> *wcs)</td></tr>
<tr class="memdesc:a883167275c4d3855ba453364db3d8d66"><td class="mdescLeft"> </td><td class="mdescRight">Correct aberrant <code><b>CUNIT</b>ia</code> keyvalues. <br /></td></tr>
<tr class="separator:a883167275c4d3855ba453364db3d8d66"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af011e4065b6179e19d2964bc9646b6af" id="r_af011e4065b6179e19d2964bc9646b6af"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="wcsfix_8h.html#af011e4065b6179e19d2964bc9646b6af">spcfix</a> (struct <a class="el" href="structwcsprm.html">wcsprm</a> *wcs)</td></tr>
<tr class="memdesc:af011e4065b6179e19d2964bc9646b6af"><td class="mdescLeft"> </td><td class="mdescRight">Translate AIPS-convention spectral types. <br /></td></tr>
<tr class="separator:af011e4065b6179e19d2964bc9646b6af"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac1df72303f64e50d5e3cb320c126443b" id="r_ac1df72303f64e50d5e3cb320c126443b"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="wcsfix_8h.html#ac1df72303f64e50d5e3cb320c126443b">celfix</a> (struct <a class="el" href="structwcsprm.html">wcsprm</a> *wcs)</td></tr>
<tr class="memdesc:ac1df72303f64e50d5e3cb320c126443b"><td class="mdescLeft"> </td><td class="mdescRight">Translate AIPS-convention celestial projection types. <br /></td></tr>
<tr class="separator:ac1df72303f64e50d5e3cb320c126443b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a07281faacbec1df800a417bf157751d7" id="r_a07281faacbec1df800a417bf157751d7"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="wcsfix_8h.html#a07281faacbec1df800a417bf157751d7">cylfix</a> (const int naxis[], struct <a class="el" href="structwcsprm.html">wcsprm</a> *wcs)</td></tr>
<tr class="memdesc:a07281faacbec1df800a417bf157751d7"><td class="mdescLeft"> </td><td class="mdescRight">Fix malformed cylindrical projections. <br /></td></tr>
<tr class="separator:a07281faacbec1df800a417bf157751d7"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7b70e8127424672db38ce3e653e46467" id="r_a7b70e8127424672db38ce3e653e46467"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="wcsfix_8h.html#a7b70e8127424672db38ce3e653e46467">wcspcx</a> (struct <a class="el" href="structwcsprm.html">wcsprm</a> *wcs, int dopc, int permute, double rotn[2])</td></tr>
<tr class="memdesc:a7b70e8127424672db38ce3e653e46467"><td class="mdescLeft"> </td><td class="mdescRight">regularize PCi_j. <br /></td></tr>
<tr class="separator:a7b70e8127424672db38ce3e653e46467"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="var-members" name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:a256ce6281894f65dd15396cc0994e875" id="r_a256ce6281894f65dd15396cc0994e875"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="wcsfix_8h.html#a256ce6281894f65dd15396cc0994e875">wcsfix_errmsg</a> []</td></tr>
<tr class="memdesc:a256ce6281894f65dd15396cc0994e875"><td class="mdescLeft"> </td><td class="mdescRight">Status return messages. <br /></td></tr>
<tr class="separator:a256ce6281894f65dd15396cc0994e875"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Routines in this suite identify and translate various forms of construct known to occur in FITS headers that violate the FITS World Coordinate System (WCS) standard described in </p><div class="fragment"><div class="line"><span class="stringliteral">"Representations of world coordinates in FITS"</span>,</div>
<div class="line">Greisen, E.W., & Calabretta, M.R. 2002, A&A, 395, 1061 (WCS Paper I)</div>
<div class="line"> </div>
<div class="line"><span class="stringliteral">"Representations of celestial coordinates in FITS"</span>,</div>
<div class="line">Calabretta, M.R., & Greisen, E.W. 2002, A&A, 395, 1077 (WCS Paper II)</div>
<div class="line"> </div>
<div class="line"><span class="stringliteral">"Representations of spectral coordinates in FITS"</span>,</div>
<div class="line">Greisen, E.W., Calabretta, M.R., Valdes, F.G., & Allen, S.L.</div>
<div class="line">2006, A&A, 446, 747 (WCS Paper III)</div>
<div class="line"> </div>
<div class="line"><span class="stringliteral">"Representations of time coordinates in FITS -</span></div>
<div class="line"><span class="stringliteral"> Time and relative dimension in space"</span>,</div>
<div class="line">Rots, A.H., Bunclark, P.S., Calabretta, M.R., Allen, S.L.,</div>
<div class="line">Manchester, R.N., & Thompson, W.T. 2015, A&A, 574, A36 (WCS Paper VII)</div>
</div><!-- fragment --><p>Repairs effected by these routines range from the translation of non-standard values for standard WCS keywords, to the repair of malformed coordinate representations. Some routines are also provided to check the consistency of pairs of keyvalues that define the same measure in two different ways, for example, as a date and an MJD.</p>
<p>A separate routine, <a class="el" href="wcsfix_8h.html#a7b70e8127424672db38ce3e653e46467" title="regularize PCi_j.">wcspcx()</a>, "regularizes" the linear transformation matrix component (PCi_j) of the coordinate transformation to make it more human- readable. Where a coordinate description was constructed from CDi_j, it decomposes it into PCi_j + CDELTi in a meaningful way. Optionally, it can also diagonalize the PCi_j matrix (as far as possible), i.e. undo a transposition of axes in the intermediate pixel coordinate system.</p>
<p><b>Non-standard keyvalues:</b> <br />
AIPS-convention celestial projection types, <code><b>NCP</b></code> and <code><b>GLS</b></code>, and spectral types, <code><b>'FREQ-LSR'</b></code>, <code><b>'FELO-HEL'</b></code>, etc., set in <code><b>CTYPE</b>ia</code> are translated on-the-fly by <a class="el" href="wcs_8h.html#ae5cc3f5d249755583403cdf54d2ebb91" title="Setup routine for the wcsprm struct.">wcsset()</a> but without modifying the relevant ctype[], pv[] or specsys members of the wcsprm struct. That is, only the information extracted from ctype[] is translated when <a class="el" href="wcs_8h.html#ae5cc3f5d249755583403cdf54d2ebb91" title="Setup routine for the wcsprm struct.">wcsset()</a> fills in <a class="el" href="structwcsprm.html#ac8391dd770637dbb841067996b7777ba">wcsprm::cel</a> (celprm struct) or <a class="el" href="structwcsprm.html#ae83952aec7c1ac76c090bc89bf4eeea7">wcsprm::spc</a> (spcprm struct).</p>
<p>On the other hand, these routines do change the values of <a class="el" href="structwcsprm.html#ae1f462606974e1324cd38f143eda691e">wcsprm::ctype</a>[], <a class="el" href="structwcsprm.html#a04fbd6ed1b338e225f2291523e64be2c">wcsprm::pv</a>[], <a class="el" href="structwcsprm.html#ac089e5d0e3191255ceaea7f8591b27ea">wcsprm::specsys</a> and other wcsprm struct members as appropriate to produce the same result as if the FITS header itself had been translated.</p>
<p>Auxiliary WCS header information not used directly by WCSLIB may also be translated. For example, the older <code><b>DATE-OBS</b></code> date format (<a class="el" href="structwcsprm.html#aad387ccbd7847672b5dc2223d9124120">wcsprm::dateobs</a>) is recast to year-2000 standard form, and <code><b>MJD-OBS</b></code> (<a class="el" href="structwcsprm.html#ac0cb013b1505fb7abd4167ac0db0e0aa">wcsprm::mjdobs</a>) will be deduced from it if not already set.</p>
<p>Certain combinations of keyvalues that result in malformed coordinate systems, as described in Sect. 7.3.4 of Paper I, may also be repaired. These are handled by <a class="el" href="wcsfix_8h.html#a07281faacbec1df800a417bf157751d7" title="Fix malformed cylindrical projections.">cylfix()</a>.</p>
<p><b>Non-standard keywords:</b> <br />
The AIPS-convention CROTAn keywords are recognized as quasi-standard and as such are accomodated by <a class="el" href="structwcsprm.html#af124a4259475ea355ced38e73a05363a">wcsprm::crota</a>[] and translated to <a class="el" href="structwcsprm.html#a3495a5b0ef529706ec9a0af5c3163d63">wcsprm::pc</a>[][] by <a class="el" href="wcs_8h.html#ae5cc3f5d249755583403cdf54d2ebb91" title="Setup routine for the wcsprm struct.">wcsset()</a>. These are not dealt with here, nor are any other non-standard keywords since these routines work only on the contents of a wcsprm struct and do not deal with FITS headers per se. In particular, they do not identify or translate <code><b>CD00i00j</b></code>, <code><b>PC00i00j</b></code>, <code><b>PROJPn</b></code>, <code><b>EPOCH</b></code>, <code><b>VELREF</b></code> or <code><b>VSOURCEa</b></code> keywords; this may be done by the FITS WCS header parser supplied with WCSLIB, refer to <a class="el" href="wcshdr_8h.html">wcshdr.h</a>.</p>
<p><a class="el" href="wcsfix_8h.html#a89e1b5b4d2fa89af03f5d1143352b05f" title="Translate a non-standard WCS struct.">wcsfix()</a> and <a class="el" href="wcsfix_8h.html#a62298e0fb06332a282d9daab718a1286" title="Translate a non-standard WCS struct.">wcsfixi()</a> apply all of the corrections handled by the following specific functions, which may also be invoked separately:</p>
<ul>
<li>
<p class="startli"><a class="el" href="wcsfix_8h.html#a25714f1558ecbee6c1b1fef0abf8ea7f" title="Fix erroneously omitted CDi_ja keywords.">cdfix()</a>: Sets the diagonal element of the <code><b>CD</b>i<b>_</b>ja</code> matrix to 1.0 if all <code><b>CD</b>i<b>_</b>ja</code> keywords associated with a particular axis are omitted.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli"><a class="el" href="wcsfix_8h.html#a77b614a15de67b42040c2be46cbfca1a" title="Translate DATE-OBS and derive MJD-OBS or vice versa.">datfix()</a>: recast an older <code><b>DATE-OBS</b></code> date format in dateobs to year-2000 standard form. Derive dateref from mjdref if not already set. Alternatively, if dateref is set and mjdref isn't, then derive mjdref from it. If both are set, then check consistency. Likewise for dateobs and mjdobs; datebeg and mjdbeg; dateavg and mjdavg; and dateend and mjdend.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli"><a class="el" href="wcsfix_8h.html#a52691a17e224d8f4f1d1f897798efa49" title="complete the OBSGEO-[XYZLBH] vector of observatory coordinates.">obsfix()</a>: if only one half of obsgeo[] is set, then derive the other half from it. If both halves are set, then check consistency.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli"><a class="el" href="wcsfix_8h.html#a883167275c4d3855ba453364db3d8d66" title="Correct aberrant CUNITia keyvalues.">unitfix()</a>: translate some commonly used but non-standard unit strings in the <code><b>CUNIT</b>ia</code> keyvalues, e.g. '<code><b>DEG</b></code>' -> '<code><b>deg</b></code>'.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli"><a class="el" href="wcsfix_8h.html#af011e4065b6179e19d2964bc9646b6af" title="Translate AIPS-convention spectral types.">spcfix()</a>: translate AIPS-convention spectral types, <code><b>'FREQ-LSR'</b></code>, <code><b>'FELO-HEL'</b></code>, etc., in ctype[] as set from <code><b>CTYPE</b>ia</code>.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli"><a class="el" href="wcsfix_8h.html#ac1df72303f64e50d5e3cb320c126443b" title="Translate AIPS-convention celestial projection types.">celfix()</a>: translate AIPS-convention celestial projection types, <code><b>NCP</b></code> and <code><b>GLS</b></code>, in ctype[] as set from <code><b>CTYPE</b>ia</code>.</p>
<p class="endli"></p>
</li>
<li>
<a class="el" href="wcsfix_8h.html#a07281faacbec1df800a417bf157751d7" title="Fix malformed cylindrical projections.">cylfix()</a>: fixes WCS keyvalues for malformed cylindrical projections that suffer from the problem described in Sect. 7.3.4 of Paper I. </li>
</ul>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a id="af23e7b02522c40fa5dfbf3d569348844" name="af23e7b02522c40fa5dfbf3d569348844"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af23e7b02522c40fa5dfbf3d569348844">◆ </a></span>CDFIX</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define CDFIX   0</td>
</tr>
</table>
</div><div class="memdoc">
<p>Index of <a class="el" href="wcsfix_8h.html#a25714f1558ecbee6c1b1fef0abf8ea7f" title="Fix erroneously omitted CDi_ja keywords.">cdfix()</a> status value in vector returned by <a class="el" href="wcsfix_8h.html#a89e1b5b4d2fa89af03f5d1143352b05f" title="Translate a non-standard WCS struct.">wcsfix()</a>. </p>
<p>Index of the status value returned by <a class="el" href="wcsfix_8h.html#a25714f1558ecbee6c1b1fef0abf8ea7f" title="Fix erroneously omitted CDi_ja keywords.">cdfix()</a> in the status vector returned by <a class="el" href="wcsfix_8h.html#a89e1b5b4d2fa89af03f5d1143352b05f" title="Translate a non-standard WCS struct.">wcsfix()</a>. </p>
</div>
</div>
<a id="a7181ebe5e9f0a4058642c56dc848bd5c" name="a7181ebe5e9f0a4058642c56dc848bd5c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7181ebe5e9f0a4058642c56dc848bd5c">◆ </a></span>DATFIX</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define DATFIX   1</td>
</tr>
</table>
</div><div class="memdoc">
<p>Index of <a class="el" href="wcsfix_8h.html#a77b614a15de67b42040c2be46cbfca1a" title="Translate DATE-OBS and derive MJD-OBS or vice versa.">datfix()</a> status value in vector returned by <a class="el" href="wcsfix_8h.html#a89e1b5b4d2fa89af03f5d1143352b05f" title="Translate a non-standard WCS struct.">wcsfix()</a>. </p>
<p>Index of the status value returned by <a class="el" href="wcsfix_8h.html#a77b614a15de67b42040c2be46cbfca1a" title="Translate DATE-OBS and derive MJD-OBS or vice versa.">datfix()</a> in the status vector returned by <a class="el" href="wcsfix_8h.html#a89e1b5b4d2fa89af03f5d1143352b05f" title="Translate a non-standard WCS struct.">wcsfix()</a>. </p>
</div>
</div>
<a id="ac293192284a2143faaf5b3b1d0be9262" name="ac293192284a2143faaf5b3b1d0be9262"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac293192284a2143faaf5b3b1d0be9262">◆ </a></span>OBSFIX</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define OBSFIX   2</td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a id="a8f4a947e2605b35ffa92f08b113d60b2" name="a8f4a947e2605b35ffa92f08b113d60b2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8f4a947e2605b35ffa92f08b113d60b2">◆ </a></span>UNITFIX</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define UNITFIX   3</td>
</tr>
</table>
</div><div class="memdoc">
<p>Index of <a class="el" href="wcsfix_8h.html#a883167275c4d3855ba453364db3d8d66" title="Correct aberrant CUNITia keyvalues.">unitfix()</a> status value in vector returned by <a class="el" href="wcsfix_8h.html#a89e1b5b4d2fa89af03f5d1143352b05f" title="Translate a non-standard WCS struct.">wcsfix()</a>. </p>
<p>Index of the status value returned by <a class="el" href="wcsfix_8h.html#a883167275c4d3855ba453364db3d8d66" title="Correct aberrant CUNITia keyvalues.">unitfix()</a> in the status vector returned by <a class="el" href="wcsfix_8h.html#a89e1b5b4d2fa89af03f5d1143352b05f" title="Translate a non-standard WCS struct.">wcsfix()</a>. </p>
</div>
</div>
<a id="a0816c5f2354ee6c0044e11867d7558ea" name="a0816c5f2354ee6c0044e11867d7558ea"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0816c5f2354ee6c0044e11867d7558ea">◆ </a></span>SPCFIX</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define SPCFIX   4</td>
</tr>
</table>
</div><div class="memdoc">
<p>Index of <a class="el" href="wcsfix_8h.html#af011e4065b6179e19d2964bc9646b6af" title="Translate AIPS-convention spectral types.">spcfix()</a> status value in vector returned by <a class="el" href="wcsfix_8h.html#a89e1b5b4d2fa89af03f5d1143352b05f" title="Translate a non-standard WCS struct.">wcsfix()</a>. </p>
<p>Index of the status value returned by <a class="el" href="wcsfix_8h.html#af011e4065b6179e19d2964bc9646b6af" title="Translate AIPS-convention spectral types.">spcfix()</a> in the status vector returned by <a class="el" href="wcsfix_8h.html#a89e1b5b4d2fa89af03f5d1143352b05f" title="Translate a non-standard WCS struct.">wcsfix()</a>. </p>
</div>
</div>
<a id="af1b99efe520fbd2d4bd0e5a35f87e186" name="af1b99efe520fbd2d4bd0e5a35f87e186"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af1b99efe520fbd2d4bd0e5a35f87e186">◆ </a></span>CELFIX</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define CELFIX   5</td>
</tr>
</table>
</div><div class="memdoc">
<p>Index of <a class="el" href="wcsfix_8h.html#ac1df72303f64e50d5e3cb320c126443b" title="Translate AIPS-convention celestial projection types.">celfix()</a> status value in vector returned by <a class="el" href="wcsfix_8h.html#a89e1b5b4d2fa89af03f5d1143352b05f" title="Translate a non-standard WCS struct.">wcsfix()</a>. </p>
<p>Index of the status value returned by <a class="el" href="wcsfix_8h.html#ac1df72303f64e50d5e3cb320c126443b" title="Translate AIPS-convention celestial projection types.">celfix()</a> in the status vector returned by <a class="el" href="wcsfix_8h.html#a89e1b5b4d2fa89af03f5d1143352b05f" title="Translate a non-standard WCS struct.">wcsfix()</a>. </p>
</div>
</div>
<a id="a4d37e0274dff84649cba075b8761b3fa" name="a4d37e0274dff84649cba075b8761b3fa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4d37e0274dff84649cba075b8761b3fa">◆ </a></span>CYLFIX</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define CYLFIX   6</td>
</tr>
</table>
</div><div class="memdoc">
<p>Index of <a class="el" href="wcsfix_8h.html#a07281faacbec1df800a417bf157751d7" title="Fix malformed cylindrical projections.">cylfix()</a> status value in vector returned by <a class="el" href="wcsfix_8h.html#a89e1b5b4d2fa89af03f5d1143352b05f" title="Translate a non-standard WCS struct.">wcsfix()</a>. </p>
<p>Index of the status value returned by <a class="el" href="wcsfix_8h.html#a07281faacbec1df800a417bf157751d7" title="Fix malformed cylindrical projections.">cylfix()</a> in the status vector returned by <a class="el" href="wcsfix_8h.html#a89e1b5b4d2fa89af03f5d1143352b05f" title="Translate a non-standard WCS struct.">wcsfix()</a>. </p>
</div>
</div>
<a id="a0ed13e54c3eacb9325afbae78ef33b61" name="a0ed13e54c3eacb9325afbae78ef33b61"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0ed13e54c3eacb9325afbae78ef33b61">◆ </a></span>NWCSFIX</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define NWCSFIX   7</td>
</tr>
</table>
</div><div class="memdoc">
<p>Number of elements in the status vector returned by <a class="el" href="wcsfix_8h.html#a89e1b5b4d2fa89af03f5d1143352b05f" title="Translate a non-standard WCS struct.">wcsfix()</a>. </p>
<p>Number of elements in the status vector returned by <a class="el" href="wcsfix_8h.html#a89e1b5b4d2fa89af03f5d1143352b05f" title="Translate a non-standard WCS struct.">wcsfix()</a>. </p>
</div>
</div>
<a id="a3229b126ed844da0a2d4f7abff1de7d0" name="a3229b126ed844da0a2d4f7abff1de7d0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3229b126ed844da0a2d4f7abff1de7d0">◆ </a></span>cylfix_errmsg</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define cylfix_errmsg   <a class="el" href="wcsfix_8h.html#a256ce6281894f65dd15396cc0994e875">wcsfix_errmsg</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>Deprecated. </p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000040">Deprecated:</a></b></dt><dd>Added for backwards compatibility, use <a class="el" href="wcsfix_8h.html#a256ce6281894f65dd15396cc0994e875" title="Status return messages.">wcsfix_errmsg</a> directly now instead. </dd></dl>
</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="a0399bbea1e28abad3259a8ea05b25183" name="a0399bbea1e28abad3259a8ea05b25183"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0399bbea1e28abad3259a8ea05b25183">◆ </a></span>wcsfix_errmsg_enum</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="wcsfix_8h.html#a0399bbea1e28abad3259a8ea05b25183">wcsfix_errmsg_enum</a></td>
</tr>
</table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a0399bbea1e28abad3259a8ea05b25183a1e29d170017673feccf26343a7fd9528" name="a0399bbea1e28abad3259a8ea05b25183a1e29d170017673feccf26343a7fd9528"></a>FIXERR_OBSGEO_FIX </td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a0399bbea1e28abad3259a8ea05b25183a1edfc4a839295befd132ce460d253311" name="a0399bbea1e28abad3259a8ea05b25183a1edfc4a839295befd132ce460d253311"></a>FIXERR_DATE_FIX </td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a0399bbea1e28abad3259a8ea05b25183a7906f35912dd0fb39954bfd5140672a7" name="a0399bbea1e28abad3259a8ea05b25183a7906f35912dd0fb39954bfd5140672a7"></a>FIXERR_SPC_UPDATE </td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a0399bbea1e28abad3259a8ea05b25183a1e255b3aa269ff0c251ada8a6c3f9602" name="a0399bbea1e28abad3259a8ea05b25183a1e255b3aa269ff0c251ada8a6c3f9602"></a>FIXERR_UNITS_ALIAS </td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a0399bbea1e28abad3259a8ea05b25183aec3fdc50ed9f4ca8d80d7ce7751ef0e3" name="a0399bbea1e28abad3259a8ea05b25183aec3fdc50ed9f4ca8d80d7ce7751ef0e3"></a>FIXERR_NO_CHANGE </td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a0399bbea1e28abad3259a8ea05b25183aee9fbc64e56bb6d307d06d8ef8e8b244" name="a0399bbea1e28abad3259a8ea05b25183aee9fbc64e56bb6d307d06d8ef8e8b244"></a>FIXERR_SUCCESS </td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a0399bbea1e28abad3259a8ea05b25183af574a836e251e8a0257da97580bb9354" name="a0399bbea1e28abad3259a8ea05b25183af574a836e251e8a0257da97580bb9354"></a>FIXERR_NULL_POINTER </td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a0399bbea1e28abad3259a8ea05b25183a1e4cf4eeb3cd2f4d8c2c1f040aa62f6c" name="a0399bbea1e28abad3259a8ea05b25183a1e4cf4eeb3cd2f4d8c2c1f040aa62f6c"></a>FIXERR_MEMORY </td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a0399bbea1e28abad3259a8ea05b25183a8553bf40509263e3c3a198810f83d26e" name="a0399bbea1e28abad3259a8ea05b25183a8553bf40509263e3c3a198810f83d26e"></a>FIXERR_SINGULAR_MTX </td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a0399bbea1e28abad3259a8ea05b25183a421fc9b9a2aac54bc832b3c1180f8f07" name="a0399bbea1e28abad3259a8ea05b25183a421fc9b9a2aac54bc832b3c1180f8f07"></a>FIXERR_BAD_CTYPE </td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a0399bbea1e28abad3259a8ea05b25183a26d787caed068586fbef3d3c0fbce41f" name="a0399bbea1e28abad3259a8ea05b25183a26d787caed068586fbef3d3c0fbce41f"></a>FIXERR_BAD_PARAM </td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a0399bbea1e28abad3259a8ea05b25183a5dd410d6f1a55543c4f7d0f82435eb40" name="a0399bbea1e28abad3259a8ea05b25183a5dd410d6f1a55543c4f7d0f82435eb40"></a>FIXERR_BAD_COORD_TRANS </td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a0399bbea1e28abad3259a8ea05b25183a81b5390b4f770515ae950d9e382b2885" name="a0399bbea1e28abad3259a8ea05b25183a81b5390b4f770515ae950d9e382b2885"></a>FIXERR_ILL_COORD_TRANS </td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a0399bbea1e28abad3259a8ea05b25183a3f4b7a9a303943f6c12ea51cce2240cf" name="a0399bbea1e28abad3259a8ea05b25183a3f4b7a9a303943f6c12ea51cce2240cf"></a>FIXERR_BAD_CORNER_PIX </td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a0399bbea1e28abad3259a8ea05b25183ad6bf7801d043f41f67c54677d6cfcb75" name="a0399bbea1e28abad3259a8ea05b25183ad6bf7801d043f41f67c54677d6cfcb75"></a>FIXERR_NO_REF_PIX_COORD </td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a0399bbea1e28abad3259a8ea05b25183a15a9e5f9cbb559ef53018e9aade43e88" name="a0399bbea1e28abad3259a8ea05b25183a15a9e5f9cbb559ef53018e9aade43e88"></a>FIXERR_NO_REF_PIX_VAL </td><td class="fielddoc"></td></tr>
</table>
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="a89e1b5b4d2fa89af03f5d1143352b05f" name="a89e1b5b4d2fa89af03f5d1143352b05f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a89e1b5b4d2fa89af03f5d1143352b05f">◆ </a></span>wcsfix()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int wcsfix </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"><em>ctrl</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const int </td>
<td class="paramname"><em>naxis</em>[], </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">struct <a class="el" href="structwcsprm.html">wcsprm</a> * </td>
<td class="paramname"><em>wcs</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>stat</em>[] </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Translate a non-standard WCS struct. </p>
<p><b>wcsfix</b>() is identical to <b>wcsfixi</b>(), but lacks the info argument. </p>
</div>
</div>
<a id="a62298e0fb06332a282d9daab718a1286" name="a62298e0fb06332a282d9daab718a1286"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a62298e0fb06332a282d9daab718a1286">◆ </a></span>wcsfixi()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int wcsfixi </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"><em>ctrl</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const int </td>
<td class="paramname"><em>naxis</em>[], </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">struct <a class="el" href="structwcsprm.html">wcsprm</a> * </td>
<td class="paramname"><em>wcs</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>stat</em>[], </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">struct <a class="el" href="structwcserr.html">wcserr</a> </td>
<td class="paramname"><em>info</em>[] </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Translate a non-standard WCS struct. </p>
<p><b>wcsfixi</b>() applies all of the corrections handled separately by <a class="el" href="wcsfix_8h.html#a25714f1558ecbee6c1b1fef0abf8ea7f" title="Fix erroneously omitted CDi_ja keywords.">cdfix()</a>, <a class="el" href="wcsfix_8h.html#a77b614a15de67b42040c2be46cbfca1a" title="Translate DATE-OBS and derive MJD-OBS or vice versa.">datfix()</a>, <a class="el" href="wcsfix_8h.html#a52691a17e224d8f4f1d1f897798efa49" title="complete the OBSGEO-[XYZLBH] vector of observatory coordinates.">obsfix()</a>, <a class="el" href="wcsfix_8h.html#a883167275c4d3855ba453364db3d8d66" title="Correct aberrant CUNITia keyvalues.">unitfix()</a>, <a class="el" href="wcsfix_8h.html#af011e4065b6179e19d2964bc9646b6af" title="Translate AIPS-convention spectral types.">spcfix()</a>, <a class="el" href="wcsfix_8h.html#ac1df72303f64e50d5e3cb320c126443b" title="Translate AIPS-convention celestial projection types.">celfix()</a>, and <a class="el" href="wcsfix_8h.html#a07281faacbec1df800a417bf157751d7" title="Fix malformed cylindrical projections.">cylfix()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">ctrl</td><td>Do potentially unsafe translations of non-standard unit strings as described in the usage notes to <a class="el" href="wcsunits_8h.html#a560462cb2a7fa7eae6b4f325c85e7911">wcsutrn()</a>. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">naxis</td><td>Image axis lengths. If this array pointer is set to zero then <a class="el" href="wcsfix_8h.html#a07281faacbec1df800a417bf157751d7" title="Fix malformed cylindrical projections.">cylfix()</a> will not be invoked.</td></tr>
<tr><td class="paramdir">[in,out]</td><td class="paramname">wcs</td><td>Coordinate transformation parameters.</td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">stat</td><td>Status returns from each of the functions. Use the preprocessor macros NWCSFIX to dimension this vector and CDFIX, DATFIX, <code><b>OBS</b></code>FIX, UNITFIX, SPCFIX, CELFIX, and CYLFIX to access its elements. A status value of -2 is set for functions that were not invoked. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">info</td><td>Status messages from each of the functions. Use the preprocessor macros NWCSFIX to dimension this vector and CDFIX, DATFIX, <code><b>OBS</b></code>FIX, UNITFIX, SPCFIX, CELFIX, and CYLFIX to access its elements. <br />
Note that the memory allocated by <b>wcsfixi</b>() for the message in each wcserr struct (<a class="el" href="structwcserr.html#a6e25d3e120d9ecb0185dd3e86b50bee6">wcserr::msg</a>, if non-zero) must be freed by the user. See <a class="el" href="wcsutil_8h.html#a6b603ff362203ad122fe67a47d10cb9a" title="free memory allocated by WCSLIB functions.">wcsdealloc()</a>.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Status return value:<ul>
<li>0: Success.</li>
<li>1: One or more of the translation functions returned an error. </li>
</ul>
</dd></dl>
</div>
</div>
<a id="a25714f1558ecbee6c1b1fef0abf8ea7f" name="a25714f1558ecbee6c1b1fef0abf8ea7f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a25714f1558ecbee6c1b1fef0abf8ea7f">◆ </a></span>cdfix()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int cdfix </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="structwcsprm.html">wcsprm</a> * </td>
<td class="paramname"><em>wcs</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Fix erroneously omitted <code><b>CD</b>i<b>_</b>ja</code> keywords. </p>
<p><b>cdfix</b>() sets the diagonal element of the <code><b>CD</b>i<b>_</b>ja</code> matrix to unity if all <code><b>CD</b>i<b>_</b>ja</code> keywords associated with a given axis were omitted. According to WCS Paper I, if any <code><b>CD</b>i<b>_</b>ja</code> keywords at all are given in a FITS header then those not given default to zero. This results in a singular matrix with an intersecting row and column of zeros.</p>
<p><b>cdfix</b>() is expected to be invoked before <a class="el" href="wcs_8h.html#ae5cc3f5d249755583403cdf54d2ebb91" title="Setup routine for the wcsprm struct.">wcsset()</a>, which will fail if these errors have not been corrected.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in,out]</td><td class="paramname">wcs</td><td>Coordinate transformation parameters.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Status return value:<ul>
<li>-1: No change required (not an error).</li>
<li>0: Success.</li>
<li>1: Null wcsprm pointer passed. </li>
</ul>
</dd></dl>
</div>
</div>
<a id="a77b614a15de67b42040c2be46cbfca1a" name="a77b614a15de67b42040c2be46cbfca1a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a77b614a15de67b42040c2be46cbfca1a">◆ </a></span>datfix()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int datfix </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="structwcsprm.html">wcsprm</a> * </td>
<td class="paramname"><em>wcs</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Translate <code><b>DATE-OBS</b></code> and derive <code><b>MJD-OBS</b></code> or vice versa. </p>
<p><b>datfix</b>() translates the old <code><b>DATE-OBS</b></code> date format set in <a class="el" href="structwcsprm.html#aad387ccbd7847672b5dc2223d9124120">wcsprm::dateobs</a> to year-2000 standard form (<em>yyyy-mm-dd</em><code><b>T</b></code><em>hh:mm:ss</em>). It derives <a class="el" href="structwcsprm.html#a056ffc4826e7a7ba59909fe5063dfa0b">wcsprm::dateref</a> from <a class="el" href="structwcsprm.html#aa482719872f17f60934b2e7d746174eb">wcsprm::mjdref</a> if not already set. Alternatively, if dateref is set and mjdref isn't, then it derives mjdref from it. If both are set but disagree by more than 0.001 day (86.4 seconds) then an error status is returned. Likewise for <a class="el" href="structwcsprm.html#aad387ccbd7847672b5dc2223d9124120">wcsprm::dateobs</a> and <a class="el" href="structwcsprm.html#ac0cb013b1505fb7abd4167ac0db0e0aa">wcsprm::mjdobs</a>; <a class="el" href="structwcsprm.html#a9f9ec0f8abfa8af01ac97541cade3881">wcsprm::datebeg</a> and <a class="el" href="structwcsprm.html#aa02a4e561a7a106ae8b8adbb17da0393">wcsprm::mjdbeg</a>; <a class="el" href="structwcsprm.html#ae6b40e2adeb31414871c7cae68619d63">wcsprm::dateavg</a> and <a class="el" href="structwcsprm.html#a0730c37f09502eb364f4e7d7addb8ab8">wcsprm::mjdavg</a>; and <a class="el" href="structwcsprm.html#ad1f07e7ae6746a993beed50e58eb6d59">wcsprm::dateend</a> and <a class="el" href="structwcsprm.html#a186ddcff0e5d4ee56ef904a4c125aaaf">wcsprm::mjdend</a>.</p>
<p>If neither dateobs nor mjdobs are set, but <a class="el" href="structwcsprm.html#a92923310bdeb7b8591baad9a389e23bd">wcsprm::jepoch</a> (primarily) or <a class="el" href="structwcsprm.html#aa2fdffbfdcae25f5dc0c93b857a6d911">wcsprm::bepoch</a> is, then both are derived from it. If jepoch and/or bepoch are set but disagree with dateobs or mjdobs by more than 0.000002 year (63.2 seconds), an informative message is produced.</p>
<p>The translations done by <b>datfix</b>() do not affect and are not affected by <a class="el" href="wcs_8h.html#ae5cc3f5d249755583403cdf54d2ebb91" title="Setup routine for the wcsprm struct.">wcsset()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in,out]</td><td class="paramname">wcs</td><td>Coordinate transformation parameters. <a class="el" href="structwcsprm.html#a056ffc4826e7a7ba59909fe5063dfa0b">wcsprm::dateref</a> and/or <a class="el" href="structwcsprm.html#aa482719872f17f60934b2e7d746174eb">wcsprm::mjdref</a> may be changed. <a class="el" href="structwcsprm.html#aad387ccbd7847672b5dc2223d9124120">wcsprm::dateobs</a> and/or <a class="el" href="structwcsprm.html#ac0cb013b1505fb7abd4167ac0db0e0aa">wcsprm::mjdobs</a> may be changed. <a class="el" href="structwcsprm.html#a9f9ec0f8abfa8af01ac97541cade3881">wcsprm::datebeg</a> and/or <a class="el" href="structwcsprm.html#aa02a4e561a7a106ae8b8adbb17da0393">wcsprm::mjdbeg</a> may be changed. <a class="el" href="structwcsprm.html#ae6b40e2adeb31414871c7cae68619d63">wcsprm::dateavg</a> and/or <a class="el" href="structwcsprm.html#a0730c37f09502eb364f4e7d7addb8ab8">wcsprm::mjdavg</a> may be changed. <a class="el" href="structwcsprm.html#ad1f07e7ae6746a993beed50e58eb6d59">wcsprm::dateend</a> and/or <a class="el" href="structwcsprm.html#a186ddcff0e5d4ee56ef904a4c125aaaf">wcsprm::mjdend</a> may be changed.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Status return value:<ul>
<li>-1: No change required (not an error).</li>
<li>0: Success.</li>
<li>1: Null wcsprm pointer passed.</li>
<li>5: Invalid parameter value.</li>
</ul>
For returns >= 0, a detailed message, whether informative or an error message, may be set in <a class="el" href="structwcsprm.html#af54ce939604be183231f0ee006e2f8ed">wcsprm::err</a> if enabled, see <a class="el" href="wcserr_8h.html#a1691b8bd184d40ca6fda255be078fa53" title="Enable/disable error messaging.">wcserr_enable()</a>, with wcsprm::err.status set to FIXERR_DATE_FIX.</dd></dl>
<p><b>Notes:</b> <br />
</p><ol>
<li>
The MJD algorithms used by <b>datfix</b>() are from D.A. Hatcher, 1984, QJRAS, 25, 53-55, as modified by P.T. Wallace for use in SLALIB subroutines <em>CLDJ</em> and <em>DJCL</em>. </li>
</ol>
</div>
</div>
<a id="a52691a17e224d8f4f1d1f897798efa49" name="a52691a17e224d8f4f1d1f897798efa49"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a52691a17e224d8f4f1d1f897798efa49">◆ </a></span>obsfix()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int obsfix </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"><em>ctrl</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">struct <a class="el" href="structwcsprm.html">wcsprm</a> * </td>
<td class="paramname"><em>wcs</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>complete the <code><b>OBS</b></code>GEO-[XYZLBH] vector of observatory coordinates. </p>
<p><b>obsfix</b>() completes the <a class="el" href="structwcsprm.html#a834ff0b9f00cc0bb83a2e2aeca1fe767">wcsprm::obsgeo</a> vector of observatory coordinates. That is, if only the (x,y,z) Cartesian coordinate triplet or the (l,b,h) geodetic coordinate triplet are set, then it derives the other triplet from it. If both triplets are set, then it checks for consistency at the level of 1 metre.</p>
<p>The operations done by <b>obsfix</b>() do not affect and are not affected by <a class="el" href="wcs_8h.html#ae5cc3f5d249755583403cdf54d2ebb91" title="Setup routine for the wcsprm struct.">wcsset()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">ctrl</td><td>Flag that controls behaviour if one triplet is defined and the other is only partially defined:<ul>
<li>0: Reset only the undefined elements of an incomplete coordinate triplet.</li>
<li>1: Reset all elements of an incomplete triplet.</li>
<li>2: Don't make any changes, check for consistency only. Returns an error if either of the two triplets is incomplete.</li>
</ul>
</td></tr>
<tr><td class="paramdir">[in,out]</td><td class="paramname">wcs</td><td>Coordinate transformation parameters. <a class="el" href="structwcsprm.html#a834ff0b9f00cc0bb83a2e2aeca1fe767">wcsprm::obsgeo</a> may be changed.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Status return value:<ul>
<li>-1: No change required (not an error).</li>
<li>0: Success.</li>
<li>1: Null wcsprm pointer passed.</li>
<li>5: Invalid parameter value.</li>
</ul>
For returns >= 0, a detailed message, whether informative or an error message, may be set in <a class="el" href="structwcsprm.html#af54ce939604be183231f0ee006e2f8ed">wcsprm::err</a> if enabled, see <a class="el" href="wcserr_8h.html#a1691b8bd184d40ca6fda255be078fa53" title="Enable/disable error messaging.">wcserr_enable()</a>, with wcsprm::err.status set to FIXERR_<code><b>OBS</b></code>_FIX.</dd></dl>
<p><b>Notes:</b> <br />
</p><ol>
<li>
<p class="startli">While the International Terrestrial Reference System (ITRS) is based solely on Cartesian coordinates, it recommends the use of the GRS80 ellipsoid in converting to geodetic coordinates. However, while WCS Paper III recommends ITRS Cartesian coordinates, Paper VII prescribes the use of the IAU(1976) ellipsoid for geodetic coordinates, and consequently that is what is used here.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">For reference, parameters of commonly used global reference ellipsoids: </p><div class="fragment"><div class="line"> a (m) 1/f Standard</div>
<div class="line">--------- ------------- --------------------------------</div>
<div class="line">6378140 298.2577 IAU(1976)</div>
<div class="line">6378137 298.257222101 GRS80</div>
<div class="line">6378137 298.257223563 WGS84</div>
<div class="line">6378136 298.257 IERS(1989)</div>
<div class="line">6378136.6 298.25642 IERS(2003,2010), IAU(2009/2012)</div>
</div><!-- fragment --><p class="interli">where f = (a - b) / a is the flattening, and a and b are the semi-major and semi-minor radii in metres.</p>
<p class="endli"></p>
</li>
<li>
<p class="startli">The transformation from geodetic (lng,lat,hgt) to Cartesian (x,y,z) is </p><div class="fragment"><div class="line">x = (n + hgt)*coslng*coslat,</div>
<div class="line">y = (n + hgt)*sinlng*coslat,</div>
<div class="line">z = (n*(1.0 - e^2) + hgt)*sinlat,</div>
</div><!-- fragment --><p class="interli">where the "prime vertical radius", n, is a function of latitude </p><div class="fragment"><div class="line">n = a / sqrt(1 - (e*sinlat)^2),</div>
</div><!-- fragment --><p class="interli">and a, the equatorial radius, and e^2 = (2 - f)*f, the (first) eccentricity of the ellipsoid, are constants. <b>obsfix</b>() inverts these iteratively by writing </p><div class="fragment"><div class="line"> x = rho*coslng*coslat,</div>
<div class="line"> y = rho*sinlng*coslat,</div>
<div class="line">zeta = rho*sinlat,</div>
</div><!-- fragment --><p class="interli">where </p><div class="fragment"><div class="line"> rho = n + hgt,</div>
<div class="line"> = sqrt(x^2 + y^2 + zeta^2),</div>
<div class="line">zeta = z / (1 - n*e^2/rho),</div>
</div><!-- fragment --><p class="endli">and iterating over the value of zeta. Since e is small, a good first approximation is given by zeta = z. </p>
</li>
</ol>
</div>
</div>
<a id="a883167275c4d3855ba453364db3d8d66" name="a883167275c4d3855ba453364db3d8d66"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a883167275c4d3855ba453364db3d8d66">◆ </a></span>unitfix()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int unitfix </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"><em>ctrl</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">struct <a class="el" href="structwcsprm.html">wcsprm</a> * </td>
<td class="paramname"><em>wcs</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Correct aberrant <code><b>CUNIT</b>ia</code> keyvalues. </p>
<p><b>unitfix</b>() applies <a class="el" href="wcsunits_8h.html#a560462cb2a7fa7eae6b4f325c85e7911">wcsutrn()</a> to translate non-standard <code><b>CUNIT</b>ia</code> keyvalues, e.g. '<code><b>DEG</b></code>' -> '<code><b>deg</b></code>', also stripping off unnecessary whitespace.</p>
<p><b>unitfix</b>() is expected to be invoked before <a class="el" href="wcs_8h.html#ae5cc3f5d249755583403cdf54d2ebb91" title="Setup routine for the wcsprm struct.">wcsset()</a>, which will fail if non-standard <code><b>CUNIT</b>ia</code> keyvalues have not been translated.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">ctrl</td><td>Do potentially unsafe translations described in the usage notes to <a class="el" href="wcsunits_8h.html#a560462cb2a7fa7eae6b4f325c85e7911">wcsutrn()</a>.</td></tr>
<tr><td class="paramdir">[in,out]</td><td class="paramname">wcs</td><td>Coordinate transformation parameters.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Status return value:<ul>
<li>-1: No change required (not an error).</li>
<li>0: Success (an alias was applied).</li>
<li>1: Null wcsprm pointer passed.</li>
</ul>
When units are translated (i.e. 0 is returned), an informative message is set in <a class="el" href="structwcsprm.html#af54ce939604be183231f0ee006e2f8ed">wcsprm::err</a> if enabled, see <a class="el" href="wcserr_8h.html#a1691b8bd184d40ca6fda255be078fa53" title="Enable/disable error messaging.">wcserr_enable()</a>, with wcsprm::err.status set to FIXERR_UNITS_ALIAS. </dd></dl>
</div>
</div>
<a id="af011e4065b6179e19d2964bc9646b6af" name="af011e4065b6179e19d2964bc9646b6af"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af011e4065b6179e19d2964bc9646b6af">◆ </a></span>spcfix()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int spcfix </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="structwcsprm.html">wcsprm</a> * </td>
<td class="paramname"><em>wcs</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Translate AIPS-convention spectral types. </p>
<p><b>spcfix</b>() translates AIPS-convention spectral coordinate types, '{<code><b>FREQ</b></code>,<code><b>FELO</b></code>,<code><b>VELO</b></code>}-{<code><b>LSR</b></code>,<code><b>HEL</b></code>,<code><b>OBS</b></code>}' (e.g. 'FREQ-OBS', <code><b>'FELO-HEL'</b></code>, 'VELO-LSR') set in <a class="el" href="structwcsprm.html#ae1f462606974e1324cd38f143eda691e">wcsprm::ctype</a>[], subject to <code><b>VELREF</b></code> set in <a class="el" href="structwcsprm.html#ac3c9c869bef4e4850dfd9762b33ce908">wcsprm::velref</a>.</p>
<p>Note that if wcs::specsys is already set then it will not be overridden.</p>
<p>AIPS-convention spectral types set in <code><b>CTYPE</b>ia</code> are translated on-the-fly by <a class="el" href="wcs_8h.html#ae5cc3f5d249755583403cdf54d2ebb91" title="Setup routine for the wcsprm struct.">wcsset()</a> but without modifying <a class="el" href="structwcsprm.html#ae1f462606974e1324cd38f143eda691e">wcsprm::ctype</a>[] or <a class="el" href="structwcsprm.html#ac089e5d0e3191255ceaea7f8591b27ea">wcsprm::specsys</a>. That is, only the information extracted from <a class="el" href="structwcsprm.html#ae1f462606974e1324cd38f143eda691e">wcsprm::ctype</a>[] is translated when <a class="el" href="wcs_8h.html#ae5cc3f5d249755583403cdf54d2ebb91" title="Setup routine for the wcsprm struct.">wcsset()</a> fills in <a class="el" href="structwcsprm.html#ae83952aec7c1ac76c090bc89bf4eeea7">wcsprm::spc</a> (spcprm struct). <b>spcfix</b>() modifies <a class="el" href="structwcsprm.html#ae1f462606974e1324cd38f143eda691e">wcsprm::ctype</a>[] so that if the header is subsequently written out, e.g. by <a class="el" href="wcshdr_8h.html#ace387e4a5f6c519ad2a0e1fdebe62381" title="Write out a wcsprm struct as a FITS header.">wcshdo()</a>, then it will contain translated <code><b>CTYPE</b>ia</code> keyvalues.</p>
<p>The operations done by <b>spcfix</b>() do not affect and are not affected by <a class="el" href="wcs_8h.html#ae5cc3f5d249755583403cdf54d2ebb91" title="Setup routine for the wcsprm struct.">wcsset()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in,out]</td><td class="paramname">wcs</td><td>Coordinate transformation parameters. <a class="el" href="structwcsprm.html#ae1f462606974e1324cd38f143eda691e">wcsprm::ctype</a>[] and/or <a class="el" href="structwcsprm.html#ac089e5d0e3191255ceaea7f8591b27ea">wcsprm::specsys</a> may be changed.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Status return value:<ul>
<li>-1: No change required (not an error).</li>
<li>0: Success.</li>
<li>1: Null wcsprm pointer passed.</li>
<li>2: Memory allocation failed.</li>
<li>3: Linear transformation matrix is singular.</li>
<li>4: Inconsistent or unrecognized coordinate axis types.</li>
<li>5: Invalid parameter value.</li>
<li>6: Invalid coordinate transformation parameters.</li>
<li>7: Ill-conditioned coordinate transformation parameters.</li>
</ul>
For returns >= 0, a detailed message, whether informative or an error message, may be set in <a class="el" href="structwcsprm.html#af54ce939604be183231f0ee006e2f8ed">wcsprm::err</a> if enabled, see <a class="el" href="wcserr_8h.html#a1691b8bd184d40ca6fda255be078fa53" title="Enable/disable error messaging.">wcserr_enable()</a>, with wcsprm::err.status set to FIXERR_SPC_UPDTE. </dd></dl>
</div>
</div>
<a id="ac1df72303f64e50d5e3cb320c126443b" name="ac1df72303f64e50d5e3cb320c126443b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac1df72303f64e50d5e3cb320c126443b">◆ </a></span>celfix()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int celfix </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="structwcsprm.html">wcsprm</a> * </td>
<td class="paramname"><em>wcs</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Translate AIPS-convention celestial projection types. </p>
<p><b>celfix</b>() translates AIPS-convention celestial projection types, <code><b>NCP</b></code> and <code><b>GLS</b></code>, set in the ctype[] member of the wcsprm struct.</p>
<p>Two additional pv[] keyvalues are created when translating <code><b>NCP</b></code>, and three are created when translating <code><b>GLS</b></code> with non-zero reference point. If the pv[] array was initially allocated by <a class="el" href="wcs_8h.html#a2afc8255fde0965dddaa374463666d45" title="Default constructor for the wcsprm struct.">wcsini()</a> then the array will be expanded if necessary. Otherwise, error 2 will be returned if sufficient empty slots are not already available for use.</p>
<p>AIPS-convention celestial projection types set in <code><b>CTYPE</b>ia</code> are translated on-the-fly by <a class="el" href="wcs_8h.html#ae5cc3f5d249755583403cdf54d2ebb91" title="Setup routine for the wcsprm struct.">wcsset()</a> but without modifying <a class="el" href="structwcsprm.html#ae1f462606974e1324cd38f143eda691e">wcsprm::ctype</a>[], <a class="el" href="structwcsprm.html#a04fbd6ed1b338e225f2291523e64be2c">wcsprm::pv</a>[], or <a class="el" href="structwcsprm.html#a0e31f1eef036258c2957da9b985945dd">wcsprm::npv</a>. That is, only the information extracted from <a class="el" href="structwcsprm.html#ae1f462606974e1324cd38f143eda691e">wcsprm::ctype</a>[] is translated when <a class="el" href="wcs_8h.html#ae5cc3f5d249755583403cdf54d2ebb91" title="Setup routine for the wcsprm struct.">wcsset()</a> fills in <a class="el" href="structwcsprm.html#ac8391dd770637dbb841067996b7777ba">wcsprm::cel</a> (celprm struct). <b>celfix</b>() modifies <a class="el" href="structwcsprm.html#ae1f462606974e1324cd38f143eda691e">wcsprm::ctype</a>[], <a class="el" href="structwcsprm.html#a04fbd6ed1b338e225f2291523e64be2c">wcsprm::pv</a>[], and <a class="el" href="structwcsprm.html#a0e31f1eef036258c2957da9b985945dd">wcsprm::npv</a> so that if the header is subsequently written out, e.g. by <a class="el" href="wcshdr_8h.html#ace387e4a5f6c519ad2a0e1fdebe62381" title="Write out a wcsprm struct as a FITS header.">wcshdo()</a>, then it will contain translated <code><b>CTYPE</b>ia</code> keyvalues and the relevant <code><b>PV</b>i<b>_</b>ma</code>.</p>
<p>The operations done by <b>celfix</b>() do not affect and are not affected by <a class="el" href="wcs_8h.html#ae5cc3f5d249755583403cdf54d2ebb91" title="Setup routine for the wcsprm struct.">wcsset()</a>. However, it uses information in the wcsprm struct provided by <a class="el" href="wcs_8h.html#ae5cc3f5d249755583403cdf54d2ebb91" title="Setup routine for the wcsprm struct.">wcsset()</a>, and will invoke it if necessary.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in,out]</td><td class="paramname">wcs</td><td>Coordinate transformation parameters. <a class="el" href="structwcsprm.html#ae1f462606974e1324cd38f143eda691e">wcsprm::ctype</a>[] and/or <a class="el" href="structwcsprm.html#a04fbd6ed1b338e225f2291523e64be2c">wcsprm::pv</a>[] may be changed.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Status return value:<ul>
<li>-1: No change required (not an error).</li>
<li>0: Success.</li>
<li>1: Null wcsprm pointer passed.</li>
<li>2: Memory allocation failed.</li>
<li>3: Linear transformation matrix is singular.</li>
<li>4: Inconsistent or unrecognized coordinate axis types.</li>
<li>5: Invalid parameter value.</li>
<li>6: Invalid coordinate transformation parameters.</li>
<li>7: Ill-conditioned coordinate transformation parameters.</li>
</ul>
For returns > 1, a detailed error message is set in <a class="el" href="structwcsprm.html#af54ce939604be183231f0ee006e2f8ed">wcsprm::err</a> if enabled, see <a class="el" href="wcserr_8h.html#a1691b8bd184d40ca6fda255be078fa53" title="Enable/disable error messaging.">wcserr_enable()</a>. </dd></dl>
</div>
</div>
<a id="a07281faacbec1df800a417bf157751d7" name="a07281faacbec1df800a417bf157751d7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a07281faacbec1df800a417bf157751d7">◆ </a></span>cylfix()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int cylfix </td>
<td>(</td>
<td class="paramtype">const int </td>
<td class="paramname"><em>naxis</em>[], </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">struct <a class="el" href="structwcsprm.html">wcsprm</a> * </td>
<td class="paramname"><em>wcs</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Fix malformed cylindrical projections. </p>
<p><b>cylfix</b>() fixes WCS keyvalues for malformed cylindrical projections that suffer from the problem described in Sect. 7.3.4 of Paper I.</p>
<p><b>cylfix</b>() requires the wcsprm struct to have been set up by <a class="el" href="wcs_8h.html#ae5cc3f5d249755583403cdf54d2ebb91" title="Setup routine for the wcsprm struct.">wcsset()</a>, and will invoke it if necessary. After modification, the struct is reset on return with an explicit call to <a class="el" href="wcs_8h.html#ae5cc3f5d249755583403cdf54d2ebb91" title="Setup routine for the wcsprm struct.">wcsset()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">naxis</td><td>Image axis lengths.</td></tr>
<tr><td class="paramdir">[in,out]</td><td class="paramname">wcs</td><td>Coordinate transformation parameters.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Status return value:<ul>
<li>-1: No change required (not an error).</li>
<li>0: Success.</li>
<li>1: Null wcsprm pointer passed.</li>
<li>2: Memory allocation failed.</li>
<li>3: Linear transformation matrix is singular.</li>
<li>4: Inconsistent or unrecognized coordinate axis types.</li>
<li>5: Invalid parameter value.</li>
<li>6: Invalid coordinate transformation parameters.</li>
<li>7: Ill-conditioned coordinate transformation parameters.</li>
<li>8: All of the corner pixel coordinates are invalid.</li>
<li>9: Could not determine reference pixel coordinate.</li>
<li>10: Could not determine reference pixel value.</li>
</ul>
For returns > 1, a detailed error message is set in <a class="el" href="structwcsprm.html#af54ce939604be183231f0ee006e2f8ed">wcsprm::err</a> if enabled, see <a class="el" href="wcserr_8h.html#a1691b8bd184d40ca6fda255be078fa53" title="Enable/disable error messaging.">wcserr_enable()</a>. </dd></dl>
</div>
</div>
<a id="a7b70e8127424672db38ce3e653e46467" name="a7b70e8127424672db38ce3e653e46467"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7b70e8127424672db38ce3e653e46467">◆ </a></span>wcspcx()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int wcspcx </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="structwcsprm.html">wcsprm</a> * </td>
<td class="paramname"><em>wcs</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>dopc</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>permute</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double </td>
<td class="paramname"><em>rotn</em>[2] </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>regularize PCi_j. </p>
<p><b>wcspcx</b>() "regularizes" the linear transformation matrix component of the coordinate transformation (<code><b>PC</b>i<b>_</b>ja</code>) to make it more human-readable.</p>
<p>Normally, upon encountering a FITS header containing a <code><b>CD</b>i<b>_</b>ja</code> matrix, <a class="el" href="wcs_8h.html#ae5cc3f5d249755583403cdf54d2ebb91" title="Setup routine for the wcsprm struct.">wcsset()</a> simply treats it as <code><b>PC</b>i<b>_</b>ja</code> and sets <code><b>CDELT</b>ia</code> to unity. However, <b>wcspcx</b>() decomposes <code><b>CD</b>i<b>_</b>ja</code> into <code><b>PC</b>i<b>_</b>ja</code> and <code><b>CDELT</b>ia</code> in such a way that <code><b>CDELT</b>ia</code> form meaningful scaling parameters. In practice, the residual <code><b>PC</b>i<b>_</b>ja</code> matrix will often then be orthogonal, i.e. unity, or describing a pure rotation, axis permutation, or reflection, or a combination thereof.</p>
<p>The decomposition is based on normalizing the length in the transformed system (i.e. intermediate pixel coordinates) of the orthonormal basis vectors of the pixel coordinate system. This deviates slightly from the prescription given by Eq. (4) of WCS Paper I, namely Sum(j=1,N)(<code><b>PC</b>i<b>_</b>ja</code>)² = 1, in replacing the sum over j with the sum over i. Consequently, the columns of <code><b>PC</b>i<b>_</b>ja</code> will consist of unit vectors. In practice, especially in cubes and higher dimensional images, at least some pairs of these unit vectors, if not all, will often be orthogonal or close to orthogonal.</p>
<p>The sign of <code><b>CDELT</b>ia</code> is chosen to make the <code><b>PC</b>i<b>_</b>ja</code> matrix as close to the, possibly permuted, unit matrix as possible, except that where the coordinate description contains a pair of celestial axes, the sign of <code><b>CDELT</b>ia</code> is set negative for the longitude axis and positive for the latitude axis.</p>
<p>Optionally, rows of the <code><b>PC</b>i<b>_</b>ja</code> matrix may also be permuted to diagonalize it as far as possible, thus undoing any transposition of axes in the intermediate pixel coordinate system.</p>
<p>If the coordinate description contains a celestial plane, then the angle of rotation of each of the basis vectors associated with the celestial axes is returned. For a pure rotation the two angles should be identical. Any difference between them is a measure of axis skewness.</p>
<p>The decomposition is not performed for axes involving a sequent distortion function that is defined in terms of <code><b>CD</b>i<b>_</b>ja</code>, such as TPV, TNX, or ZPX, which always are. The independent variables of the polynomial are therefore intermediate world coordinates rather than intermediate pixel coordinates. Because sequent distortions are always applied before <code><b>CDELT</b>ia</code>, if <code><b>CD</b>i<b>_</b>ja</code> was translated to <code><b>PC</b>i<b>_</b>ja</code> plus <code><b>CDELT</b>ia</code>, then the distortion would be altered unless the polynomial coefficients were also adjusted to account for the change of scale.</p>
<p><b>wcspcx</b>() requires the wcsprm struct to have been set up by <a class="el" href="wcs_8h.html#ae5cc3f5d249755583403cdf54d2ebb91" title="Setup routine for the wcsprm struct.">wcsset()</a>, and will invoke it if necessary. The wcsprm struct is reset on return with an explicit call to <a class="el" href="wcs_8h.html#ae5cc3f5d249755583403cdf54d2ebb91" title="Setup routine for the wcsprm struct.">wcsset()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in,out]</td><td class="paramname">wcs</td><td>Coordinate transformation parameters.</td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">dopc</td><td>If 1, then <code><b>PC</b>i<b>_</b>ja</code> and <code><b>CDELT</b>ia</code>, as given, will be recomposed according to the above prescription. If 0, the operation is restricted to decomposing <code><b>CD</b>i<b>_</b>ja</code>. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">permute</td><td>If 1, then after decomposition (or recomposition), permute rows of <code><b>PC</b>i<b>_</b>ja</code> to make the axes of the intermediate pixel coordinate system match as closely as possible those of the pixel coordinates. That is, make it as close to a diagonal matrix as possible. However, celestial axes are special in always being paired, with the longitude axis preceding the latitude axis. <br />
All WCS entities indexed by i, such as <code><b>CTYPE</b>ia</code>, <code><b>CRVAL</b>ia</code>, <code><b>CDELT</b>ia</code>, etc., including coordinate lookup tables, will also be permuted as necessary to account for the change to <code><b>PC</b>i<b>_</b>ja</code>. This does not apply to <code><b>CRPIX</b>ja</code>, nor prior distortion functions. These operate on pixel coordinates, which are not affected by the permutation.</td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">rotn</td><td>with the celestial axes. For a pure rotation the two angles should be identical. Any difference between them is a measure of axis skewness. <br />
May be set to the NULL pointer if this information is not required.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Status return value:<ul>
<li>0: Success.</li>
<li>1: Null wcsprm pointer passed.</li>
<li>2: Memory allocation failed.</li>
<li>5: CDi_j matrix not used.</li>
<li>6: Sequent distortion function present. </li>
</ul>
</dd></dl>
</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a id="a256ce6281894f65dd15396cc0994e875" name="a256ce6281894f65dd15396cc0994e875"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a256ce6281894f65dd15396cc0994e875">◆ </a></span>wcsfix_errmsg</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">const char * wcsfix_errmsg[]</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">extern</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Status return messages. </p>
<p>Error messages to match the status value returned from each function. </p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Nov 29 2023 19:09:57 for WCSLIB by <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>