pro rd_str_data, lun, ibyt, idset, nout, index, data, roadmap, sel_dsets, type
;+
;NAME:
;	RD_STR_DATA
;PURPOSE:
;	Perform the actual data read for SXT files which structures for
;	the data portion.  These include:
;		SDL, SLD, SLS, SOT, SXC, SXL, SXA
;INPUT:
;	lun	- the logical unit number where the file is open
;	ibyt	- the starting byte value to read from
;	idset	- the dataset number for the output matrix
;	nout	- the total number of datasets to be extracted
;	index	- the index structure for all output datasets
;	roadmap	- the roadmap
;	sel_dsets- the indicies of the datasets selected for extraction
;	type	- the data type (SDL, SLD, SLS, SOT, SXC, SXL, SXA)
;INPUT/OUTPUT:
;	data	- the data
;HISTORY:
;	written 12-Jul-93 by M.Morrison
;	18-Nov-93 (MDM) - Corrected to use the new .02 SXL structure
;-
;
common rd_str_data_blk, data0
;
if (idset eq 0) then begin
    case strupcase(type) of
	'SDL': sxt_struct, sxt_darklog =data0
	'SLS': sxt_struct, sxt_leak    =data0
	'SLD': sxt_struct, sxt_leak    =data0
	'SOT': sxt_struct, sxt_opttel  =data0
	'SXC': sxt_struct, sxt_xrcen   =data0
	'SXL': sxt_struct, sxt_xray2log=data0
	'SXA': sxt_struct, sxt_leak    =data0
    endcase
    data  = replicate(data0,  nout)
end
if (index(idset).gen.ndatabyte eq 0) then return

rdwrt, 'R', lun, ibyt, 0, data0, 1
data(idset) = data0
;
end
