estimator_interface_abc

This module defines the abstract base class (abc) for defining Relative OpNav techniques that will work with the RelativeOpNav class.

This abc provides a design guide/requirement for building a new RelNav technique that can be easily registered with the RelativeOpNav class. In general, when you define a new RelNav technique, you should subclass this abc (a) to ensure you implement all of the required methods and instance/class attributes, but also to get some of the concrete implementations that this class provides which are generally applicable.

You should only worry about this abc when you are defining a new technique. If you are using an existing technique, like cross_correlation, ellipse_matching, limb_matching, moment_algorithm, or unresolved then you can ignore this class exists and just read the documentation for those techniques.

Use

To implement a fully functional RelNav technique, you must implement the following class attributes.

Class Attribute

Description

technique

A string that gives the name to the technique. This should be an “identifier”, which means it should be only letters/numbers and the underscore character, and should not start with a number. This will be used in registering the class to define the property that points to the instance of this technique, as well as the {technique}_estimate method and {technique}_details attribute.

observable_type

A list of RelNavObservablesType values that specify what types of observables are generated by the new technique. This controls how the results from the new technique are retrieved and stored by the RelativeOpNav technique.

generates_templates

A boolean flag specifying whether this technique generates templates and stores them in the templates attribute. If this is True, then RelativeOpNav may store the templates for further investigation by copying the templates attribute.

You also should typically implement the following instance attributes:

Instance Attribute

Description

image_processing

The instance of the image processing class to use when working with the images.

scene

The instance of the Scene class that defines the a priori knowledge of the location/orientation of the targets in the camera frame. When you are using your custom class with the RelativeOpNav class and a Scene class then you can assume that the scene is appropriately set up for each image.

camera

The instance of the Camera class which contains the camera model as well as other images.

computed_bearings

The attribute in which to store computed (predicted) bearing measurements as (x, y) in pixels. This is a list the length of the number of targets in the scene, and when a target is processed, it should put the bearing measurements into the appropriate index. For center finding type measurements, these will be single (x,y) pairs. For landmark/limb type measurements, these will be an nx2 array of (x,y) pairs for each landmark or feature

observed_bearings

The attribute in which to store observed bearing measurements as (x, y) in pixels. This is a list the length of the number of targets in the scene, and when a target is processed, it should put the bearing measurements into the appropriate index. For center finding type measurements, these will be single (x,y) pairs. For landmark/limb type measurements, these will be an nx2 array of (x,y) pairs for each landmark or feature

computed_positions

The attribute in which to store computed (predicted) positions measurements as (x, y, z) in kilometers in the camera frame. This is a list the length of the number of targets in the scene, and when a target is processed, it should put the predicted position into the appropriate index.

observed_positions

The attribute in which to store observed (measured) positions measurements as (x, y, z) in kilometers in the camera frame. This is a list the length of the number of targets in the scene, and when a target is processed, it should put the measured position into the appropriate index.

templates

The attribute in which templates should be stored for each target if templates are used for the technique. This is a list the length of the number of targets in the scene, and when a target is processed, it should have the template(s) generated for that target stored in the appropriate element. For center finding type techniques the templates are 2D numpy arrays. For landmark type techniques the templates are usually lists of 2D numpy arrays, where each list element corresponds to the template for the corresponding landmark.

details

This attribute can be used to store extra information about what happened when the technique was applied. This should be a list the length of the number of targets in the scene, and when a target is processed, the details should be saved to the appropriate element in the list. Usually each element takes the form of a dictionary and contains things like the uncertainty of the measured value (if known), the correlation score (if correlation was used) or other pieces of information that are necessarily directly needed, but which may given context to a user or another program. Because this is freeform, for the most part GIANT will just copy this list where it belongs and will not actually inspect the contents. To use the contents you will either need to inspect them yourself or will need to write custom code for them.

Finally, we must implement the following method

Method

Description

estimate()

This method should use the defined technique to extract observables from the image, depending on the type of the observables generated. This is also where the computed (predicted) observables should be generated and stored, as well as fleshing out the details and the templates lists if applicable. This method should be capable of applying the technique to all targets in the scene, or to a specifically requested target.

If you implement a class that contains all of these things then you will have successfully defined a new RelNav technique that can be registered with the RelativeOpNav class. Whether that technique actually works or not is up to you however.

For more details on defining/registering a new technique, as well as an example, refer to the estimators documentation.

Classes

RelNavEstimator

This is the abstract base class for all RelNav techniques in GIANT that work with the RelativeOpNav user interface.

RelNavObservablesType

This enumeration provides options for the basic types of observables generated in Relative OpNav.