function get_fninfo, fn, limits, sxtf=sxtf, sxtp=sxtp, key=key 

;+
;   Name: get_fninfo
;
;   Purpose: decode and return fnmap information
;
;   Input Parameters: 
;	fn - fnmap containing information for all instr.
;
;    Output - function returns array of file names 
;
;    Output Parameters:
;	limits = 2D array [number files x 2]	
;
;    Modification History; revision 1, slf, 10/13/91
;    Restrictions: need to fill in other instruments
;-
;
tags=tag_names(fn)
if keyword_set(sxtf) then insttags=['STSFR','ENSFR']
if keyword_set(sxtp) then insttags=['STSPR','ENSPR']
;
tagstart=where(tags eq insttags(0))
tagstop =where(tags eq insttags(1))

start=long(str2arr(fn.(tagstart(0))))
stop=long(str2arr(fn.(tagstop(0))))
fstat = fix(str2arr(fn.fstat))		;MDM added

; determine which indices are valid
;good=where(stop ge 0)
good=where((stop ge 0) and (fstat eq 1))	;MDM added
good=good(where(start(good) ge 0))		; slf, 2-26
start=start(good)
stop=stop(good)
;
;form return parmeter
limits=[[start],[stop]]
;
;get associated file names
filena=str2arr(fn.filena)
filena=filena(good)
;
return,filena
end
