LEDFitter
- class ctapointing.imagesolver.LEDFitter(**kwargs: Any)
Bases:
ComponentLED fitting class.
TODO: If we can really base this on a cicle fit, consider using the method proposed in https://link.springer.com/content/pdf/10.1007/s10851-010-0249-8.pdf
Attributes Summary
fit distance goal
list of parameters fixed during fitting
maximum distance between spot and predicted LED position (in pixels
name of LEDFitter
UUID of LEDFitter
Methods Summary
circlefit(spotlist)Fit a circle to all coordinates of the spotlist.
construct_leds_on_circle(radius, position_angles)Construct LED position coordinates in the CTA CameraFrame (i.e. x points down, y points left when viewed from the dish).
from_config(**kwargs)Read a LEDFitter configuration from either configuration file or database.
process(spotlist, exposure, science_camera)Fit a list of spots to science camera LEDs to find the transformation between pointing camera pixel coordinates and science camera coordinates.
Attributes Documentation
- distance_goal
fit distance goal
- fixed_parameters
list of parameters fixed during fitting
- matching_distance
maximum distance between spot and predicted LED position (in pixels
- name
name of LEDFitter
- uuid
UUID of LEDFitter
Methods Documentation
- static circlefit(spotlist)
Fit a circle to all coordinates of the spotlist.
- static construct_leds_on_circle(radius, position_angles, centre=None)
Construct LED position coordinates in the CTA CameraFrame (i.e. x points down, y points left when viewed from the dish)
radius: circle radius position_angles: list of position angles
returns: array of coordinates
- classmethod from_config(**kwargs)
Read a LEDFitter 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 LEDExtractor (as in LEDFitter.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 PointingCamera.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:
LEDFitter object or None
- process(spotlist, exposure, science_camera, image_solution=None)
Fit a list of spots to science camera LEDs to find the transformation between pointing camera pixel coordinates and science camera coordinates.
- Parameters:
spotlist (ctapointing.imagesolver.SpotList) – spotlist of extracted LED spots
exposure (Exposure) – exposure object, holding information about the actual exposure (camera properties etc.)
science_camera (ctapointing.camera.ScienceCamera) – science camera object, storing the geometric properties of the science camera (LED positions etc.)
image_solution (ctapointing.imagesolver.ImageSolution) – image solution object that is updated with fit results. If None, a new object is created.
- Returns:
solution (ImageSolution) – ImageSolution object containing summary information on the result
m (iminuit.minuit) – minuit object for the sky -> pixels fit
m_inv (iminuit.minuit) – minuit object for the pixel -> intermediate pixel coordinates fit
- static circlefit(spotlist)
Fit a circle to all coordinates of the spotlist.
- static construct_leds_on_circle(radius, position_angles, centre=None)
Construct LED position coordinates in the CTA CameraFrame (i.e. x points down, y points left when viewed from the dish)
radius: circle radius position_angles: list of position angles
returns: array of coordinates
- distance_goal
fit distance goal
- fixed_parameters
list of parameters fixed during fitting
- classmethod from_config(**kwargs)
Read a LEDFitter 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 LEDExtractor (as in LEDFitter.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 PointingCamera.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:
LEDFitter object or None
- matching_distance
maximum distance between spot and predicted LED position (in pixels
- name
name of LEDFitter
- process(spotlist, exposure, science_camera, image_solution=None)
Fit a list of spots to science camera LEDs to find the transformation between pointing camera pixel coordinates and science camera coordinates.
- Parameters:
spotlist (ctapointing.imagesolver.SpotList) – spotlist of extracted LED spots
exposure (Exposure) – exposure object, holding information about the actual exposure (camera properties etc.)
science_camera (ctapointing.camera.ScienceCamera) – science camera object, storing the geometric properties of the science camera (LED positions etc.)
image_solution (ctapointing.imagesolver.ImageSolution) – image solution object that is updated with fit results. If None, a new object is created.
- Returns:
solution (ImageSolution) – ImageSolution object containing summary information on the result
m (iminuit.minuit) – minuit object for the sky -> pixels fit
m_inv (iminuit.minuit) – minuit object for the pixel -> intermediate pixel coordinates fit
- uuid
UUID of LEDFitter