function sfltmap, file, error=error, _extra=_extra @compile_opt.pro ; On error, return to caller ;+ ; NAME: ; SFLTMAP ; PURPOSE: ; Reads Sac. Peak, and source surface files ; CALLING SEQUENCE: ; map = sfltmap(file, [/scream,/timer,/error]) ; INPUTS: ; file scalar string, name of input file ; OPTIONAL INPUT PARAMETERS: ; /error see flt_read ; OUTPUTS: ; map 2D array ; CALLS: ; GetFileSpec, SetFileSpec, flt_read, bin_read ; PROCEDURE: ; Calls flt_read or bin_read to read file. Then rearranges the array. ; The file name extension (.SAC,.SRF or .YOH) is used to decide wether to ; assume the format of the Sac. Peak files, source surface files or ; Yohkoh synoptic files. ; If the extension is neither .SAC, .SRF or .YOH then flt_read is called ; and its output returned unmodified ; MODIFICATION HISTORY: ; JAN-1996, Paul Hick (UCSD) ;- SetFileSpec, file case strlowcase( GetFileSpec(part='type') ) of '.sac': begin message, /info, 'Assuming Sac. Peak format: 244 lines of 8 numbers' if flt_read(file,A,nx=32/4,ny=61*4,atleast=8,error=error,_extra=_extra) then A = reform(A,32,61) end '.srf': begin message, /info, 'Assuming Stanford format: 292 lines with 7 or 8 numbers' if flt_read(file,A,nx=32/4,ny=73*4,atleast=7,error=error,_extra=_extra) then A = rotate( (reform(A,32,73))[2:30,*], 6) end '.yoh': begin if bin_read(file,A,/abytarr,error=error) then A = rotate(A,1) end else: status = flt_read(file,A,error=error,_extra=_extra) endcase if error eq '' then $ message, /info, 'Array A('+strjoin(strcompress(size(A,/dim),/rem), ',')+')' return, A & end