Skip to content

WCS_AutoSolver

user29A edited this page Jul 6, 2022 · 14 revisions

Overview

WCS_AutoSolver is based upon the trigonometric algorithm as described here: https://iopscience.iop.org/article/10.1088/1538-3873/ab7ee8

The solver automatically determines corresponding points in a an image and a catalogue, such that a World Coordinate Solution may then be computed for the image. Unlike other popular automated WCS solvers which take ages to run and fail all the time, WCS_AutoSolver will automatically solve your image WCS in a few milliseconds.

The solver algorithm is also implemented in Python, although it is single-threaded there:

https://github.com/user29A/fastrometry/wiki

Constructors

public WCSAutoSolver(string WCS_type, int Number_of_Points, JPFITS.FITSImage Fits_Img, bool[,] Image_ROI, double Image_Saturation, bool auto_background, int PSE_kernel_radius, int PSE_separation_radius, string Fits_Catalogue_BinTable_File, string Catalogue_Extension_Name, string Catalogue_CVAL1_Name, string Catalogue_CVAL2_Name, string Catalogue_Magnitude_Name, bool Refine) Initializes the WCS_AutoSolver class including performing source extraction on a given FITS image.

  • WCS_type The WCS transformation type. Solution only uses TAN at this time.
  • Number_of_Points The number of points N to use to compare image coordinates to catalogue coordinates. Suggest N equals 25 for good correspondence, N equals 50 for poor, N equals 100 for very poor.
  • Fits_Img The JPFITS.FITSImage containing the primary image data.
  • Image_ROI The region of interest of the FITS image to search for point sources, of identical size to the FITS image. Pass null or all true for entire image.
  • Image_Saturation The saturation level of the source image for mapping saturated sources. Pass zero if no saturated sources exist.
  • auto_background Automatically determine local background for each centroiding kernel.
  • PSE_kernel_radius The radius of the point-source-extraction kernel, in pixels, greater than or equal to 1.
  • PSE_separation_radius The minimum separation of point sources, in pixels, greater than or equal to PSE_kernel_radius.
  • Fits_Catalogue_BinTable_File The full path file name of the FITS binary table containing the catalogue data. The catalogue file must correspond to the area of sky in the image. Use AstroQuery to gather the appropriate catalogue file automatically.
  • Catalogue_Extension_Name The extension name of the FITS binary table which contains the catalogue data. If empty string is passed then the first binary table extension is assumed.
  • Catalogue_CVAL1_Name The name of the entry inside the binary table which lists the CVAL1 (i.e. right ascension) coordinates.
  • Catalogue_CVAL2_Name The name of the entry inside the binary table which lists the CVAL2 (i.e. declination) coordinates.
  • Catalogue_Magnitude_Name The name of the entry inside the binary table which lists the source magnitudes.
  • Refine Option to automatically refine the solution further with additional points after the initial solution is found.

public WCSAutoSolver(string WCS_type, JPMath.PointD[] pixels, bool zero_based_pixels, int pixels_tolerance_radius, int image_width, int image_height, JPMath.PointD[] wcspoints) Initializes the WCS_AutoSolver class for an existing pair of pixel source and catalogue coordinates.

  • WCS_type The WCS transformation type. Solution only uses TAN at this time.
  • pixels The source pixel positions in computer graphics coordinate orientation, i.e., origin top left of image.
  • zero_based_pixels If the source pixel positions are zero-based.
  • pixels_tolerance_radius The tolerance of the source positions, identical to usage as the PSE_kernel_radius in the other constructor. Typically 2 (pixels).
  • image_width The 1-based width of the source image from where the source pixels points originate.
  • image_height The 1-based height of the source image from where the source pixels points originate.
  • wcspoints The catalogue sky coordinate values, in degrees, corresponding to the region in the image of the source pixel positions.

Properties

WorldCoordinateSolution WCS_Solution Returns the World Coordinate Solution

PointSourceExtractor PSE_Extraction Returns the most recent Point Source Extraction

string Status_Log Gets or Sets the Status Log

bool Cancelled Gets or Sets the Cancel State of the Solver

bool Solving Gets the Solving State of the Solver

bool Solved Gets the Solution State of the Solver

int Progress Gets Progress percentage of the Solver

bool Solver_Parallelized Gets or Sets the Solver to run parallelized (default is true)

Methods

void SolveAsync(double scale_init, double scale_lb, double scale_ub, double rotation_init, double rotation_lb, double rotation_ub, double vertex_tolerance, int N_matches_stop, int Percentage_matches_stop, bool condition_arrays, bool show_report_form) Intitates the auto-solver algorithm asynchronously.

  • scale_init The initial scale guess, in arcseconds per pixel.
  • scale_lb The lower bound of the scale range, in arcseconds per pixel.
  • scale_ub The upper bound of the scale range, in arcseconds per pixel.
  • rotation_init The initial field rotation guess, in degrees.
  • rotation_lb The lower bound of the field rotation range, in degrees, greater than or equal to -180
  • rotation_ub The upper bound of the field rotation range, in degrees, less than or equal to 180
  • vertex_tolerance The tolerance of the vertex angles when comparing triangles, in degrees. Suggest 0.25.
  • N_matches_stop Stop and solve solution when N matches are found between image and catalogue coordinates. N_matches_stop greater than or equal to 3. Suggest 6. Solution likely requires confirmation at 3 or 4.
  • Percentage_matches_stop Stop and solve solution when Percentage matches are found between image and catalogue coordinates. Suggest 25.
  • condition_arrays Optionally condition the triangle arrays. Suggest true.
  • show_report_form Optionally shows a cancellable Form which displays the solution progress.

Static Methods

int AstroQuery(string catalogue, string ra_deg, string dec_deg, ref string result_savepathfilename, string radius, string square) Queries the Gaia catalogue for entries within a specified region. Returns 0 if the query was successful.

  • catalogue A string for the catalogue to query. Options are (case insensitive): "Gaia"
  • ra_deg A string of the right ascension in degrees.
  • dec_deg A string of the declination in degrees.
  • result_savepathfilename The filename to save the query catalogue. If saving is not required, pass an empty string.
  • radius A string of the region radius in arcminutes.
  • square Pass 1 if the region is square, 0 for circle.
Clone this wiki locally