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

[1]

Thibos LN, Wheeler W, Horner D. Power vectors: an application of Fourier analysis to the description and statistical analysis of refractive error. Optometry and vision science: official publication of the American Academy of Optometry. 1997 Jun;74(6):367-75.

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

Convert the refraction to polar power vector form.

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

Convert the refraction to sphero-cylindrical form.

to_polar_power_vectors() PolarPowerVectorRefraction#

Convert 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#

Convert the refraction to sphero-cylindrical form.

Parameters:
cylinder_form{“positive”, “negative”}, optional

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

Returns:
SpheroCylindricalRefraction

The refraction in sphero-cylindrical form.

Raises:
ValueError

If cylinder_form is not set to “positive” or “negative”.

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

Convert 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#

Convert 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

The refraction in sphero-cylindrical form, converted to the specified cylinder form.

Raises:
ValueError

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