aboutsummaryrefslogtreecommitdiff
path: root/noao/digiphot/apphot/fitpsf/appfconfirm.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/fitpsf/appfconfirm.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'noao/digiphot/apphot/fitpsf/appfconfirm.x')
-rw-r--r--noao/digiphot/apphot/fitpsf/appfconfirm.x58
1 files changed, 58 insertions, 0 deletions
diff --git a/noao/digiphot/apphot/fitpsf/appfconfirm.x b/noao/digiphot/apphot/fitpsf/appfconfirm.x
new file mode 100644
index 00000000..30e111b2
--- /dev/null
+++ b/noao/digiphot/apphot/fitpsf/appfconfirm.x
@@ -0,0 +1,58 @@
+include "../lib/apphot.h"
+include "../lib/noise.h"
+include "../lib/fitpsf.h"
+
+# AP_PFCONFIRM -- Procedure to confirm the critical fitpsf parameters.
+
+procedure ap_pfconfirm (ap, out, stid)
+
+pointer ap # pointer to the apphot structure
+int out # the output file descriptor
+int stid # the output file sequence number
+
+pointer sp, str
+real fwhmpsf, psfapert, datamin, datamax
+int apstati()
+real apstatr(), ap_vfwhmpsf(), ap_vpsfapert()
+real ap_vdatamin(), ap_vdatamax()
+
+begin
+ call smark (sp)
+ call salloc (str, SZ_FNAME, TY_CHAR)
+
+ call printf ("\n")
+
+ # Confirm the fitting function.
+ call ap_vpfstring (ap, Memc[str], SZ_FNAME)
+
+ # Confirm the fwhmpsf.
+ if (apstati (ap, PSFUNCTION) != AP_MOMENTS)
+ fwhmpsf = ap_vfwhmpsf (ap)
+ else
+ fwhmpsf = apstatr (ap, FWHMPSF)
+
+ # Confirm the fitting box.
+ psfapert = 2.0 * ap_vpsfapert (ap)
+
+ # Confirm the good data minimum and maximum values.
+ datamin = ap_vdatamin (ap)
+ datamax = ap_vdatamax (ap)
+
+ call printf ("\n")
+
+ # Update the database file.
+ if (out != NULL && stid > 1) {
+ call ap_sparam (out, KY_PSFSTRING, Memc[str], UN_PSFMODEL,
+ "psf fitting function")
+ call ap_rparam (out, KY_FWHMPSF, fwhmpsf, UN_ASCALEUNIT,
+ "full width half maximum of the psf")
+ call ap_rparam (out, KY_PSFAPERT, psfapert, UN_PSFSCALEUNIT,
+ "width of fitting box")
+ call ap_rparam (out, KY_DATAMIN, datamin, UN_ACOUNTS,
+ "minimum good data value")
+ call ap_rparam (out, KY_DATAMAX, datamax, UN_ACOUNTS,
+ "maximum good data value")
+ }
+
+ call sfree (sp)
+end