aboutsummaryrefslogtreecommitdiff
path: root/noao/obsutil/src/sptime/rates.cl
blob: f664b097f6259b56a9bbb6f7b3ae6abda73ea924 (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
65
66
67
68
69
70
71
72
73
74
procedure rates (grating, filter, order)

file	grating				{prompt="Grating"}
file	filter				{prompt="Filter"}
int	order = INDEF			{prompt="Order"}
real	wave = INDEF			{prompt="Central wavelength"}
file	spectrograph = "rcspec"		{prompt="Spectrograph"}
real	width = 10.			{prompt="Slit width"}

string	title = ""			{prompt="Title"}
real	w1 = 3000.			{prompt="Lower wavelength to plot"}
real	w2 = 12000.			{prompt="Upper wavelength to plot\n"}

real	x1 = 3000.			{prompt="Left graph wavelength"}
real	x2 = 12000.			{prompt="Right graph wavelength"}
real	y1 = -5.			{prompt="Bottom graph efficiency"}
real	y2 = 105.			{prompt="Top graph efficiency"}
string	ltype = "1"			{prompt="Line type"}
string	color = "1"			{prompt="Color"}
bool	append = no			{prompt="Append?"}

struct	*fd

begin
	string	search
	file	tmp1, tmp2
	real	x, y

	tmp1 = mktemp ("tmp$iraf")
	tmp2 = mktemp ("tmp$iraf")

	search = "spectimedb$,sptimeKPNO$"
	search = search // ",sptimeKPNO$Spectrographs"
	search = search // ",sptimeKPNO$Gratings"
	search = search // ",sptimeKPNO$Grisms"
	search = search // ",sptimeKPNO$Filters/RCCRYO"
	search = search // ",sptimeKPNO$Filters/GCAM"

	sptime (time=1., maxexp=3600., sn=25., spectrum="fnu_power",
	    sky="none", sensfunc="none", airmass=1., seeing=1.5, phase=0.,
	    temperature=6000., index=0., refwave=INDEF, refflux=10.,
	    funits="AB", abjohnson="none", wave=wave, order=order,
	    xorder=INDEF, width=width, length=INDEF, diameter=INDEF,
	    inoutangle=INDEF, xinoutangle=INDEF, xbin=1, ybin=1,
	    search=search, spectrograph=spectrograph, filter=filter,
	    filter2="none", disperser=grating, xdisperser="none",
	    fiber="none", telescope="", adc="", collimator="",
	    corrector="", camera="", detector="", aperture="",
	    extinction="", gain=INDEF, rdnoise=INDEF, dark=INDEF, skysub="none",
	    nskyaps=10, output="rate", list=tmp2, graphics="",
	    interactive=no, nw=1000, > "dev$null")

	fd = tmp2
	while (fscan (fd, x, y) != EOF) {
	    if (nscan() != 2)
		next
	    if (x < w1 || x > w2)
		next
	    print (x, y, >> tmp1)
	}
	fd = ""

	graph (tmp1, wx1=x1, wx2=x2, wy1=y1, wy2=y2, wcs="logical", axis=1,
	    transpose=no, pointmode=no, marker="box", szmarker=0.005,
	    ltypes=ltype, colors=color, logx=no, logy=no, box=yes,
	    ticklabels=yes, xlabel="Wavelength (A)", ylabel="Rate",
	    xformat="wcsformat", yformat="", title=title,
	    lintran=no, p1=0., p2=0., q1=0., q2=1., vx1=0., vx2=0., vy1=0.,
	    vy2=0., majrx=7, minrx=3, majry=7, minry=3, overplot=no,
	    append=append, device="stdgraph", round=no, fill=yes)

	delete (tmp1, verify-)
	delete (tmp2, verify-)
end