aboutsummaryrefslogtreecommitdiff
path: root/noao/onedspec/irsiids/bplot.cl
blob: 53ce4cfc836873eeddd0e8c546507d03778a647c (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
# BPLOT -- Batch plotting of spectra with SPLOT

procedure bplot (images, records)

string	images				{prompt="List of images to plot"}
string	records = ""			{prompt="List of records to plot"}
string	graphics = "stdgraph"		{prompt="Graphics output device"}
string	cursor   = "onedspec$gcurval.dat"	{prompt="Cursor file(s)\n"}

struct	*ilist, *clist

begin
	int	line, ap
	file	ifile, cfile, cur, image

	ifile = mktemp ("bplot")
	cfile = mktemp ("bplot")

	names (images, records, >& ifile)
	files (cursor, > cfile) 
	cur = ""

	ilist = ifile; clist = cfile
	while (fscan (ilist, image) != EOF) {
	    if ((cursor != "") && (fscan (clist, cur) == EOF)) {
		clist = cfile
		line = fscan (clist, cur)
	    }
	    splot (image, graphics=graphics, cursor=cur)
	}
	clist = ""; ilist = ""

	delete (ifile, verify=no)
	delete (cfile, verify=no)
end