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/onedspec/ecidentify/ecnearest.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'noao/onedspec/ecidentify/ecnearest.x')
-rw-r--r-- | noao/onedspec/ecidentify/ecnearest.x | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/noao/onedspec/ecidentify/ecnearest.x b/noao/onedspec/ecidentify/ecnearest.x new file mode 100644 index 00000000..7b061472 --- /dev/null +++ b/noao/onedspec/ecidentify/ecnearest.x @@ -0,0 +1,26 @@ +include <mach.h> +include "ecidentify.h" + +# EC_NEAREST -- Find the nearest feature to a given coordinate. + +procedure ec_nearest (ec, fitnear) + +pointer ec # ID pointer +double fitnear # Coordinate to find nearest feature + +int i, ec_next() +double delta, delta1 + +begin + EC_CURRENT(ec) = 0 + + i = 0 + delta = MAX_REAL + while (ec_next (ec, i) != EOF) { + delta1 = abs (FIT(ec,i) - fitnear) + if (delta1 < delta) { + EC_CURRENT(ec) = i + delta = delta1 + } + } +end |