pro wrt1cba, rec1, gen_index, lun, bytout
;
;+
;NAME:
;	wrt1cba
;PURPOSE:
;	Write one record of the CBA file (called exclusively
;	by the reformatter)
;INPUT:
;	rec1
;	gen_index
;	lun
;	bytout
;HISTORY:
;	Written Fall '91 by M.Morrison
;	 6-Mar-92 (MDM) Changed to not write out "mat2" which was
;			the ground derived time information.
;-
;
ref_struct, ref
rsiz = ref.CBA_Fil_Rec_Siz
;
istcol = 0
iencol = 3
mat1 = rec1(16:*, *)		;drop first 16 bytes of each minor frame
mat1 = byte(mat1,0, 16,8,64)	;16x8 by 64 minor frames
mat1 = mat1(istcol:iencol, *, *)
;
;;mat2 = rec1(0:15, *)		;time labels
;
gen_index.nIndexByte	= get_nbytes(gen_index)
;;gen_index.nDataByte	= get_nbytes(mat1) + get_nbytes(mat2)
gen_index.nDataByte	= get_nbytes(mat1)
;
rdwrt, 'W', lun, bytout, rsiz, gen_index, 1
rdwrt, 'W', lun, bytout, rsiz, mat1, 1
;;rdwrt, 'W', lun, bytout, rsiz, mat2, 1
;
end
