visisipy.refraction#

Utilities for handling refraction data.

Classes#

FourierPowerVectorRefraction

Ocular refraction in Fourier power vector form.

PolarPowerVectorRefraction

Ocular refraction in polar power vector form.

SpheroCylindricalRefraction

Ocular refraction in sphero-cylindrical form.

Module Contents#

class visisipy.refraction.FourierPowerVectorRefraction#

Ocular refraction in Fourier power vector form.

This is the default representation of refractions in visisipy. This class contains several methods to convert the refraction to other forms, using the conversions defined in [1].

Attributes#

Mfloat

The power of the refraction.

J0float

The Jackson cross-cylinder power at 0°.

J45float

The Jackson cross-cylinder power at 45°.

Methods#

to_polar_power_vectors() -> PolarPowerVectorRefraction

Converts the refraction to polar power vector form.

to_sphero_cylindrical(cylinder_form: Literal[“positive”, “negative”] = “negative”) -> SpheroCylindricalRefraction

Converts the refraction to sphero-cylindrical form.

to_polar_power_vectors() PolarPowerVectorRefraction#

Converts the refraction to polar power vector form.

Returns#

PolarPowerVectorRefraction

The refraction in polar power vector form.

to_sphero_cylindrical(cylinder_form: Literal['positive', 'negative'] = 'negative') SpheroCylindricalRefraction#

Converts the refraction to sphero-cylindrical form.

Parameters#

cylinder_formstr, optional

Indicates if the cylinder should be positive or negative. Defaults to “negative”.

Returns#

SpheroCylindricalRefraction

The refraction in sphero-cylindrical form.

class visisipy.refraction.PolarPowerVectorRefraction#

Ocular refraction in polar power vector form.

Attributes#

Mfloat

The power of the refraction.

Jfloat

The Jackson cross-cylinder power.

axisfloat

The axis of the Jackson cross-cylinder power.

class visisipy.refraction.SpheroCylindricalRefraction#

Ocular refraction in sphero-cylindrical form.

Attributes#

spherefloat

The spherical component of the refraction.

cylinderfloat

The cylindrical component of the refraction.

axisfloat

The axis of the cylindrical component of the refraction.

Methods#

has_positive_cylinder() -> bool

Returns True if the cylinder is positive or NaN, False otherwise.

has_negative_cylinder() -> bool

Returns True if the cylinder is negative or NaN, False otherwise.

convert_cylinder_form(to: Literal[“positive”, “negative”]) -> SpheroCylindricalRefraction

Converts from positive cylinder refraction to negative cylinder refraction and vice-versa.

property has_positive_cylinder: bool#

Returns True if the cylinder is positive or NaN, False otherwise.

property has_negative_cylinder: bool#

Returns True if the cylinder is negative or NaN, False otherwise.

convert_cylinder_form(to: Literal['positive', 'negative']) SpheroCylindricalRefraction#

Converts from positive cylinder refraction to negative cylinder refraction and vice-versa.

Parameters#

tostr

Indicates if the conversion should be done towards negative cylinder form (“negative”) or positive cylinder form (“positive”).

Returns#

SpheroCylindricalRefraction, optional

With inplace set to True, no return is given as the current class is updated. With inplace set to False, a copy of the current SpheroCylindricalRefraction instance is returned, but in the specified cylinder format.

Raises#

ValueError

When the parameter “to” is not set to ‘positive’ or ‘negative’.