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 /noao/digiphot/apphot/aputil/apbsmooth.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'noao/digiphot/apphot/aputil/apbsmooth.x')
-rw-r--r-- | noao/digiphot/apphot/aputil/apbsmooth.x | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/noao/digiphot/apphot/aputil/apbsmooth.x b/noao/digiphot/apphot/aputil/apbsmooth.x new file mode 100644 index 00000000..28c53c00 --- /dev/null +++ b/noao/digiphot/apphot/aputil/apbsmooth.x @@ -0,0 +1,33 @@ +# AP_BSMOOTH - Box car smooth a histogram 1, 2 or 3 times. + +procedure ap_bsmooth (hgm, shgm, nbins, nker, iter) + +real hgm[ARB] # the original histogram +real shgm[ARB] # the smoothed histogram +int nbins # length of the histogram +int nker # half width of box kernel +int iter # number of iterations + +pointer sp, work1, work2 + +begin + # Smooth the histogram + switch (iter) { + case 1: + call ap_sboxr (hgm, shgm, nbins, nker) + case 2: + call smark (sp) + call salloc (work1, nbins, TY_REAL) + call ap_sboxr (hgm, Memr[work1], nbins, nker) + call ap_sboxr (Memr[work1], shgm, nbins, nker) + call sfree (sp) + default: + call smark (sp) + call salloc (work1, nbins, TY_REAL) + call salloc (work2, nbins, TY_REAL) + call ap_sboxr (hgm, Memr[work1], nbins, nker) + call ap_sboxr (Memr[work1], Memr[work2], nbins, nker) + call ap_sboxr (Memr[work2], shgm, nbins, nker) + call sfree (sp) + } +end |