-
Notifications
You must be signed in to change notification settings - Fork 1
/
type_v1.pro
591 lines (448 loc) · 13.5 KB
/
type_v1.pro
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
pro type, Input_file
; NAME:
; TYPE
;
; PURPOSE:
; This procedure uses flags set in the input file to create postscript
; figures of the spectra plotted between spectral standards.
;
; CALLING SEQUENCE:
;
; TYPE, Input_file
;
; INPUTS:
; Input_file: Two column ascii file that contains the file names of
; ascii spectra and a type flag.
;
; OUTPUTS:
; Creates 2-page postscript figures for each object listed in the Input_file.
;
; PROCEDURE:
; Normalizes L dwarfs at 8250 A, Ms at 8100 A, and Carbon stars at 7500 A.
; The file name listed in the Input_file is used as the object name.
;
; ROUTINES CALLED:
; avg_flux.pro
; Also uses standards.dat and stan_giants.dat
;
; MODIFICATION HISTORY:
; Written by: Kelle Cruz, July 2002
;-
if N_params() lt 1 then begin
print,"Syntax - type, 'file'"
print, ''
print,'The input file consists of two columns, the file name and the'
print,'number giving the rough initial spectral type according to the'
print,'following key:'
print, ''
print,'-4 WD'
print,'-3 not typed'
print,'-2 carbon'
print,'-10 early giant'
print,'-11 mid giant'
print,'-12 late giant'
print,'0 M1.5 - M5.5'
print,'1 M4.5 - M7'
print,'2 M6 - M8'
print,'3 M7 - M9'
print,'4 M8 - L1'
print,'5 L0 - L3'
print,'6 L2 - L5'
print,'7 L4 - L7'
print,'8 L5 - L8'
return
endif
root='/data/hillary/1/kelle/idl/kellepro/'
EG_f=root + 'EG274.dat'
restore, EG_f
restore, root + 'standards.dat'
restore, root + 'stan_giants.dat'
one_line = dblarr(2)
file_line = ''
openr, 2, Input_file
WHILE NOT EOF(2) DO BEGIN
READF, 2, file_line
info=strsplit(file_line,/extract)
file=info(0)
early=fix(info(1))
;print, file, early
IF early ne -3 THEN BEGIN
;-4 plotted next to WD
;-3 is not typed
;-2 is carbon
;-10 is early giant
;-11 is mid giant
;-12 is late giant
;0 M1.5 - M5.5
;1 M4.5 - M7
;2 M6 - M8
;3 M7 - M9
;4 M8 - L1
;5 L0 - L3
;6 L2 - L5
;7 L4 - L7
;8 L5 - L8
unit=1
data_file = file
;obj_pos=strpos(data_file,'.txt')
;object=strmid(data_file,0,obj_pos))[0]
object=(strsplit(data_file,'.txt',/extract,/regex))[0]
print, object
openr, unit, data_file
;Read in FITS header
comment = ' '
blank = ' '
file = ' '
READF, unit, comment
header_check = strmid(comment,0,4)
if header_check eq 'BITP' THEN header=1 else header=0
IF header eq 1 THEN BEGIN
endy = 0
WHILE endy ne 1 DO BEGIN
READF, unit, comment
check = strmid(comment,0,4)
IF check eq 'FILE' THEN file = strmid(comment,11,16)
IF check eq 'CDEL' THEN pix_scale = float(strmid(comment,10,30))
IF check eq 'END ' THEN endy = 1
ENDWHILE
;Read in blanks + first line of data
WHILE blank eq ' ' DO BEGIN
READF, unit, comment
blank = strmid(comment,0,1)
ENDWHILE
ENDIF
;Read in data
wavelength = dblarr(4000)
flux = dblarr(4000)
x=0
WHILE NOT EOF(1) DO BEGIN
READF, 1, one_line
wavelength(x) = one_line(0)
flux(x) = one_line(1)
x = x + 1
ENDWHILE
close, unit
flux=flux(0:x-1)
w=wavelength(0:x-1)
IF max(w) le 9000 then xtop=max(w) ELSE xtop=10000.
xr=[6000,xtop]
if xtop gt 9000 THEN es=1 ELSE es=0
IF header eq 0 then pix_scale = wavelength(1) - wavelength(0)
IF early eq 4 THEN BEGIN
startw = 8080. & endw = 8155.
a = where(w ge startw-pix_scale/2 AND w le endw+pix_scale/2)
num = avgflux(startw,endw,pix_scale,w(a),flux(a))
nf1=flux/num
startw = 8240. & endw = 8260.
a = where(w ge startw-pix_scale/2 AND w le endw+pix_scale/2)
num = avgflux(startw,endw,pix_scale,w(a),flux(a))
nf2=flux/num
ENDIF
;carbon
;change to 7500
IF early eq -2 THEN BEGIN & startw = 7490. & endw = 7510. & ENDIF
;Ms (dwarfs and giants)
IF (early lt 4 AND early ge 0) OR (early le -10) THEN BEGIN & startw = 8080. & endw = 8155. & ENDIF
;Ls
IF early gt 4 THEN BEGIN & startw = 8240. & endw = 8260. & ENDIF
;wd
IF early eq -4 THEN BEGIN & startw = 7000. & endw = 7200. & ENDIF
a = where(w ge startw-pix_scale/2 AND w le endw+pix_scale/2)
num = avgflux(startw,endw,pix_scale,w(a),flux(a))
nf=flux/num
!p.font=0
set_plot, 'ps'
device, filename=object+'.ps', encapsulated=0, /helvetica,/isolatin1,/landscape, $
xsize=10.5, ysize=8.0,/inches, xoffset=0.3, yoffset=10.7
angstrom=STRING(197B)
IF early eq -2 then begin
plot, w, nf, xstyle=1
;Halpha
oplot, [6563,6563],[1.0,0.8], linestyle=1
;K I doublet
oplot, [7665,7665],[0.5,0.3], linestyle=1
oplot, [7699,7699],[0.6,0.4], linestyle=1
;Ca II triplet
oplot, [8498,8498],[0.5,0.3], linestyle=1
oplot, [8542,8542],[0.5,0.3], linestyle=1
oplot, [8662,8662],[0.5,0.3], linestyle=1
xyouts, 6100, 1.0, object, charsize=2
;plot,c6_w,c6_fn,xr=xr, yr=[0,4]
;oplot, w, nf+1.5
;xyouts,6100, 1.5, 'C6 HD 92055', charsize=1.5
;xyouts, 6100, 3.5, object, charsize=2
ENDIF
IF early eq -4 THEN BEGIN
plot, w, nf,yr=[0,4],xr=xr,xstyle=1
oplot, eg274_w,eg274_fn+2
;Halpha
oplot, [6563,6563],[1.0,0.8], linestyle=1
xyouts, 6100, 3.5, 'EG 274', charsize=1.5
xyouts, 6100, 2, object, charsize=2
ENDIF
IF early eq -10 OR early eq -1 THEN BEGIN
plot, m0_w,m0_fn,xr=xr, yr=[0,3], xstyle=1
oplot, w, nf+0.85
oplot, k5_w,k5_fn+1.75
;Halpha
oplot, [6563,6563],[1.8,2.0], linestyle=1
;K I doublet
oplot, [7665,7665],[1.3,1.5], linestyle=1
oplot, [7699,7699],[1.4,1.6], linestyle=1
;Ca II triplet
oplot, [8498,8498],[1.5,1.7], linestyle=1
oplot, [8542,8542],[1.2,1.4], linestyle=1
oplot, [8662,8662],[1.2,1.4], linestyle=1
xyouts,6100, 0.8, 'M0 III HD 95578', charsize=1.5
xyouts, 6100, 1.9, object, charsize=2
xyouts, 6100, 2.7, 'K5 III HD 133774', charsize=1.5
plot, m2_w,m2_fn,xr=xr, yr=[0,3], xstyle=1
oplot, w, nf+0.85
oplot, m0_w,m0_fn+1.75
;Halpha
oplot, [6563,6563],[1.8,2.0], linestyle=1
;K I doublet
oplot, [7665,7665],[1.3,1.5], linestyle=1
oplot, [7699,7699],[1.4,1.6], linestyle=1
;Ca II triplet
oplot, [8498,8498],[1.5,1.7], linestyle=1
oplot, [8542,8542],[1.2,1.4], linestyle=1
oplot, [8662,8662],[1.2,1.4], linestyle=1
xyouts,6100, 0.6, 'M2 III HD 120052', charsize=1.5
xyouts, 6100, 1.8, object, charsize=2
xyouts, 6100, 2.6, 'M0 III HD 95578', charsize=1.5
ENDIF
;K5 III HD 133774
;M2 HD 120052
;M4 HD 80431
;M0 III HD 95578
IF early eq -11 THEN BEGIN
plot, m4_w,m4_fn,xr=xr, yr=[0,3], xstyle=1
oplot, w, nf+1.0
oplot, m2_w,m2_fn+1.75
;Halpha
oplot, [6563,6563],[1.6,1.8], linestyle=1
;K I doublet
oplot, [7665,7665],[1.3,1.5], linestyle=1
oplot, [7699,7699],[1.4,1.6], linestyle=1
;Ca II triplet
oplot, [8498,8498],[1.7,1.9], linestyle=1
oplot, [8542,8542],[1.6,1.8], linestyle=1
oplot, [8662,8662],[1.6,1.8], linestyle=1
xyouts,6100, 0.6, 'M4 III HD 80431', charsize=1.5
xyouts, 6100, 1.5, object, charsize=2
xyouts, 6100, 2.3, 'M2 III HD 120052', charsize=1.5
plot, m7_w,m7_fn,xr=xr, yr=[0,3]
oplot, w, nf+0.85
oplot, m4_w,m4_fn+1.75
;Halpha
oplot, [6563,6563],[1.6,1.8], linestyle=1
;K I doublet
oplot, [7665,7665],[1.3,1.5], linestyle=1
oplot, [7699,7699],[1.4,1.6], linestyle=1
;Ca II triplet
oplot, [8498,8498],[1.6,1.8], linestyle=1
oplot, [8542,8542],[1.5,1.7], linestyle=1
oplot, [8662,8662],[1.5,1.7], linestyle=1
xyouts,6100, 0.4, 'M7 III VY Peg', charsize=1.5
xyouts, 6100, 1.4, object, charsize=2
xyouts, 6100, 2.3, 'M4 III HD 80431', charsize=1.5
ENDIF
IF early eq -12 THEN BEGIN
plot, m8_w,m8_fn,xr=xr, yr=[0,3.5], ystyle=1,yminor=1, xstyle=1
oplot, w, nf+1.0
oplot, m7_w,m7_fn+2.0
;Halpha
oplot, [6563,6563],[1.3,1.5], linestyle=1
;K I doublet
oplot, [7665,7665],[0.8,1.0], linestyle=1
oplot, [7699,7699],[0.8,1.0], linestyle=1
;Ca II triplet
oplot, [8498,8498],[1.3,1.5], linestyle=1
oplot, [8542,8542],[1.3,1.5], linestyle=1
oplot, [8662,8662],[1.3,1.5], linestyle=1
xyouts,6100, 0.3, 'M8 III BR 0954-0947', charsize=1.5
xyouts, 6100, 1.2, object, charsize=2
xyouts, 6100, 2.4, 'M7 III VY Peg', charsize=1.5
plot, m9_w,m9_fn,xr=xr, yr=[0,3.5], ystyle=1,yminor=1, xstyle=1
oplot, w, nf+0.85
oplot, m8_w,m8_fn+1.75
;Halpha
oplot, [6563,6563],[1.1,1.3], linestyle=1
;K I doublet
oplot, [7665,7665],[0.8,1.0], linestyle=1
oplot, [7699,7699],[0.8,1.0], linestyle=1
;Ca II triplet
oplot, [8498,8498],[1.1,1.3], linestyle=1
oplot, [8542,8542],[1.1,1.3], linestyle=1
oplot, [8662,8662],[1.1,1.3], linestyle=1
xyouts, 6100, 0.3, 'M9 III BR 1219-1336', charsize=1.5
xyouts, 6100, 1.2, object, charsize=2
xyouts, 6100, 2.4, 'M8 III BR 0954-0947', charsize=1.5
ENDIF
IF early eq 0 then begin
plot, m25_w,m25_fn, xr=xr, yr=[0,3], xstyle=1
oplot, w, nf+0.85
oplot, m15_w,m15_fn+1.75
;Halpha
oplot, [6563,6563],[1.5,1.7], linestyle=1
;K I doublet
oplot, [7665,7665],[1.2,1.4], linestyle=1
oplot, [7699,7699],[1.25,1.45], linestyle=1
;Ca II triplet
oplot, [8498,8498],[1.4,1.6], linestyle=1
oplot, [8542,8542],[1.4,1.6], linestyle=1
oplot, [8662,8662],[1.4,1.6], linestyle=1
xyouts,6100, 0.6, 'M2.5 Gl 250 B', charsize=1.5
xyouts, 6100, 1.6, object, charsize=2
xyouts, 6100, 2.6, 'M1.5 Gl 205', charsize=1.5
ENDIF
IF early eq 1 OR early eq 0 then begin
plot, m55_w,m55_flux_n, xr=xr, yr=[0,3], xstyle=1
oplot, w, nf+0.85
oplot, m45_w,m45_flux_n+1.75
;Halpha
oplot, [6563,6563],[1.5,1.7], linestyle=1
;K I doublet
oplot, [7665,7665],[1.2,1.4], linestyle=1
oplot, [7699,7699],[1.25,1.45], linestyle=1
;Ca II triplet
oplot, [8498,8498],[1.4,1.6], linestyle=1
oplot, [8542,8542],[1.4,1.6], linestyle=1
oplot, [8662,8662],[1.4,1.6], linestyle=1
xyouts,6100, 0.6, 'M5.5 Gl 65', charsize=1.5
xyouts, 6100, 1.6, object, charsize=2
xyouts, 6100, 2.6, 'M4.5 Gl 83.1', charsize=1.5
ENDIF
IF early eq 1 OR early eq 2 THEN BEGIN
plot, m7_lambda,m7_flux_n, xr=xr, yr=[0,3], xstyle=1
oplot, w, nf+0.75
oplot, m6_lambda,m6_flux_n+1.75
;Halpha
oplot, [6563,6563],[1.1,1.3], linestyle=1
;Li
oplot, [6708,6708],[1.0,1.2], linestyle=1
;K I doublet
oplot, [7665,7665],[0.7,0.9], linestyle=1
oplot, [7699,7699],[0.75,0.95], linestyle=1
xyouts,6100, 0.3, 'M7 VB 8', charsize=1.5
xyouts, 6100, 1.3, object, charsize=2
xyouts, 6100, 2.2, 'M6 LHS 1326', charsize=1.5
ENDIF
IF early eq 2 OR early eq 3 then begin
if es eq 0 then ym=3 else ym=4
plot, m8_lambda,m8_flux_n, xr=xr, yr=[0,ym], xstyle=1
oplot, w, nf+0.75+0.3*es
oplot, m7_lambda,m7_flux_n+1.75+0.5*es
;Halpha
oplot, [6563,6563],[1.1,1.3], linestyle=1
;Li
oplot, [6708,6708],[1.0,1.2], linestyle=1
;K I doublet
oplot, [7665,7665],[0.6,0.8], linestyle=1
oplot, [7699,7699],[0.65,0.85], linestyle=1
xyouts,6100, 0.3, 'M8 VB 10', charsize=1.5
xyouts, 6100, 1.3+0.3*es, object, charsize=2
xyouts, 6100, 2.2+0.5*es, 'M7 VB8', charsize=1.5
ENDIF
IF early eq 3 OR early eq 4 THEN BEGIN
if es eq 0 then ym=3 else ym=5
plot, m9_lambda,m9_flux_n, xr=xr, yr=[0,ym], xstyle=1
IF early eq 4 then oplot, w, nf1+0.85+1.1*es else oplot, w, nf+0.85+1.1*es
oplot, m8_lambda,m8_flux_n+1.75+1.5*es
;Halpha
oplot, [6563,6563],[1.1,1.3], linestyle=1
;Li
oplot, [6708,6708],[1.0,1.2], linestyle=1
;K I doublet
oplot, [7665,7665],[0.7,0.9], linestyle=1
oplot, [7699,7699],[0.75,0.95], linestyle=1
xyouts,6100, 0.4, 'M9 LHS 2065', charsize=1.5
xyouts, 6100, 1.3+1.1*es, object, charsize=2
xyouts, 6100, 2.2+1.5*es, 'M8 VB 10', charsize=1.5
ENDIF
IF early eq 4 OR early eq 5 THEN BEGIN
if es eq 0 then ym=2.5 else ym=4
plot, L1_w,L1_fn, xr=xr, yr=[0,ym], xstyle=1
IF early eq 4 then oplot, w, nf2+0.5+0.5*es else oplot, w, nf+0.5+0.5*es
oplot, L0_w,L0_fn+1.2+0.5*es
;Halpha
oplot, [6563,6563],[0.7,0.8], linestyle=1
;Li
oplot, [6708,6708],[0.65,0.75], linestyle=1
;K I doublet
oplot, [7665,7665],[0.4,0.5], linestyle=1
oplot, [7699,7699],[0.45,0.55], linestyle=1
xyouts,6100, 0.2, 'L1 2M1439', charsize=1.5
xyouts, 6100, 0.9+0.5*es, object, charsize=2
xyouts, 6100, 1.5+0.5*es, 'L0 2M0345', charsize=1.5
ENDIF
IF early eq 5 OR early eq 6 THEN BEGIN
if es eq 0 then ym=2.5 else ym=4.5
plot, L3_w,L3_fn, xr=xr, yr=[0,ym], xstyle=1
oplot, w, nf+0.6+0.4*es
oplot, L2_w,L2_fn+1.3+0.8*es
;Halpha
oplot, [6563,6563],[0.75,0.85], linestyle=1
;Li
oplot, [6708,6708],[0.75,0.85], linestyle=1
xyouts,6100, 0.2, 'L3 DENIS 1058', charsize=1.5
xyouts, 6100, 0.9+0.4*es, object, charsize=2
xyouts, 6100, 1.6+0.8*es, 'L2 Kelu 1', charsize=1.5
ENDIF
IF early eq 6 OR early eq 7 THEN BEGIN
if es eq 0 then ym=4 else ym=6
plot, L5_D1228_w,L5_D1228_fn+0.1, xr=xr, yr=[0,ym], xstyle=1
oplot, w, nf+1.1+0.3*es
oplot, L4_w,L4_fn+2.4+0.3*es
;Halpha
oplot, [6563,6563],[1.3,1.5], linestyle=1
;Li
oplot, [6708,6708],[1.25,1.45], linestyle=1
xyouts,6100, 0.4, 'L5 DENIS 1228', charsize=1.5
xyouts, 6100, 1.5+0.3*es, object, charsize=2
xyouts, 6100, 2.8+0.3*es, 'L4 2M1155', charsize=1.5
ENDIF
IF early eq 7 THEN BEGIN
if es eq 0 then ym=5 else ym=7
plot, L7_D0205_w,L7_D0205_fn+0.25, xr=xr, yr=[0,ym], xstyle=1
oplot, w, nf+1.7+0.7*es
oplot, L6_w,L6_fn+3.0+1.3*es
;Halpha
oplot, [6563,6563],[2.0,2.2], linestyle=1
;Li
oplot, [6708,6708],[1.9,2.1], linestyle=1
xyouts,6100, 0.7, 'L7 DENIS 0205', charsize=1.5
xyouts, 6100, 2.4+0.7*es, object, charsize=2
xyouts, 6100, 3.4+1.3*es, 'L6 2M0850', charsize=1.5
ENDIF
IF early eq 8 THEN BEGIN
if es eq 0 then ym=5 else ym=8
plot, L6_w,L6_fn+0.10, xr=xr, yr=[0,ym], xstyle=1
oplot, w, nf+1.4+0.7*es
oplot, L5_D1228_w,L5_D1228_fn+3.2+0.7*es
;Halpha
oplot, [6563,6563],[1.9,2.2], linestyle=1
;Li
oplot, [6708,6708],[1.8,2.1], linestyle=1
xyouts,6100, 0.4, 'L6 2M0850', charsize=1.5
xyouts, 6100, 2.2+0.7*es, object, charsize=2
xyouts, 6100, 3.5+0.7*es, 'L5 DENIS 1228', charsize=1.5
plot, L8_w,L8_fn+0.1, xr=xr, yr=[0,ym], xstyle=1
oplot, w, nf+1.8+0.3*es
oplot, L7_D0205_w,L7_D0205_fn+3.6+0.1*es
;Halpha
oplot, [6563,6563],[2.3,2.7], linestyle=1
;Li
oplot, [6708,6708],[2.2,2.6], linestyle=1
xyouts,6100, 0.75, 'L8 2M1632', charsize=1.5
xyouts, 6100, 2.75+0.3*es, object, charsize=2
xyouts, 6100, 4.5+0.1*es, 'L7 DENIS 0205', charsize=1.5
ENDIF
device, /close
ENDIF
ENDWHILE
close, 2
set_plot, 'x'
;stop
END