;pro get_echelle_bands, density, blazeangle, detector_angle, order_range pro get_echelle_grating, density_mm, blazeangle_deg, theta_deg, wl_ang, order, alpha_deg, brightness ;+ ; ; Name: get_echelle_grating ; Purpose: ; Determine the parameters of an Echelle grating ; Calling Sequence: ; get_echelle_grating, density_mm, blazeangle_deg, theta_deg, wl_ang, order, alpha_deg, brightness ; ; Inputs: ; density_mm # of grooves per mm ; blazeangle_deg blaze angle ; theta_deg deflection angle (angle between incidence and reflection) ; wl_ang wavelength of light in Angstrom ; Outputs: ; order the order of peak brightness ; alpha_deg incidence angle ; brightness relative brightness ; ;- sigma_ang=1.d7/density_mm tmp = (2*sigma_ang*sin(blazeangle_deg*!dtor)/wl_ang) ordera=round(tmp)+[-2,-1,0,1,2] alpha_dega=fltarr(5) brightnessa=fltarr(5) for run=0, 4 do begin order=ordera[run] alpha =blazeangle_deg*!dtor for iter=0, 10 do begin f = (sin(alpha)+sin(alpha - theta_deg*!dtor))- order*wl_ang/sigma_ang df = (cos(alpha)+cos(alpha - theta_deg*!dtor)) alpha = alpha - f/df endfor alpha_deg=alpha/!dtor beta_deg = alpha_deg - theta_deg beta_bl_deg = 2*blazeangle_deg -alpha_deg wl_bl_ang = sigma_ang*(sin(alpha)+sin(beta_bl_deg*!dtor))/order b=sigma_ang*(cos(blazeangle_deg*!dtor)) X = !pi*b/wl_ang*(sin(alpha-blazeangle_deg*!dtor)+sin((beta_deg - blazeangle_deg)*!dtor)) if x eq 0. then brighteness = 1 else brightness = (sin(x)/x)^2 alpha_dega[run]=alpha_deg brightnessa[run]=brightness endfor r=(where(brightnessa eq max(brightnessa)))[0] ;r1=(r-1)>0 & r2=(r+1)<4 order=ordera[r] alpha_deg=alpha_dega[r] brightness=brightnessa[r] end density_mm=79.d & blazeangle_deg=63.43-2d line_id=['He I', 'H I', 'H I', 'He I', 'Ca II', 'Ca II', 'Ca II', 'Ca II','Ca II', $ 'Mg I', 'Mg I', $ 'Na I', 'Na I', 'Fe I', 'Fe I', 'Fe I', 'Fe I', 'Fe I', $ 'H I', 'H I', 'H I', 'H I', 'He I', 'He I', 'He I', 'He I'] wl_ang= [4471., 6562.8d, 4861.3d, 10830.d, 3933.d, 3963.d, 8498.06d, 8542.1d, 8662.17d, 5172.7d, 5183.6d, $ 5890.d, 5896.d, 5250.d, 5576.d, 6301.5d, 6302.5d, 15648.5d, $ 9546.d, 10938.d, 10049.d, 8203.6d, 5875.d0, 6678.d, 7065., 7281.d0 ] ; 6563.d nline = n_elements(line_id) order_a=intarr(nline) alpha_deg_a=fltarr(nline) bright_a=fltarr(nline) order_b=fltarr(nline) alpha_deg_b=fltarr(nline) bright_b=fltarr(nline) for k=0, n_elements(line_id)-1 do begin theta_deg=0.93 get_echelle_grating, density_mm, blazeangle_deg, theta_deg, wl_ang[k], order, alpha_deg, brightness order_a[k]=order alpha_deg_a[k]=alpha_deg bright_a[k]=brightness theta_deg=1.92 get_echelle_grating, density_mm, blazeangle_deg, theta_deg, wl_ang[k], order, alpha_deg, brightness order_b[k]=order alpha_deg_b[k]=alpha_deg bright_b[k]=brightness endfor s=sort(wl_ang) print, '\begin{tabular}{llcccccc} \hline ' print, ' \multicolumn{2}{c}{Optical config} & \multicolumn{3}{c}{$\alpha - \beta=0.93\arcdeg$} & ' print, ' \multicolumn{3}{c}{$\alpha - \beta=1.92\arcdeg$} \\ \hline' print,' \multicolumn{2}{c}{Line (\AA)} & $m$ & $\alpha - \phi$ & $B$ & $m$ & $\alpha - \phi$ & $B$ \\ \hline' for k=0, nline-1 do begin j=s[k] print, line_id[j]+ ' & '+ string(wl_ang[j], format='(f7.1)'), ' & ', string( order_a[j], format='(i4)'), ' & ', $ string( alpha_deg_a[j]-blazeangle_deg, format='(f7.2)'), ' & ', $ string( bright_a[j], format='(f5.2)'), ' & ', string( order_b[j], format='(i4)'), ' & ', $ string( alpha_deg_b[j]-blazeangle_deg, format='(f7.2)'), ' & ', $ string( bright_b[j], format='(f5.2)'), ' \\ ' endfor print, ' \hline \end{tabular}' end