Positional Cross-Matching Functions

This script contains functions for positional cross-matching.

matching.matchfuncs.angdist(ra1, dec1, ra2, dec2)[source]

Returns the angular distance in arcsec between two points.

Parameters:
  • ra1 (float) – Right ascension of the first source (degrees).
  • dec1 (float) – Declination of the first source (degrees).
  • ra2 (float) – Right ascension of the second source (degrees).
  • dec2 (float) – Declination of the second source (degrees).
Returns:

sep – The separation between the two points on the sky (arcseconds).

Return type:

float

matching.matchfuncs.cosd(angle)[source]

Returns the cosine of an angle given in degrees.

matching.matchfuncs.quickcheck(dec1, dec2, deglim)[source]

Calculates the angular distance in degrees between the declinations of two points and sets the flag to True if less than the specified maximum separation limit in degrees.

Parameters:
  • dec1 (float) – Declination of the first source (degrees).
  • dec2 (float) – Declination of the second source (degrees).
  • deglim (float) – Maximum allowed separation between the two source’s declinations (degrees).
Returns:

flag – Returns True if the separation in declinations is less than the maximum allowed limit. Otherwise, returns False.

Return type:

bool

matching.matchfuncs.simple_match(src, match_srcs, beam)[source]

Finds the catalog source closest to the given VLITE source and flags them as a successful match if their angular separation is within half the VLITE image’s beam size.

Parameters:
  • src (database.dbclasses.DetectedSource instance) – VLITE DetectedSource object to be matched.
  • match_srcs (list) – List of either DetectedSource or CatalogSource objects which are candidates for matching to the given source.
  • beam (float) – Semi-major or semi-minor axis of the image clean beam in arcseconds.
Returns:

  • match (bool) – Returns True if a match was successful for the given source.
  • match_src (object) – Returns the DetectedSource or CatalogSource object which was successfully matched to the given source. Otherwise, returns None.
  • min_sep (float) – The angular separation between the VLITE source and its nearest neighbor (arcsec).