FUNCTION tilt_effic, E ; Calculates the diffraction efficiency of the tilted grating ; at energy E into order lx_gm. ; Assumes tilt_path has been run filling lx_gx and lx_gpath with ; data. ; If E and lx_gm are the only values to change, tilt_effic can be ; rerun with out rerunning tilt_path. @labx_common eff_out = 1.0 * 0.0*E ; default if 99th order if lx_gm NE 99 then begin ; Go through the energies and calc the efficiency if(n_elements(E) EQ 1) then E = [E] ;make it an array for ie=0, n_elements(E)-1 do begin ; Complex field after grating k = 2.*!PI/(lx_akev/E(ie)) Egrat = EXP( lx_gpath*k*COMPLEX(-gold_beta(E(ie)), gold_delta(E(ie))) ) etotheim = EXP(COMPLEX(0.,lx_gm*2.*!PI*lx_gx/lx_gp)) dot_prod = TOTAL(Egrat * etotheim)/N_ELEMENTS(lx_gx) eff_out(ie) = ABS(dot_prod * conj(dot_prod)) end ; energies ; Correct for polyimide and platingbase ; Poly thickness less than 0 indicates no polyimide or plating base if(lx_gpoly GT 0.) then begin eff_out = eff_out * polyimide(E) * platingbase(E) end end ; end of checking for 99th order RETURN, eff_out END