; con_width_funct.pro Corrects SUMER Line Widths for Slit Effects ; Klaus Wilhelm 18 January 1997 ; Rev. 1 Expanded explanation 12 March 1997 ;------------------------------------------------------------------------------- ; What to do? ; Before you can apply this function, you have to run the procedure con_width ; (see con_width.pro) with the slit numbers you want to work with. This builds ; up look-up tables for the de-convolution. ; Apply function: ; IDL> width = con_width_funct(slit,fwhm_out[,/keyword] ; Gives Doppler or FWHM width of input (line width and instrumental effects ; without slit) for FWHM output of detector A. FWHM_out can be a vector. ; The narrowest line yet observed had a Doppler width of about 57 mÅ ; (or a FWHM of about 95 mÅ), which is probably close to the instrumental ; width) ;------------------------------------------------------------------------------- function con_width_funct, slit, fwhm_out,FWHM=FWHM ; slit number : 1, 2, 4, or 7 ; fwhm_out: Detector output (input to function!) in mÅ; works for vectors. ; width (Default) : Delta lambda Doppler input in mÅ ; or (keyword /FWHM) : FWHM input in mÅ restore,'con_fwhm_d_lam'+strtrim(fix(slit),2)+'.rst' if keyword_set(FWHM) then width_in=fwhm_in else width_in=d_lam_d_in result=fwhm_out*0.0 width=fwhm_out*0.0 InRange = where((fwhm_out ge min(fwhm_out_c)) and $ (fwhm_out le max(fwhm_out_c)), cIn) OutRange =where((fwhm_out lt min(fwhm_out_c)) or $ ( fwhm_out gt max(fwhm_out_c)), cOut) if cIn eq 0 then message,'FWHM must be between '+$ strtrim(min(fwhm_out_c),2)+' and '+strtrim(max(fwhm_out_c),2) +'mÅ' If cOut gt 0 then message,/info,$ 'Some of the widths entered are outside the limits '+$ strtrim(min(fwhm_out_c),2)+' and '+strtrim(max(fwhm_out_c),2) +'mÅ. '+$ 'These values will be returned as -1.' result(InRange) = interpol(width_in,fwhm_out_c,fwhm_out(InRange)) NonZero = where(result ne 0,cNZ) if cNZ gt 0 then width(NonZero)=result(NonZero) $ else print,$ 'You are outside the available FWHM range.' if cOut ne 0 then result(OutRange) = -1 return,width end