function eve_read_l0cs, filename, status
status=0
if file_test(filename) eq 0 then begin
print,'file not found : '+filename
status = -1
return,-1
endif
data_rec = { yyyydoy:0L, mmdd:0L, hhmm:0L, minuteofday:0L, $
p_xrslong:0., p_xrsshort:0., p_sem304:0., $
esp_0_7:0., esp_17:0., esp_25:0., esp_30:0., esp_36:0., $
esp_dark:0., mp_lya:0., mp_dark:0., $
esp_q0:0., esp_q1:0., esp_q2:0., esp_q3:0., $
esp_cm_lat:0., esp_cm_lon:0. }
s=';'
openr,lun,/get,filename
cnt=0L
while strmid(s,0,1) eq ';' do begin
readf,lun,s
cnt++
endwhile
datestr = s
n_minutes=file_lines(filename) - cnt
sarr=strarr(n_minutes)
for i=0,n_elements(sarr)-1 do begin
readf,lun,s
sarr[i] = s
endfor
close,lun
free_lun,lun
data = replicate( data_rec, n_minutes )
data.yyyydoy = long(strmid(datestr,0,4))*1000L + $
long(strmid(datestr,5,3))
data.mmdd = long(strmid(datestr,9,2)) + long(strmid(datestr,12,2))
hhmm = long(strmid(sarr,0,4))
data.hhmm = hhmm
hh = long(hhmm/100L)
mm = hhmm mod 100L
data.minuteofday = (hh*60L) + mm
c=5L
data.p_xrslong = float(strmid(sarr, c, 9))
c+=10
data.p_xrsshort = float(strmid(sarr, c, 9))
c+=10
data.p_sem304 = float(strmid(sarr, c, 9))
c+=10
data.esp_0_7 = float(strmid(sarr, c, 9))
c+=10
data.esp_17 = float(strmid(sarr, c, 9))
c+=10
data.esp_25 = float(strmid(sarr, c, 9))
c+=10
data.esp_30 = float(strmid(sarr, c, 9))
c+=10
data.esp_36 = float(strmid(sarr, c, 9))
c+=10
data.esp_dark = float(strmid(sarr, c, 9))
c+=10
data.mp_lya = float(strmid(sarr, c, 9))
c+=10
data.mp_dark = float(strmid(sarr, c, 9))
c+=10
data.esp_q0 = float(strmid(sarr, c, 9))
c+=10
data.esp_q1 = float(strmid(sarr, c, 9))
c+=10
data.esp_q2 = float(strmid(sarr, c, 9))
c+=10
data.esp_q3 = float(strmid(sarr, c, 9))
c+=10
data.esp_cm_lat = float(strmid(sarr, c, 4))
c+=6
data.esp_cm_lon = float(strmid(sarr, c, 4))
return, data
end