function tykw_rdt2timej,rdata

;+
; NAME:
;       TYKW_RDT2TIMEJ
;
; PURPOSE:
;       This function is for getting the JST time array from the TYKW raw data
;
; CALLING SEQUENCE:
;       timej=tykw_rdt2timej(rdata)
;
; INPUTS:
;       rdata: structure of the raw data
;
; OPTIONAL INPUT KEYWORDS:
;
; OUTPUTS:
;       timej: structure array with 'time internal format'. Time is in JST.
;
; 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
;
;-

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; time
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

nmax=n_elements(rdata)
ndtx=long(total(rdata.blockl))

timej_base=anytim(transpose([ $
   [rdata.hours],[rdata.minut],[rdata.secnd],[rdata.subsec*10] $
  ,[rdata.day],[rdata.month],[rdata.year]]),/int)

timej=replicate(timej_base(0),112*nmax)

timej.day=reform((lonarr(112)+1)#timej_base.day,112*nmax)
timej.time=reform( $
  (100*lindgen(112))#(lonarr(nmax)+1)+(lonarr(112)+1)#timej_base.time,112*nmax)

timej=timej(0:ndtx-1)


return,timej
end
