### S. Rols added keyword /constant to conv_ins routine

parent bd9738fd
 FUNCTION conv_ins, w_in , pc, cutoff, intrange,W_FWHM=W_FWHM FUNCTION conv_ins, w_in , pc, cutoff, intrange,W_FWHM=W_FWHM,CONSTANT=CONSTANT ;+ ;******* ******** ;** User callable ... ... @@ -10,16 +10,19 @@ FUNCTION conv_ins, w_in , pc, cutoff, intrange,W_FWHM=W_FWHM ;** y=(1/w.sqrt(pi/2))exp(-2(x-x0)^2/w^2) ;** output spectrum in wavenumbers ;** ------------------------------------------------------ ;** call is w2=conv_ins(w1,0.05, 1.5, 3.0) ;** call is w2=conv_ins(w1,0.05, 1.5, 3.0, /constant) ;** w1 is workspace to be convoluted ;** 0.05 is width of Gaussian resolution, a % of energy transfer ;** 1.5 is a cutoff to prevent divergence at small E ;** intrange is to integrate over the whole Gaussian ;** /constant indicates that pc is not a percentage but a value of FWHM constant over the total range ;** W_FWHM is the workspace number where the evolution of the FWHM as a function of energy is stored (useful for TOF) ;- ; modified 20/8/2008 to loop through a 2d array, energy along x ; comment 7/10/2008 needs further modification to work on 1D arrays ; done 13/3/2009 ; Modified by SR 01/2016 to include /constant keyword and W_FWHM option take_datp, datp & w_out = w_in & w_temp1=w_in[*,0] & w_temp2=w_in[*,0] ... ... @@ -50,10 +53,14 @@ w_temp1=w_in[*,i_q] for i_orig=0,N-1 do begin ;define Gaussian, wd is width, pc is pcage of energy transfer, 1.17741 is sqrt(2ln2) ;0.79788 is pre-exp to give unit intensity, pc=0.02 read as parameter if (not i_fromwksp) then wd=e_i[i_orig]*pc/1.177410 else wd=w_fromwksp[i_orig]/1.177410 if (not i_fromwksp) then begin if (keyword_set(CONSTANT)) then wd=pc/1.177410 else wd=e_i[i_orig]*pc/1.177410 endif else wd=w_fromwksp[i_orig]/1.177410 if (wd LT w_cutoff) then begin wd=w_cutoff endif ;select range for intrangeation, intrange=3.0 read as parameter grange=intrange*wd/e_step & igrange=floor(grange) ;print, igrange ... ...
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!