;PRO jfit_tilt_compare ; ; Script to compare the efficiencies from John's code with ; brute force effic's calculated by the tilt_effic code ; (in labxray). ; 2/2/99 dd @labx_common @xrtf_common @jfit_common ; Pick an X-GEF grating test for the comparison parameters... ; (John's efficiencies are already available for these...) pspc_above_dir = '/nfs' pspc_directory = 'caliber/dc/981023' ; Pick a sub-directory... list them ;;SPAWN, 'ls '+pspc_above_dir+'/'+pspc_directory+'/*p0' ; Get the model parameters and efficiency values... ; They are put in variables in jfit_common jfit_read_model,'HF2503p0' jfit_read_effics,'HF2503p0' ; And set the grating period... ; dd@spectra[1374] more pspc_results.txt ; Mon Oct 26 11:36:24 1998 Created by pspc_analyze_fits V4.02 6/5/96 dd ; HF2503 params = 0.952300 53.0000 203.000 4767.30 1115.80 2002.57 lx_gp = 2002.57 ; Show the model shape ;;pre_print_sqr jfit_plot_shape ;;post_print ;;SPAWN, 'cp idl.ps jfit_plot_shape.ps' ; These two routines conveniently get the energy and an ; order's efficiency from jfit_calc_effics array .run jfit_get_energy .run jfit_get_order ; OK, get and plot the plus 1 order effic: es = jfit_get_energy() oz = jfit_get_order(0) op1 = jfit_get_order(1) ; To speed up the comparison, just use enough energies ; to keep 1% accuracy in interpolation... iespr = interp_pruned_x(es, [[oz],[op1]], 0.01) ; Show the effic.s and pruned points... !p.multi=0 plot_oi, es, op1, $ XRANGE=[0.4,12.], XSTYLE=1 oplot, es(iespr), op1(iespr), PSYM=4 ; Pick orders for comparison: ords = [1,2,3] ;;pre_print_portrait !p.multi=[0,1,3] io=1 ;;for io=0,n_elements(ords)-1 do begin ;------ start of loop ----- ord = ords(io) ; get its effic jeffic = jfit_get_order(ord) plot_oi, es, jeffic, $ XRANGE=[0.4,12.], XSTYLE=1, $ TITLE = 'Order = '+STRCOMPRESS(ord) oplot, es(iespr), jeffic(iespr), PSYM=4 ; Now, convert the jfit parameters to tilt_effic path array... ; set lx common values lx_gm = ord ; set tilt params jfit_to_tilt ; Plot the path length function... ;;plot, lx_gx, lx_gpath, XRANGE=[0.0, lx_gp], PSYM=2, XSTY=1, $ ;; XTITLE='Location (A)', YTITLE='X-Ray Path Length (A)', $ ;; TITLE = 'X-Ray Path Length at tilt ='+STRING(lx_gtilt, $ ;; FORMAT='(F6.2)')+' deg.s' ; and calculate and plot the tilt-model effics tes = es(iespr) ; include the amplitude factor too teffic = jfit_amp_factor*tilt_effic(tes) oplot, tes, teffic, PSYM=2 ;------ end of loop ----- ;;end ;;post_print ;;SPAWN, 'cp idl.ps jfit_tilt_compare.ps' ;;RETURN ;;END