ImageSolver

class ctapointing.imagesolver.ImageSolver(**kwargs: Any)

Bases: Component

ImageSolver class.

Hosts algorithms to solve a given image, i.e. determine the position of each individual pixel in sky (RADec) coordinates. Needs a reasonably well-known pointing position for the image. On the basis of this pointing, catalog stars are selected and matched with image spots using quad matching. The matching algorithm of the astroalign package is used.

Attributes Summary

matching_distance

maximum distance for quad matching in L2/L1 L0/L1 plane

matching_radius

distance in pixels within which a star is matched to a spot in the field matching

max_magnitude

maximum magnitude of stars for catalog search

max_num_spots

maximum number of image spots used for matching

max_num_stars

maximum number of stars used for matching

max_pointing_deviation

assumed maximum angular deviation (in degrees) between true and nominalpointing position and/or pointing camera optical axisand true telescope pointing

min_camera_shadow

assumed minimum FoV side length (in degrees) blocked by an(assumed square) science camera in the inner part of the image

min_magnitude

minimum magnitude of stars for catalog search

name

name of ImageSolver

scale_tolerance

allowed deviation in true vs.

uuid

UUID of ImageSolver

Methods Summary

from_config(**kwargs)

Read an ImageSolver configuration from either configuration file or database.

process(spotlist, exposure[, ...])

Solve the image given an exposure object.

Attributes Documentation

matching_distance

maximum distance for quad matching in L2/L1 L0/L1 plane

matching_radius

distance in pixels within which a star is matched to a spot in the field matching

max_magnitude

maximum magnitude of stars for catalog search

max_num_spots

maximum number of image spots used for matching

max_num_stars

maximum number of stars used for matching

max_pointing_deviation

assumed maximum angular deviation (in degrees) between true and nominalpointing position and/or pointing camera optical axisand true telescope pointing

min_camera_shadow

assumed minimum FoV side length (in degrees) blocked by an(assumed square) science camera in the inner part of the image

min_magnitude

minimum magnitude of stars for catalog search

name

name of ImageSolver

scale_tolerance

allowed deviation in true vs. nominal focal length of camera

uuid

UUID of ImageSolver

Methods Documentation

classmethod from_config(**kwargs)

Read an ImageSolver configuration from either configuration file or database. Either the path of a configuration file (‘input_url’) or a database collection (‘collection’) must be provided.

Parameters:
  • input_url (str or Path) – path of the configuration file.

  • name (str) – name of the ImageSolver (as in ImageSolver.name). When loading the configuration from file, can be set to check that the configuration with the correct name is loaded. When loading from database, is used to identify the correct database record.

  • uuid (str) – UUID of the camera (as in ImageSolver.uuid). When loading the configuration from file, can be set to check that the configuration with the correct UUID is loaded. When loading from database, is used to identify the correct database record.

  • collection (str) – name of the database collection from which configuration is read

  • database (str) – name of the database in which the collection is stored

Returns:

extractor

Return type:

SpotExtractor object

process(spotlist, exposure, estimated_pointing=None, fov_radius=None, image_solution=None)

Solve the image given an exposure object.

Parameters:
  • spotlist (SpotList) – List of pixel coordinates of extracted spots

  • exposure (Exposure) – Exposure object. Should be removed at some point.

  • estimated_pointing (SkyCoord[RADec]) – guess of the optical axis pointing of the telescope. If None, try exposure.nominal_telescope_pointing

  • fov_radius (Angle or None) – radius of the field of view (for star matching) If set to None, estimated FoV from camera parameters

  • image_solution (ctapointing.imagesolver.ImageSolution) – object that is to be updated by the results of the image solving process. If None, new ImageSolution object is created and returned by this method.

Return type:

Tuple of Registration object and best-match Quad object

classmethod from_config(**kwargs)

Read an ImageSolver configuration from either configuration file or database. Either the path of a configuration file (‘input_url’) or a database collection (‘collection’) must be provided.

Parameters:
  • input_url (str or Path) – path of the configuration file.

  • name (str) – name of the ImageSolver (as in ImageSolver.name). When loading the configuration from file, can be set to check that the configuration with the correct name is loaded. When loading from database, is used to identify the correct database record.

  • uuid (str) – UUID of the camera (as in ImageSolver.uuid). When loading the configuration from file, can be set to check that the configuration with the correct UUID is loaded. When loading from database, is used to identify the correct database record.

  • collection (str) – name of the database collection from which configuration is read

  • database (str) – name of the database in which the collection is stored

Returns:

extractor

Return type:

SpotExtractor object

matching_distance

maximum distance for quad matching in L2/L1 L0/L1 plane

matching_radius

distance in pixels within which a star is matched to a spot in the field matching

max_magnitude

maximum magnitude of stars for catalog search

max_num_spots

maximum number of image spots used for matching

max_num_stars

maximum number of stars used for matching

max_pointing_deviation

assumed maximum angular deviation (in degrees) between true and nominalpointing position and/or pointing camera optical axisand true telescope pointing

min_camera_shadow

assumed minimum FoV side length (in degrees) blocked by an(assumed square) science camera in the inner part of the image

min_magnitude

minimum magnitude of stars for catalog search

name

name of ImageSolver

process(spotlist, exposure, estimated_pointing=None, fov_radius=None, image_solution=None)

Solve the image given an exposure object.

Parameters:
  • spotlist (SpotList) – List of pixel coordinates of extracted spots

  • exposure (Exposure) – Exposure object. Should be removed at some point.

  • estimated_pointing (SkyCoord[RADec]) – guess of the optical axis pointing of the telescope. If None, try exposure.nominal_telescope_pointing

  • fov_radius (Angle or None) – radius of the field of view (for star matching) If set to None, estimated FoV from camera parameters

  • image_solution (ctapointing.imagesolver.ImageSolution) – object that is to be updated by the results of the image solving process. If None, new ImageSolution object is created and returned by this method.

Return type:

Tuple of Registration object and best-match Quad object

scale_tolerance

allowed deviation in true vs. nominal focal length of camera

uuid

UUID of ImageSolver