AbstractDistortionModel#

class optika.distortion.AbstractDistortionModel[source]#

Bases: Printable

An interface describing an arbitrary distortion model, which maps scene coordinates to sensor coordinates (and vice versa).

A distortion model carries the wavelength along with the position, since the mapping from a point in the scene to a point on the sensor generally depends on wavelength (for example, the dispersion of a spectrograph). As a result distort() and undistort() are inverses of one another only up to the accuracy of the model.

Methods

__init__()

distort(coordinates)

Convert scene coordinates to sensor coordinates.

to_string([prefix])

Public-facing version of the __repr__ method that allows for defining a prefix string, which can be used to calculate how much whitespace to add to the beginning of each line of the result.

undistort(coordinates)

Convert sensor coordinates to scene coordinates.

Inheritance Diagram

Inheritance diagram of optika.distortion.AbstractDistortionModel
abstractmethod distort(coordinates)[source]#

Convert scene coordinates to sensor coordinates.

Parameters:

coordinates (AbstractSpectralPositionalVectorArray) – The wavelength and position of each point in the scene.

Return type:

SpectralPositionalVectorArray

to_string(prefix=None)#

Public-facing version of the __repr__ method that allows for defining a prefix string, which can be used to calculate how much whitespace to add to the beginning of each line of the result.

Parameters:

prefix (None | str) – an optional string, the length of which is used to calculate how much whitespace to add to the result.

Return type:

str

abstractmethod undistort(coordinates)[source]#

Convert sensor coordinates to scene coordinates.

Parameters:

coordinates (AbstractSpectralPositionalVectorArray) – The wavelength and sensor position of each point.

Return type:

SpectralPositionalVectorArray