pro tykw_rd_rdt,file,rdata

;+
; NAME:
;       TYKW_RD_RDT
;
; PURPOSE:
;       This procedure is for reading the raw data of TYKW.
;
; CALLING SEQUENCE:
;       tykw_rd_rdt,file,rdata
;
; INPUTS:
;       file: file name of TYKW data
;
; OPTIONAL INPUT KEYWORDS:
;
; OUTPUTS:
;       rdata: structure of the raw data
;
; HISTORY:
;    4/6/79        ver.0.0 K. Shibasaki as fortran program
;    Sep. 09, 1994 ver.1.0 M. Nishio
;    Jan. 10, 1995 ver.2.0 M. Nishio
;    Apr. 13, 1995 ver.3.2 M. Nishio
;    Apr. 13, 1995 ver.4.0 M. Nishio
;    May. 23, 1995 ver.5.0 M. Nishio
;    May  01, 1995 ver.5.2 M. Nishio
;    Apr. 25, 1995 ver.5.0 M. Nishio
;
;    1999-01-12 ported to IDL by TY
;
;-

hd = { tykw_hd, $
     dummy0: intarr(3), n_blocks: 0, dummy: intarr(124)}

inrec = { tykw, $
     channel: 0, blockl: 0, mode: 0, month: 0, day: 0, year: 0, $
     hours: 0, minut: 0, secnd: 0, subsec: 0, $
     fsamp : intarr(3), fs: 0, dfact: 0, $
     data : intarr(112), terminater: 0}

openr,uin,file,/get_lun
readu,uin,hd
nmax=hd.n_blocks-2
rdata = replicate( {tykw} , nmax )
readu,uin,rdata
free_lun,uin

return
end
