From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- noao/onedspec/sensfunc/sfapertures.x | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 noao/onedspec/sensfunc/sfapertures.x (limited to 'noao/onedspec/sensfunc/sfapertures.x') diff --git a/noao/onedspec/sensfunc/sfapertures.x b/noao/onedspec/sensfunc/sfapertures.x new file mode 100644 index 00000000..7eb2b6f8 --- /dev/null +++ b/noao/onedspec/sensfunc/sfapertures.x @@ -0,0 +1,27 @@ +include "sensfunc.h" + +# SF_APERTURES -- Determine the apertures in use. + +procedure sf_apertures (stds, nstds, apertures, napertures) + +pointer stds[nstds] # Standard star data +int nstds # Number of standard stars +pointer apertures # Pointer to apertures (returned) +int napertures # Number of apertures (returned) + +int i, j, aperture + +errchk malloc, realloc + +begin + call malloc (apertures, nstds, TY_INT) + napertures = 0 + do i = 1, nstds { + aperture = STD_BEAM(stds[i]) + for (j=1; (j<=napertures)&&(aperture!=Memi[apertures+j-1]); j=j+1) + ; + napertures = max (napertures, j) + Memi[apertures+j-1] = aperture + } + call realloc (apertures, napertures, TY_INT) +end -- cgit