aboutsummaryrefslogtreecommitdiff
path: root/noao/digiphot/ptools/pexamine/ptalimr.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/ptools/pexamine/ptalimr.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'noao/digiphot/ptools/pexamine/ptalimr.x')
-rw-r--r--noao/digiphot/ptools/pexamine/ptalimr.x35
1 files changed, 35 insertions, 0 deletions
diff --git a/noao/digiphot/ptools/pexamine/ptalimr.x b/noao/digiphot/ptools/pexamine/ptalimr.x
new file mode 100644
index 00000000..614b2099
--- /dev/null
+++ b/noao/digiphot/ptools/pexamine/ptalimr.x
@@ -0,0 +1,35 @@
+include <mach.h>
+
+# PT_ALIMR -- Compute the limits (minimum and maximum values) of a vector
+# after rejecting any INDEF valued points.
+
+procedure pt_alimr (a, npix, minval, maxval)
+
+real a[ARB] # the input array
+int npix # the number of points
+real minval, maxval # the minimum and maximum value
+
+int i, ngood
+real value
+
+begin
+ minval = MAX_REAL
+ maxval = -MAX_REAL
+ ngood = 0
+
+ do i = 1, npix {
+ value = a[i]
+ if (IS_INDEFR(value))
+ next
+ ngood = ngood + 1
+ if (value < minval)
+ minval = value
+ if (value > maxval)
+ maxval = value
+ }
+
+ if (ngood == 0) {
+ minval = INDEFR
+ maxval = INDEFR
+ }
+end