DNOIS

Package dnois provides some commonly used or basic functions and classes.

Camera

Camera(optics, sensor)

A basic camera model.

Physics

c

Convert a string or number to a floating point number, if possible.

fdc()

Returns the wavelengths of Fraunhofer's F, d and C lines.

fline([symbol, element, alone, unit])

Alias for fraunhofer_line().

fraunhofer_line([symbol, element, alone, unit])

Returns information about Fraunhofer lines.

k(wl[, n])

Alias for wave_vec().

reflect(incident, normal)

Computes direction of reflective ray given that of incident ray and normal vector:

refract()

Computes direction of refractive ray given that of incident ray, normal vector and refractive indices.

wave_vector(wl[, n])

Computes magnitude of wavelength vector:

Functions

zernike(r, theta, k)

Computes the \(k\)-th term of Zernike polynomials:

zernike_cpd(r, theta, k)

Computes the Cartesian partial derivatives of \(k\)-th term of Zernike polynomials.

Debugging

debug([on])

Switch debugging mode on or off.

debugging()

Returns whether debugging is enabled or not.

Units

convert(value, from_, to[, unit_type])

Convert a quantity with given unit from_ to that with unit to.

get_default(unit_type)

Get global default unit.

set_default(unit_type, unit)

Set global default length unit.

Unit(value[, names, module, qualname, type, ...])

Base class of all units.

Length(value[, names, module, qualname, ...])

Length units.

Angle(value[, names, module, qualname, ...])

Angle units.

Exception classes

ShapeError

Raised when the shape of a tensor is invalid for some functions.

PhysicsError

Raised when some physical assumptions are not met.

Miscellaneous

fmt(v)

Format a float according to float_print_fmt.