From 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 Mon Sep 17 00:00:00 2001 From: Joe Hunkeler Date: Tue, 11 Aug 2015 16:51:37 -0400 Subject: Repatch (from linux) of OSX IRAF --- noao/onedspec/identify/idrms.x | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 noao/onedspec/identify/idrms.x (limited to 'noao/onedspec/identify/idrms.x') diff --git a/noao/onedspec/identify/idrms.x b/noao/onedspec/identify/idrms.x new file mode 100644 index 00000000..82916f1a --- /dev/null +++ b/noao/onedspec/identify/idrms.x @@ -0,0 +1,28 @@ +include "identify.h" + +# ID_RMS -- Compute RMS of fit about the user coordinates + +double procedure id_rms (id) + +pointer id # ID pointer + +int i, nrms +double rms + +begin + rms = 0. + nrms = 0 + for (i=1; i<=ID_NFEATURES(id); i=i+1) { + if (!IS_INDEFD (USER(id,i)) && WTS(id,i) != 0.) { + rms = rms + (FIT(id,i) - USER(id,i)) ** 2 + nrms = nrms + 1 + } + } + + if (nrms > 0) + rms = sqrt (rms / nrms) + else + rms = INDEFD + + return (rms) +end -- cgit