function rd_lev0log, log
;
;
;HISTORY:
;	Written 15-Jun-94 by M.Morrison
;
;---------------------------------------- lev0log ------------------------------
;Updated Tue Jun 14 13:41:39 PDT 1994
;series_name fsn lsn online_status archive_status tape bytes online_loc
;
;apr1000    0   21 Y  Y    20     3048567 /DSDS1/D2919/apr1000/lev0
;apr1001    0   21 Y  Y    20     3048567 /DSDS1/D2920/apr1001/lev0
;apr1002    0   21 Y  Y    20     3048567 /DSDS1/D2921/apr1002/lev0
;apr1066l   0    5 Y              8698532 /DSDS1/D3343/apr1066l/lev0
;------------------------------------------------------------------------------
;
if (getenv('HOSTNAME') eq 'quake') then dir = '/home/soi/data/' else dir = '$MDI_CAL_INFO/
infil = dir + 'lev0log'
mat0 = rd_tfile(infil)
mat0 = mat0(3:*)		;drop first three lines
remtab, mat0, mat
n = n_elements(mat)
;
out0 = {rd_lev0log, ser: ' ', nimages: 0L, $
	qonline: 0b, qarchive: 0b, $
	tape: -1, bytes: 0L, dir: ' '}
out = replicate(out0, n)
;
out.ser 	= strtrim(strmid(mat, 0, 8), 2)
out.nimages	= fix(strmid(mat, 12, 5))
temp		= strmid(mat, 18, 1)
out.qonline	= (temp eq 'Y')
temp		= strmid(mat, 21, 1)
out.qarchive	= (temp eq 'Y')
temp 		= strmid(mat, 24, 4)
ss 		= where(temp ne '    ')
out(ss).tape	= fix(temp(ss))
out.bytes	= long(strmid(mat, 28, 12))
out.dir		= strmid(mat, 41, 99)
;
return, out
end

