diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /sys/qpoe/qploadwcs.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/qpoe/qploadwcs.x')
-rw-r--r-- | sys/qpoe/qploadwcs.x | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/sys/qpoe/qploadwcs.x b/sys/qpoe/qploadwcs.x new file mode 100644 index 00000000..b4609ce7 --- /dev/null +++ b/sys/qpoe/qploadwcs.x @@ -0,0 +1,38 @@ +include <syserr.h> +include "qpoe.h" + +# QP_LOADWCS -- Load the default WCS, if there is one, from the QPOE image +# header. A QPOE file can contain any number of WCS, but the default WCS +# should relate the physical coordinate system, e.g., sky coordinates in +# the range 1024sq, 8192sq, etc., to world coordinates, e.g., the TAN +# projection. Probably we should provide for multiple physical coordinate +# systems (sky, detector, etc.) each with its own WCS, but at present we +# assume a single WCS. + +pointer procedure qp_loadwcs (qp) + +pointer qp #I QPOE descriptor + +int wcslen +pointer sp, svwcs, mw +errchk qp_lenf, syserrs, qp_read, mw_open +int qp_lenf(), qp_read() +pointer mw_open() +string s_qpwcs QPWCS + +begin + # Determine if there is a WCS, and if so, how big the saved version is. + wcslen = qp_lenf (qp, s_qpwcs) + if (wcslen <= 0) + call syserrs (SYS_QPNOWCS, QP_DFNAME(qp)) + + call smark (sp) + call salloc (svwcs, wcslen, TY_CHAR) + + # Retrieved the saved wcs, and load it into an MWCS descriptor. + wcslen = qp_read (qp, s_qpwcs, Memc[svwcs], wcslen, 1, "opaque") + mw = mw_open (svwcs, 0) + + call sfree (sp) + return (mw) +end |