function norh_beam,index,marx=marx,xbeam=xbeam


if n_elements(marx) le 0 then marx=21

solp=get_rb0p(index,/pangle)
pmat=norh_gt_pmat(index)

sec_per_pix=norh_gt_pixsz(index)
sec_per_pix_dty=norh_gt_pixsd(index)
ratio_c2d=sec_per_pix/sec_per_pix_dty
rbeam=norh_gt_efl(index)

ns2ew=norh_gt_ns2ew(index)
delta=1./rbeam^2


mx=n_elements(index)

beam=fltarr(marx, marx, mx)

ii=(-marx/2+lindgen(marx))#replicate(1, marx)
jj=replicate(1, marx)#transpose(-marx/2+lindgen(marx))

for m=0, mx-1 do begin

  x=(cos(solp(m))*ii -sin(solp(m))*jj)*ratio_c2d(m)
  y=(sin(solp(m))*ii +cos(solp(m))*jj)*ratio_c2d(m)

  xx= pmat(0,m)*x+pmat(2,m)*y
  yy=(pmat(1,m)*x+pmat(3,m)*y)*ns2ew(m)

  beam(*,*,m)=exp(-delta(m)*(xx^2+yy^2))

endfor

xbeam=sec_per_pix*findgen(marx)

return,beam

end