%N pbcorr %F $MIR/src/scripts/pbcorr.clone
%D Apply primary beam correction
%P bpw
%: utility
%B
Apply primary beam correction to a dataset.
Can also apply inverse correction, or create a primary-beam map.
%A in
input dataset [no default]
%A out
output dataset [no default] 
%A pbfwhm
fwhm of primary beam [read from header]
%A inv
if t, divide by primary beam [f]
%A maxcorr
maximum allowed correction [6]
%A sd
three values: fwhm and center of a gaussian to multiply result with;
simulating single-dish
%A xy
relative pixel center of primary beam [0,0]
%A options
if 'multiply', multiply input with primary beam or inverse
if 'pattern',  output is the primary beam patter
if 'print',    print correction at position xy
[multiply]
%A verbose
if t, show individual commands [f]
