Pro hour_read, code=code, year=year, month=month, length=length, data
if not keyword_set(month) then month=1
month = month - 1
if not keyword_set(length) then length=12
length = length - 1
path='/magneto3/maccs/murr/hour/'
path='/atmos5/2000/hour/'
path='/raid/2004/unrotated/hour/'
months = ['jan','feb','mar','apr','may','jun','jul','aug','sep','oct','nov','dec']
days = [31,28,31,30,31,30,31,31,30,31,30,31]
if year mod 4 eq 0 then days(1)=days(1)+1
hours = days*24.
total_hours = total(hours(month:month+length))
data = fltarr(3,total_hours)
j=0
for i = 0,length do begin
filename = path+code+strmid(strip(year), 2,2)+months(i+month)+'.1h'
openr,file,filename,/get_lun,error=err
if err ne 0 then begin
print,'Error in '+filename+' '+!err_string
data(*,j:j+hours(i+month)-1)=32767
j = j + hours(i+month)
endif else begin
print,'Processing '+filename
temp_data = bytarr(12*hours(i+month))
readu,file,temp_data
for k = 0,hours(i+month)-1 do begin
data(0,j) = (long(temp_data(12*k:12*k+11),0)) / 1000.
data(1,j) = (long(temp_data(12*k:12*k+11),4)) / 1000.
data(2,j) = (long(temp_data(12*k:12*k+11),8)) / 1000.
j=j+1
endfor
close,file
free_lun,file
endelse
endfor
end

