aboutsummaryrefslogtreecommitdiff
path: root/noao/imred/src/doslit/doslit.cl
blob: 56458435606ee5ca729c2746d689837f4fa96af5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# DOSLIT -- Process slit spectra from 2D to wavelength calibrated 1D.
#
# The task SPROC does all of the interactive work and SBATCH does the
# background work.  This procedure is organized this way to minimize the
# dictionary space when the background task is submitted.

procedure doslit (objects)

string	objects = ""		{prompt="List of object spectra"}

string	arcs = ""		{prompt="List of arc spectra"}
file	arctable		{prompt="Arc assignment table (optional)"}
string	standards = ""		{prompt="List of standard star spectra\n"}

string	readnoise = "rdnoise"	{prompt="Read out noise sigma (photons)"}
string	gain = "gain"		{prompt="Photon gain (photons/data number)"}
real	datamax = INDEF		{prompt="Max data value / cosmic ray threshold"}
real	width = 5.		{prompt="Width of profiles (pixels)"}
string	crval = "INDEF"		{prompt="Approximate wavelength"}
string	cdelt = "INDEF"		{prompt="Approximate dispersion\n"}

bool	dispcor = yes		{prompt="Dispersion correct spectra?"}
bool	extcor = no		{prompt="Extinction correct spectra?"}
bool	fluxcal = no		{prompt="Flux calibrate spectra?"}
bool	resize = no		{prompt="Automatically resize apertures?"}
bool	clean = no		{prompt="Detect and replace bad pixels?"}
bool	splot = no		{prompt="Plot the final spectrum?"}
bool	redo = no		{prompt="Redo operations if previously done?"}
bool	update = no		{prompt="Update spectra if cal data changes?"}
bool	quicklook = no		{prompt="Minimally interactive quick-look?"}
bool	batch = no		{prompt="Extract objects in batch?"}
bool	listonly = no		{prompt="List steps but don't process?\n"}

pset	sparams = ""		{prompt="Algorithm parameters"}

begin
	file	obj, arc, std

	# Expand image lists
	obj = mktemp ("tmp$iraf") 
	arc = mktemp ("tmp$iraf")
	std = mktemp ("tmp$iraf")
	sgetspec (objects, arcs, arctable, standards, obj, arc, std)

	apslitproc.readnoise = readnoise
	apslitproc.gain = gain
	apslitproc.width = width
	apslitproc.t_width = width
	apslitproc.radius = width
	apslitproc.clean = clean
	sproc.datamax = datamax

	sproc (obj, arc, arctable, std, crval, cdelt, dispcor, extcor, fluxcal,
	    resize, clean, splot, redo, update, quicklook, batch, listonly)
	delete (std, verify=no)

	if (sproc.dobatch) {
	    print ("-- Do remaining spectra as a batch job --")
	    print ("sbatch&batch") | cl
	} else {
	    delete (obj, verify=no)
	    delete (arc, verify=no)
	}
end