-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplotorders.pro
More file actions
107 lines (82 loc) · 2.88 KB
/
plotorders.pro
File metadata and controls
107 lines (82 loc) · 2.88 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
@printroutines
PRO plotorders, rootname, objname, ASCII=ascii_yes
;+
; ----------------------------------------------------------------------
; PLOTORDERS --
;
; *Program Description:
; This program will produce a postscript plot of the output
; from the STISEXTRACT procedures.
;
; *Calling sequence:
; PLOTORDERS, rootname, /ascii
;
; *Inputs:
; rootname -- The STScI rootname of the observation
; (e.g., 'o4qx04040').
;
; *Optional Keywords:
; /ascii -- write output to ascii files rather than IDL
; save files.
;
; *HISTORY:
; 8/99 -- Howk -- Created and documented.
; 12/99 -- Howk -- Added \ascii keyword.
; ----------------------------------------------------------------------
;-
IF N_PARAMS() EQ 0 THEN BEGIN
print, ''
print, 'PLOTORDERS, rootname, objname, /ascii'
print, ''
print, ' *Inputs:'
print, ' rootname -- STIS rootname.'
print, ' objname -- Object name.'
print, ''
print, ' '
print, ' *Keywords:'
print, ' \ascii -- Plot data from ascii files rather '
print, ' than save files.'
print, ''
retall
ENDIF
IF n_params() LT 2 THEN objname = ''
!p.thick = 1.8
!p.charsize = 1.1
!x.charsize = 1.1
!y.charsize = 1.1
!p.multi = [0, 1, 3]
!x.style = 1
xxxzero = [-1e6,1e6]
yyyzero = [0,0]
IF keyword_set(ascii_yes) THEN $
names = findfile2(rootname+'.*.dat', /sort) $
ELSE names = findfile2(rootname+'.*.save', /sort)
psp, /long
FOR i=0, n_elements(names)-1 DO BEGIN
ind = n_elements(names)-1 - i
startpos = strpos(names[ind], '.')+1.
ordernum = strmid(names[ind], startpos, 3)
IF (strpos(ordernum, '.') NE -1) THEN $
ordernum = strmid(ordernum, 0, 2)
orderstring = strtrim(ordernum, 2)
IF keyword_set(ascii_yes) THEN $
readcol, names[ind], wave, gross, flux, err, bg, /silent $
ELSE restore, names[ind]
sz = size(wave)
titlestring = strupcase(rootname)+'; Order '+orderstring
plot,wave[8:sz[1]-10],flux[8:sz[1]-10],xr=[wave[6],wave[sz[1]-8]], $
charsize=1.75, psym=10
oplot, wave[8:sz[1]-10],bg[8:sz[1]-10], linestyle=1, psym=10
oplot,xxxzero, yyyzero, linestyle=1
xpos = !x.crange[1]-0.015*(!x.crange[1]-!x.crange[0])
ypos = !y.crange[1]+0.035*(!y.crange[1]-!y.crange[0])
xyouts, xpos, ypos, titlestring, align=1.0
xpos = !x.crange[0]+0.015*(!x.crange[1]-!x.crange[0])
ypos = !y.crange[1]+0.035*(!y.crange[1]-!y.crange[0])
xyouts, xpos, ypos, objname, align=0.
ENDFOR
lp
spawn_text = 'mv idl.ps '+strupcase(rootname)+'.ps'
spawn, spawn_text
!p.multi = 0
END