;+
; NAME:
;	SS2DSET
; PURPOSE:
;	Given an SS array for a single file, this routine returns the
;	structure required for DSET_ARR
; CALLING SEQUENCE:  
;	DSET_ARR = ss2dset(ss)
; INPUT:
;	ss	array of required records (from a single file)
; OUTPUT:
;	structure needed for DSET_ARR. 
; OPTIONAL OUTPUT:
;
; HISTORY
;	RDB	Feb 1992	written
;
;-
function ss2dset,dset_arr

    dset_arr0 = make_str("{dummy, dset: fix(0), ifil: fix(0)}")
    tmp = replicate(dset_arr0, n_elements(dset_arr))
    tmp.dset = dset_arr

;    offset = intarr(nfiles)
;    for i=1,nfiles-1 do offset(i) = total(ndset(0:i-1))
;    tmp.dset = dset_arr - offset(filidx(dset_arr))    ;adjust back to dset number within the file
;    tmp.ifil = filidx(dset_arr)
;    dset_arr = tmp

help,tmp
return,tmp
end
