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/imred/quadred/src/quad/setinstrument.cl | 58 ++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 noao/imred/quadred/src/quad/setinstrument.cl (limited to 'noao/imred/quadred/src/quad/setinstrument.cl') diff --git a/noao/imred/quadred/src/quad/setinstrument.cl b/noao/imred/quadred/src/quad/setinstrument.cl new file mode 100644 index 00000000..72361f89 --- /dev/null +++ b/noao/imred/quadred/src/quad/setinstrument.cl @@ -0,0 +1,58 @@ +# SETINSTRUMENT -- Set up instrument parameters for the CCD reduction tasks. +# +# This task sets default parameters based on an instrument ID. + +procedure setinstrument (instrument) + +char instrument {prompt="Instrument ID (type ? for a list)"} +char site="ctio" {prompt="Site ID"} +char directory="ccddb$" {prompt="Instrument directory"} +bool review=yes {prompt="Review instrument parameters?"} +char query {prompt="Instrument ID (type q to quit)", + mode="q"} + +begin + string inst, instdir, instmen, instfile + + # Define instrument directory, menu, and file + instdir = directory + if (site != "") + instdir = instdir // site // "/" + instmen = instdir // "instruments.men" + inst = instrument + instfile = instdir // inst // ".dat" + + # Loop until a valid instrument file is given. + while (inst != "" && !access (instfile)) { + if (access (instmen)) + page (instmen) + else if (inst == "?") + print ("Instrument list ", instmen, " not found") + else + print ("Instrument file ", instfile, " not found") + print ("") + inst = query + if (inst == "q") + return + instrument = inst + instfile = instdir // inst // ".dat" + } + + # Set instrument parameter. + if (access (instfile)) + quadred.instrument = instfile + else + quadred.instrument = "" + + # Run instrument setup script. + instfile = instdir // inst // ".cl" + if (access (instfile)) + cl (< instfile) + + # Review parameters if desired. + if (review) { + eparam ("quadred") + eparam ("qccdproc") + eparam ("quadproc") + } +end -- cgit