aboutsummaryrefslogtreecommitdiff
path: root/noao/digiphot/apphot/polyphot/apycenter.x
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /noao/digiphot/apphot/polyphot/apycenter.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'noao/digiphot/apphot/polyphot/apycenter.x')
-rw-r--r--noao/digiphot/apphot/polyphot/apycenter.x59
1 files changed, 59 insertions, 0 deletions
diff --git a/noao/digiphot/apphot/polyphot/apycenter.x b/noao/digiphot/apphot/polyphot/apycenter.x
new file mode 100644
index 00000000..faa2d884
--- /dev/null
+++ b/noao/digiphot/apphot/polyphot/apycenter.x
@@ -0,0 +1,59 @@
+include "../lib/center.h"
+include "../lib/polyphot.h"
+
+# AP_YCENTER -- Center the polygon using the centering package routines.
+
+int procedure ap_ycenter (py, im, wx, wy, x, y, nver)
+
+pointer py # pointer to polyphot structure
+pointer im # pointer to the IRAF image
+real wx # initial x center
+real wy # initial y center
+real x[ARB] # x coordinates of the polygon
+real y[ARB] # y coordinates of the polygon
+int nver # number of vertices
+
+int cier
+int apfitcenter()
+real apstatr()
+
+begin
+ if (IS_INDEFR(apstatr (py, PYCX)) || IS_INDEFR(apstatr (py, PYCY)))
+ cier = apfitcenter (py, im, INDEFR, INDEFR)
+ else
+ cier = apfitcenter (py, im, wx, wy)
+
+ if (! IS_INDEFR (apstatr (py, XCENTER)) && ! IS_INDEFR (apstatr (py,
+ YCENTER)) && ! IS_INDEFR (apstatr (py, PYCX)) &&
+ ! IS_INDEFR (apstatr (py, PYCY)))
+ call ap_yshift (py, im, x, y, nver, apstatr (py, XCENTER),
+ apstatr (py, YCENTER))
+
+ return (cier)
+end
+
+
+# AP_YRECENTER -- Recenter the polygon using the existing buffer of pixels
+# and the centering package routines.
+
+int procedure ap_yrecenter (py, im, x, y, nver, cier)
+
+pointer py # pointer to polyphot structure
+pointer im # the input image descriptor
+real x[ARB] # x coordinates of the polygon
+real y[ARB] # y coordinates of the polygon
+int nver # number of vertices
+int cier # original centering error
+
+int aprefitcenter()
+real apstatr()
+
+begin
+ cier = aprefitcenter (py, im, cier)
+ if (! IS_INDEFR (apstatr (py, XCENTER)) && ! IS_INDEFR (apstatr (py,
+ YCENTER)) && ! IS_INDEFR (apstatr (py, PYCX)) && !
+ IS_INDEFR (apstatr (py, PYCY)))
+ call ap_yshift (py, im, x, y, nver, apstatr (py, XCENTER),
+ apstatr (py, YCENTER))
+ return (cier)
+end