RelNavEstimator¶
giant.relative_opnav.estimators.estimator_interface_abc
:
- class giant.relative_opnav.estimators.estimator_interface_abc.RelNavEstimator(scene, camera, image_processing, **kwargs)[source]¶
This is the abstract base class for all RelNav techniques in GIANT that work with the
RelativeOpNav
user interface.A RelNav technique in GIANT is something that extracts observables of targets from an image. Usually these targets are planetary or natural bodies, not stars or man-made objects (though it is possible to have a man made object be a target). There are different variations on what exactly is extracted from the image, but most boil down into either a bearing measurement (the pixel location of the target in the image), a relative position measurement (the vector from the camera to the target in the camera frame), or a constraint measurement (paired bearing measurements of the same target in different images).
This class serves as a prototype for implementing a new RelNav technique in GIANT. It defines an abstract method,
estimate()
which is the primary interface GIANT will use to apply the technique to extract observables from an image. It also defines some class methods that should be overridden by subclass, includingtechnique
,observable_type
,relnav_handler
, andgenerates_templates
which determine how theRelativeOpNav
class interacts with the new technique. Finally, it defines some instance attributes,image_processing
,scene
,camera:
,computed_bearings
,observed_bearings
,computed_positions
,observed_positions
,templates
, anddetails
which should be used for retrieving/storing information during the fit. This class also defines a concrete method,reset()
, which is used by theRelativeOpNav
class to prepare the instance of the technique for a new image/target pair.For more details on defining/registering a new technique using this class as a template/super class, see the
estimators
documentation.Note
Because this is an ABC, you cannot create an instance of this class.
- Parameters
scene (giant.ray_tracer.scene.Scene) – The
Scene
object containing the target, light, and obscuring objects.camera (giant.camera.Camera) – The
Camera
object containing the camera model and images to be utilizedimage_processing (giant.image_processing.ImageProcessing) – The
ImageProcessing
object to be used to process the imageskwargs – Extra arguments that the technique may need for settings/other things. These aren’t actually used by this class, but are included so that the type checker doesn’t get mad and so you know you can do it.
- technique: Optional[str] = None¶
The name for the technique for registering with
RelativeOpNav
.If None then the name will default to the name of the module where the class is defined.
This should typically be all lowercase and should not include any spaces or special characters except for
_
as it will be used to make attribute/method names. (That isMyEstimator.technique.isidentifier()
should evaluateTrue
).
- observable_type: Optional[Union[List[Union[giant.relative_opnav.estimators.estimator_interface_abc.RelNavObservablesType, str]], giant.relative_opnav.estimators.estimator_interface_abc.RelNavObservablesType, str]] = None¶
The types of observables that are generated by this technique.
This should be a list of
RelNavObservablesType
enum values that specify what type(s) of observables this technique generates. It can also beNone
in which case the default type ofRelNavObservablesType.CENTER_FINDING
will be assumed, or it can be a single string orRelNavObservable
value if only one type is assumed.If this is
RelNavObservablesType.CUSTOM
, then that can be the only type, and you must also define a class attributerelnav_handler
which is a function where the first and only positional argument is theRelativeOpNav
instance that this technique was registered to and there are 2 key word argumentsimage_ind
andinclude_targets
which should be used to control which image/target is processed.
- relnav_handler: Optional[Callable] = None¶
A custom handler for doing estimation/packaging the results into the
RelativeOpNav
instance.Typically this should be
None
, unless theobservable_type
is set toRelNavObservablesType.CUSTOM
, in which case this must be a function where the first and only positional argument is theRelativeOpNav
instance that this technique was registered to and there are 2 key word argumentsimage_ind
andinclude_targets
which should be used to control which image/target is processed.If
observable_type
is notRelNavObservablesType.CUSTOM
then this is ignored whether it isNone
or not.
- generates_templates: bool = False¶
A flag specifying whether this RelNav estimator generates and stores templates in the
templates
attribute.
- property scene: giant.ray_tracer.scene.Scene¶
The scene which defines the a priori locations of all targets and light sources with respect to the camera.
You can assume that the scene has been updated for the appropriate image time inside of the class.
Summary of Methods
This method should apply the technique to a specified image for all targets specified in |
|
This method resets the observed/computed attributes as well as the details attribute to have |
|
This method returns a generator which yields target_index, target pairs that are to be processed based on the input |