aboutsummaryrefslogtreecommitdiff
path: root/noao/digiphot/apphot/radprof/aprpindef.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/radprof/aprpindef.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'noao/digiphot/apphot/radprof/aprpindef.x')
-rw-r--r--noao/digiphot/apphot/radprof/aprpindef.x69
1 files changed, 69 insertions, 0 deletions
diff --git a/noao/digiphot/apphot/radprof/aprpindef.x b/noao/digiphot/apphot/radprof/aprpindef.x
new file mode 100644
index 00000000..4d92d615
--- /dev/null
+++ b/noao/digiphot/apphot/radprof/aprpindef.x
@@ -0,0 +1,69 @@
+include "../lib/apphotdef.h"
+include "../lib/radprofdef.h"
+include "../lib/photdef.h"
+include "../lib/phot.h"
+include "../lib/radprof.h"
+
+# AP_RPINDEF -- Routine to return INDEF valued photometry and radial profile
+# buffers.
+
+procedure ap_rpindef (ap)
+
+pointer ap # pointer to the apphot structure
+
+pointer phot, rprof
+
+begin
+ phot = AP_PPHOT(ap)
+ rprof = AP_RPROF(ap)
+
+ AP_RPFWHM(rprof) = INDEFR
+ AP_INORM(rprof) = INDEFR
+ AP_TINORM(rprof) = INDEFR
+
+ call amovkr (INDEFR, Memr[AP_INTENSITY(rprof)], AP_RPNPTS(rprof))
+ call amovkr (INDEFR, Memr[AP_TINTENSITY(rprof)], AP_RPNPTS(rprof))
+ call amovkd (0.0d0, Memd[AP_AREA(phot)], AP_NAPERTS(phot))
+ call amovkd (0.0d0, Memd[AP_SUMS(phot)], AP_NAPERTS(phot))
+ call amovkr (INDEFR, Memr[AP_MAGS(phot)], AP_NAPERTS(phot))
+ call amovkr (INDEFR, Memr[AP_MAGERRS(phot)], AP_NAPERTS(phot))
+end
+
+
+# AP_MAXAP -- Procedure to setup the maximum number of apertures for phot.
+
+procedure ap_maxap (ap, pier)
+
+pointer ap # pointer to the apphot structure
+int pier # photometric error
+
+int i
+pointer phot, rprof
+real dxc1, dxc2, dyc1, dyc2, rdist, rapert
+
+begin
+ phot = AP_PPHOT(ap)
+ rprof = AP_RPROF(ap)
+
+ dxc1 = AP_RPXC(rprof) - 0.5
+ dxc2 = AP_RPNX(rprof) - AP_RPXC(rprof) + 0.5
+ dyc1 = AP_RPYC(rprof) - 0.5
+ dyc2 = AP_RPNY(rprof) - AP_RPYC(rprof) + 0.5
+
+ # Compute the maximum aperture.
+ AP_NMAXAP(phot) = 0
+ rdist = min (abs (dxc1), abs (dxc2), abs (dyc1), abs (dyc2))
+ do i = 1, AP_NAPERTS(phot) {
+ rapert = AP_SCALE(ap) * Memr[AP_APERTS(phot)+i-1]
+ if (rapert <= rdist) {
+ AP_NMAXAP(phot) = i
+ } else {
+ break
+ }
+ }
+
+ if (AP_NMAXAP(phot) < AP_NAPERTS(phot))
+ pier = AP_APERT_OUTOFBOUNDS
+ else
+ pier = AP_OK
+end