PhaseCorrector

giant.relative_opnav.estimators.unresolved:

class giant.relative_opnav.estimators.unresolved.PhaseCorrector(scene, camera, image_processing, phase_correction_type=PhaseCorrectionType.SIMPLE, brdf=None)[source]

This class adds phase correction capabilities to RelNavEstimator.

Phase correction is the process by which we attempt to move an observed center of brightness (the centroid of a bright patch in this case) to more closely resemble the location where the center of figure would be observed in the image. This is done by correcting for the fact that the phase angle between the camera, the target, and the sun, can cause the observed center of brightness to be biased towards one side of the shape because only part of the target appears illuminated.

Specifically, this class adds 2 new key word argument inputs and attributes phase_correction_type, and brdf which specify what phase correction method to use to compute the phase correction, as well as the BRDF that is used to generate the illumination information for each facet when the RASTERED phase correction method is used. In addition, it provides the method compute_phase_correction() which will return the phase correction based as a size 2 numpy array from the center of brightness to the center of figure in pixels using the current scene settings and the selected phase_correction_type. It also defines 3 helper methods which are included for documentation purposes but are rarely interfaced with directly: compute_line_of_sight_sun_image(), simple_phase_correction(), and rastered_phase_correction().

Generally this class is not used by the user and is instead used internally by the RelNav techniques that the user interacts with. If you are trying to implement a new relnav technique that needs phase correction capabilities, then you can subclass this class (no need to also subclass RelNavEstimator) and then use the compute_phase_correction() method when you need it. For more information on defining a new RelNav technique, refer to the relative_opnav.estimators documentation.

Parameters:
  • scene (Scene) – The Scene object containing the target, light, and obscuring objects.

  • camera (Camera) – The Camera object containing the camera model and images to be utilized

  • image_processing (ImageProcessing) – The ImageProcessing object to be used to process the images

  • phase_correction_type (PhaseCorrectionType | str) – The type of phase correction to use. Should be one of the PhaseCorrectionType enum values

  • brdf (IlluminationModel | None) – The illumination model to use to compute the illumination values if the RASTERED phase correction type is used. If the RASTERED phase correction type is not used this is ignored. If this is left as None and the Rastered phase correction type is used, this will default to the McEwen Model, McEwenIllumination.

property camera: Camera

The camera instance that represents the camera used to take the images we are performing Relative OpNav on.

This is the source of the camera model, and may be used for other information about the camera as well. See the Camera property for details.

generates_templates: bool = False

A flag specifying whether this RelNav estimator generates and stores templates in the templates attribute.

observable_type: List[RelNavObservablesType | str] | RelNavObservablesType | str | None = 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 be None in which case the default type of RelNavObservablesType.CENTER_FINDING will be assumed, or it can be a single string or RelNavObservable 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 attribute relnav_handler which is a function where the first and only positional argument is the RelativeOpNav instance that this technique was registered to and there are 2 key word arguments image_ind and include_targets which should be used to control which image/target is processed.

relnav_handler: Callable | None = None

A custom handler for doing estimation/packaging the results into the RelativeOpNav instance.

Typically this should be None, unless the observable_type is set to RelNavObservablesType.CUSTOM, in which case this must be a function where the first and only positional argument is the RelativeOpNav instance that this technique was registered to and there are 2 key word arguments image_ind and include_targets which should be used to control which image/target is processed.

If observable_type is not RelNavObservablesType.CUSTOM then this is ignored whether it is None or not.

property 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.

technique: str | None = 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 is MyEstimator.technique.isidentifier() should evaluate True).

Summary of Methods

compute_line_of_sight_sun_image

compute_phase_correction

The method computes the phase correction assuming a spherical target.

estimate

This method should apply the technique to a specified image for all targets specified in include_targets.

rastered_phase_correction

This method computes the phase correction by raster rendering the target to determine the offset from the center of illumination to the center of figure.

reset

This method resets the observed/computed attributes as well as the details attribute to have None for each target in scene.

simple_phase_correction

This method computes the simple phase correction assuming the target is a sphere.

target_generator

This method returns a generator which yields target_index, target pairs that are to be processed based on the input include_targets.