diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /noao/digiphot/daophot/psf/dpradpsf.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'noao/digiphot/daophot/psf/dpradpsf.x')
-rw-r--r-- | noao/digiphot/daophot/psf/dpradpsf.x | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/noao/digiphot/daophot/psf/dpradpsf.x b/noao/digiphot/daophot/psf/dpradpsf.x new file mode 100644 index 00000000..7e649e7e --- /dev/null +++ b/noao/digiphot/daophot/psf/dpradpsf.x @@ -0,0 +1,75 @@ +include <gset.h> +include "../lib/daophotdef.h" +include "../lib/psfdef.h" + +define FRACTION 0.10 + +# DP_RADPSF -- Draw a radial profile plot of a data subraster containing a +# candidate psf star. + +procedure dp_radpsf (dao, subras, ncols, nlines, x1, y1, title, gp) + +pointer dao # pointer to DAOPHOT structure +real subras[ncols,nlines] # data subraster +int ncols, nlines # dimesnions of subraster +int x1, y1 # coordinates of left hand corner +char title[ARB] # title string +pointer gp # pointer to graphics descriptor + +int npts +pointer psf, sp, radius, intensity, str +real ymin, ymax, r1, r2, i1, i2 +int dp_rivectors() + +begin + # Get the pointer to the DAOPHOT PSF fitting substructure. + psf = DP_PSF (dao) + + # Allocate temporary space. + call smark (sp) + call salloc (radius, ncols * nlines, TY_REAL) + call salloc (intensity, ncols * nlines, TY_REAL) + call salloc (str, SZ_LINE, TY_CHAR) + + # Compute the radial profile. + npts = dp_rivectors (subras, ncols, nlines, x1, y1, DP_CUR_PSFX(psf), + DP_CUR_PSFY(psf), DP_PSFRAD(dao), Memr[radius], Memr[intensity]) + call alimr (Memr[intensity], npts, ymin, ymax) + + # Make the plot. + call gclear (gp) + r1 = -FRACTION * DP_PSFRAD(dao) + r2 = DP_PSFRAD(dao) + FRACTION * DP_PSFRAD(dao) + i1 = ymin - FRACTION * (ymax - ymin) + i2 = ymax + FRACTION * (ymax - ymin) + call gswind (gp, r1, r2, i1, i2) + call glabax (gp, title, "Radius (pixels)", "Intensity (counts)") + call gpmark (gp, Memr[radius], Memr[intensity], npts, GM_PLUS, 1.0, + 1.0) + + # Mark the zero radius line. + call gamove (gp, 0.0, i1) + call gadraw (gp, 0.0, i2) + + # Mark the sky level. + call gamove (gp, r1, DP_CUR_PSFSKY(psf)) + call gadraw (gp, r2, DP_CUR_PSFSKY(psf)) + + # Mark the half-width at half-maximum. + call gamove (gp, DP_FWHMPSF(dao) / 2.0, i1) + call gadraw (gp, DP_FWHMPSF(dao) / 2.0, i2) + call sprintf (Memc[str], SZ_LINE, "Half-width half-maximum = %0.2f") + call pargr (DP_FWHMPSF(dao) / 2.0) + call gtext (gp, DP_FWHMPSF(dao) / 2.0, i2, Memc[str], + "q=h;u=180;v=t;p=r") + + # Mark the fitting radius. + call gamove (gp, DP_FITRAD(dao), i1) + call gadraw (gp, DP_FITRAD(dao), i2) + call sprintf (Memc[str], SZ_LINE, "Fitting radius = %0.2f") + call pargr (DP_FITRAD(dao)) + call gtext (gp, DP_FITRAD(dao), i2, Memc[str], "q=h;u=180;v=t;p=r") + + call gflush (gp) + call sfree (sp) +end |