Merge pull request #916 in CASA/casa from feature/CAS-9108 to master
* commit 'f5cba58ac18b1379ed2d4654a77490cfdc6e93dd':
A few small fixes in polarimetry: (1) In Xfparang+QU, add per-field spw-average Stokes result to the output record/dictionary, and (2) In PosAng, fix the sign of the correction for the circular basis.
Some refinements to polfromgain task, to make it more efficient.
In PosAngJones::solveOne, fixed calculation of position angle offset so it works correctly near +/-90 deg.
Deploy PosAngJones calibration, via poltype='PosAng' in polcal. This is position angle calibration cast as a rotation angle (cf cross-hand phase for circular basis) and includes new support for the linear basis.
Introduce polfromgain task that derives calibrator linear polarization from linear basis X/Y gain ratios. Currently, a refined (all python) version of almapolhelpers.qufromgain which should be more robust to uneven flagging over antennas.
Further improvements for Xfparang+QU solving: (1) Refined model division mechanism so as to be basis-agnostic and still correct for prior T calibration before averaging (i.e., divide by Stokes I model, not per-correlation); (2) Improved internal Record transmission of solved fractional Stokes information, and introduced polcal return value containing it (as dictionary); (3) Refined various log messages; (4) Added VisEquation::diffModelStokes for eventual support of full polarization geometry compensation, including TEC (not yet deployed, though)
Added: (1) Circular basis parang-dep cross-hand phase and Q,U solves, (2) SDBList::extendBaselineFlags() to make baseline flagging uniform over SDBs to minimize distortions in the cross-hand phase and QU solves, (3) Expose poltype='Xfparang_QU' in polcal, (4) Related changes to supporting classes and tXJones_GT.cc
In SolveDataBuffer handle non-availability of corrType info in case of non-MS-attached tests.
Added: (1) Auto cross-hand phase ambiguity resolution for linear-basis Xfparang solver, (2) Initial polarization basis-sensitive clauses to Xfparang solver (actual circ basis implementation still pending), (3) Fixed typeName() output for Xfparang. Related adjustments to test/tXJones_GT.cc
Add SolveDataBuffer::polBasis() and SDBList::polBasis() functions to support basis-sensitivity in solvers.
Introduce Xparang and Xfparang classes, currently same implementations as GlinXph; will differentiate them in basis-agnostic way next.
Isolate XJones and related classes into own XJones.h file (from DJones), and associated tests.