include "sensfunc.h" # SF_STATS -- Print basic statistics about the stars and the fit. procedure sf_stats (fd, stds, nstds, function, order, npts, rms) int fd # Output file descriptor (may be STDOUT) pointer stds[nstds] # Standard star data int nstds # Number of standard stars char function[ARB] # Fitted function int order # Order of function int npts # Number of points in fit real rms # RMS of fit int i, j, n real rms1, dev1, dev2, dev3 pointer sp, str, wts begin # Start with system ID. call smark (sp) call salloc (str, SZ_LINE, TY_CHAR) call sysid (Memc[str], SZ_LINE) # Determine beam from first standard star not excluded. for (i=1; (i 0) dev1 = dev1 / ndev1 ndev2 = 0 dev2 = 0. nbin = 2 * nwaves / 3 for (; i<=nbin; i=i+1) if (Memr[wts+i-1] != 0.) { dev = Memr[sens+i-1] - Memr[fit+i-1] dev2 = dev2 + dev rms = rms + dev ** 2 ndev2 = ndev2 + 1 } if (ndev2 > 0) dev2 = dev2 / ndev2 ndev3 = 0 dev3 = 0. nbin = nwaves for (; i<=nbin; i=i+1) if (Memr[wts+i-1] != 0.) { dev = Memr[sens+i-1] - Memr[fit+i-1] dev3 = dev3 + dev rms = rms + dev ** 2 ndev3 = ndev3 + 1 } if (ndev3 > 0) dev3 = dev3 / ndev3 nrms = ndev1 + ndev2 + ndev3 if (nrms > 0) rms = sqrt (rms / nrms) end