DynamicOpticalSystem

class hcipy.optics.DynamicOpticalSystem[source]

Bases: object

A dynamically varying optical system.

This can be used as a starting point for an implementation of an adaptive optics system. The optics are changed as specific moments in time, which can be scheduled by submitting a callback. The time points are bridged using the integrate function, which is written by the derived class. This function should integrate on each detector without reading out the detector. Detector readouts or DM changes should be implemented as callbacks.

Methods Summary

add_callback(t, callback)

Add a callback to the list of callbacks.

evolve_until(t)

Evolve the optical system until time t.

integrate(integration_time)

Integrate the current optical system for a certain integration time.

Methods Documentation

add_callback(t, callback)[source]

Add a callback to the list of callbacks.

This function can even be called during handling of a callback. This is especially useful when implementing periodic callbacks: a callback can reinsert itself at a later time at the end of handling of the callback.

Parameters:
tscalar

The finite time at which to call the callback, at or after the current time.

callbackfunction

The function to call at time t. This function should have no arguments.

Raises:
ValueError

If t is nonfinite or earlier than the current time.

TypeError

If callback is not callable.

evolve_until(t)[source]

Evolve the optical system until time t.

Parameters:
tscalar

The point in time to which to simulate this optical system. Callbacks and integrations are handled along the way.

Raises:
ValueError

If t is nonfinite or earlier than the current time.

Notes

Callbacks at the same time run in insertion order without intervening integration. If integration raises, the pending callback and scheduler time are retained. Side effects of a failed integration must be handled by the derived class. A callback that raises has already been removed and is not retried automatically.

integrate(integration_time)[source]

Integrate the current optical system for a certain integration time.

This function should be implemented by a user in a derived class.

Parameters:
integration_timescalar

The integration time with which to integrate the optical system.