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/imred/ccdred/setinstrument.cl | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'noao/imred/ccdred/setinstrument.cl')
-rw-r--r-- | noao/imred/ccdred/setinstrument.cl | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/noao/imred/ccdred/setinstrument.cl b/noao/imred/ccdred/setinstrument.cl new file mode 100644 index 00000000..c10a7427 --- /dev/null +++ b/noao/imred/ccdred/setinstrument.cl @@ -0,0 +1,57 @@ +# 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="kpno" {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)) + ccdred.instrument = instfile + else + ccdred.instrument = "" + + # Run instrument setup script. + instfile = instdir // inst // ".cl" + if (access (instfile)) + cl (< instfile) + + # Review parameters if desired. + if (review) { + eparam ("ccdred") + eparam ("ccdproc") + } +end |