What changes were made to the PSF beam fitting algorithm in CASA 6?

Authors list

Prior to 6.2/5.8, CASA used a fixed size region to fit a Gaussian beam to the PSF.  This resulted in unstable behavior in two scenarios:

1. When there were high numbers (>9) of pixels per beam (ppb)

2. When the inherent PSF shape is non-Gaussian (common for combined data across array configurations). Essentially, only the core of the PSF would be fit, which would result in a smaller beam than when the image was created with a lower number of ppb.

Additionally, very low numbers (<5) of ppb resulted in unstable fits to the PSF.  Although the beam was Nyquist sampled, the discrete threshold (0.35) applied to the windowed region would result in discrete changes to the number of pixels included in the fit, making the fit unstable as number of ppb were changed.

To alleviate both of these behaviors, a new PSF fitting algorithm was created, and is included in CASA 5.8/6.2+.

Previous Beam Fitting Algorithm:
1.  A region of 9 x 9 pixels around the peak of the PSF is compared against the psfcutoff (0.35), sidelobes are masked.
2.  All the non-sidelobe points that are above the psfcutoff are used to fit a Gaussian.
3.  If the fitting fails steps 1 and 2 are repeated with the psfcutoff decreased (psfcutoff=psfcutoff/1.5). This will be done up to 50 times if fitting fails.

New Beam Fitting Algorithm:
1. A region of 41 x 41 pixels around the peak of the PSF is compared against the psfcutoff (0.35), sidelobes are masked.
2. Calculate the bottom left corner (blc) and top right corner (trc) from the points. Expand blc and trc with a number of pixels (5).
3. Create a new sub-matrix from blc and trc.
4. Interpolate matrix to a target number of points (3001) using CUBIC spline.
5. All the non-sidelobe points, in the interpolated matrix, that are above the psfcutoff(0.35) are used to fit a Gaussian.
6. If the fitting fails steps 1 to 5 are repeated with the psfcutoff decreased (psfcutoff=psfcutoff/1.5). This will be done up to 50 times if fitting fails.

To improve the fit for low (< 5) ppb (pixels per beam) the expand pixel step (2) and interpolation step (4) are required.
To improve the fit for high (> 9) ppb (pixels per beam) the larger search area in step (1) is required.

The parameter psfcutoff is added to tclean and has a default value of 0.35 (it can be varied from 0.01 to 0.99). If a user needs to recover the previous fitting behavior to match an archival image, this can be roughly accomplished by tuning the psfcutoff parameter.  The user should look at the inner 9x9 pixels of the PSF, and set the psfcutoff to the pixel value of the outer pixels in this region (to artificially restrict the region to something similar to what CASA would have used with the previous algorithm). It should be noted that if the PSF is non-Gaussian, it is critical that the user applies a correction to the image, similar to that described in Jorsater & van Moorsel (1995). Otherwise, fluxes in residuals will be incorrect. This is true for both the old and new PSF fitting algorithms, but particularly so for the old algorithm, as it tended to only fit the core of the non-Gaussian dirty beam.