Skip to content

Add WCS SIP capabilities (distorsions) to platesolving

cec m requested to merge wcs_distorsions into master

Addresses point 3 of #1154 :

  • adds writing-up SIP coefficients to header (FITS and ASTRO-TIFF) if present in fit->wcslib structure (handle asnet polynomial solve)
  • adds platesolving with quadratic, cubic or quartic polynomials with Siril internal solver

An additional convergence loop is also added, whatever the order of the solution (linear, quadratic, cubic). This makes sure that the plate constants are extracted with the stars coordinates projected at the center of the image. Before this MR, this convergence loop was only executed when the starting point was not centered, i.e. using a selection. This provides a better accuracy of the solution: the center is effectively the fiducial point. Convergence is tested by checking that the constant terms of the solution are getting close to zero.

The internals have also been modified to avoid the deprojection/reprojection of the stars during the convergence loop, which could be very inaccurate close to the pole. Everytime we make a new step, we reset the projection of the star catalog, we project it to the new center, and we update in-place star_list_B x/y pos using the star indexes.

TODO:

  • compute the inverse polynomial coefficients using forward coeffs transformation on a grid
  • convert TRANS structure to wcslib->lin.dispre structure
  • add -order= option to platesolve related commands
  • add specifying order from the GUI
  • add disto command to display distorsions
  • check what needs to be done when applying a geometric transformation (compute update forward and reverse transform coeffs)
  • add header write-up for ASTRO-TIFF (Warning: text header parsing with wcspih needs comment to be present in each card, otherwise it fails)
  • detect asnet has failed to return distorted solution
  • rewrite trans structure and atpmatch.c to have consistent functions, irresp. of the order
  • check solving at poles
  • start with linear solution then increase the order (fallback on linear solution if higher order fails)
  • update documentation (https://siril--50.org.readthedocs.build/en/50/)
  • update Chagelog and NEWS

Checked validity of the inverse solution by showing annotations on a distorted image corner using DS9: image

Edited by cec m

Merge request reports