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 ; 2006-02-15 added swap_endian for x86 system by MS ; 2013-09-02 added swap_endian for x86_64 system by MS ; ;- 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} if ((!version.arch eq 'x86') or (!version.arch eq 'x86_64')) then begin ; swap endian openr,uin,file,/get_lun,/swap_endian readu,uin,hd nmax=hd.n_blocks-2 rdata = replicate( {tykw} , nmax ) readu,uin,rdata free_lun,uin endif else begin openr,uin,file,/get_lun readu,uin,hd nmax=hd.n_blocks-2 rdata = replicate( {tykw} , nmax ) readu,uin,rdata free_lun,uin endelse return end