Simulator
- class catkit2.simulator.Simulator(service_type, max_time_factor=1)
Bases:
catkit2.testbed.service.Service
Methods Summary
actuate_dm
(dm_name, new_actuators)Actuate a DM.
add_callback
(callback_func[, t])Add a callback to the callback list.
camera_readout
(camera_name, integrated_power)Read out a camera.
end_camera_acquisition
(camera_name)End the acquisition loop on a camera.
get_camera_power
(camera_name)Get the current incident power on a camera.
main
(self)make_camera_readout_callback
(camera_name, ...)Schedule a new readout callback for a camera.
make_camera_reset_callback
(camera_name)Schedule a new reset callback for a camera.
move_filter
(filter_wheel_name, ...)Move a filter.
move_flip_mount
(flip_mount_name, ...)Move a flip mount.
move_stage
(stage_name, old_stage_position, ...)Move a stage.
release_breakpoint
(breakpoint_token)Release a previously set breakpoint.
remove_callback
(callback)Remove a callback from the list of callbacks.
set_breakpoint
([t_until])Set a breakpoint for the simulator.
set_source_power
(source_name, power)Set the power of a light source.
start_camera_acquisition
(camera_name, ...)Start acquisition on a camera.
switch_power
(outlet_name, powered)Switch power on an outlet on or off.
Methods Documentation
- actuate_dm(dm_name, new_actuators)
Actuate a DM.
This function should be overriden by the child class. It is responsible for setting the actuators on the DM in its model.
- dm_namestring
The name of the DM.
- new_actuatorsndarray
The new actuators for this DM.
- add_callback(callback_func, t=None)
Add a callback to the callback list.
- callback_funcfunction
The function to execute when the time t has been reached by the simulator.
- tscalar or None
The simulated time at which to run the function. A value of None (the default) indicates that the callback should be executed at the current simulated time.
- Callback
The created callback.
- camera_readout(camera_name, integrated_power)
Read out a camera.
This function should be overriden by the child class. It is responsible for handling the image and submitting it to the right service.
- camera_namestring
The name of the camera.
- integrated_powerhcipy.Field
The integrated power for this camera, ie. integration time times average incident power on each pixel.
- end_camera_acquisition(camera_name)
End the acquisition loop on a camera.
The current exposure will be finished, but afterwards, no more exposures will be performed on this camera (until the acquisition is started again).
- camera_namestring
The name of the camera.
- get_camera_power(camera_name)
Get the current incident power on a camera.
- camera_namestring
The name of the camera.
- hcipy.Field
The incident power on that camera.
- main(self: catkit2.catkit_bindings.Service) None
- make_camera_readout_callback(camera_name, integration_time, frame_interval)
Schedule a new readout callback for a camera.
This function will usually be called a certain time after a camera has been reset. This marks the end of an exposure for this camera.
- camera_namestring
The name of the camera.
- integration_timescalar
The integration time for this camera.
- frame_intervalscalar
The time interval between neighboring frames.
- make_camera_reset_callback(camera_name)
Schedule a new reset callback for a camera.
This function will usually be called a certain time after a camera has been read out. This marks the start of an exposure for this camera.
- camera_namestring
The name of the camera.
- move_filter(filter_wheel_name, new_filter_position)
Move a filter.
This function should be overriden by the child class. It is responsible for setting the filter in its model.
- filter_wheel_namestring
The name of the filter wheel.
- new_filter_positionscalar or child-class defined
The new filter position for this filter wheel.
- move_flip_mount(flip_mount_name, new_flip_mount_position)
Move a flip mount.
This function should be overriden by the child class. It is responsible for setting the flip mount in its model.
- flip_mount_namestring
The name of the flip mount.
- new_flip_mount_positionscalar
The new position of this flip mount.
- move_stage(stage_name, old_stage_position, new_stage_position)
Move a stage.
This function should be overriden by the child class. It is responsible for setting the stage position in its model.
Having access to both the old and new stage position allows for the child class to implement movements of a stage over simulated time.
- stage_namestring
The name of the stage.
- old_stage_positionscalar
The current position of this stage axis.
- new_stage_positionscalar
The commanded position of this stage axis.
- release_breakpoint(breakpoint_token)
Release a previously set breakpoint.
This will let the simulator continue past the breakpoint. When the breakpoint has not been reached yet, this will have no influence.
- breakpoint_tokenint
A token given out by set_breakpoint().
- remove_callback(callback)
Remove a callback from the list of callbacks.
This allows the user to cancel a previously added callback. If the callback has already been executed, this function is a no-op.
- callbackCallback
The callback which to remove from the list of callbacks.
- set_breakpoint(t_until=None)
Set a breakpoint for the simulator.
The simulator will pause at this breakpoint until it is released. Currently, this functionality is not implemented.
- t_untilscalar
The simulated time of the breakpoint.
- int
A token for the breakpoint.
- set_source_power(source_name, power)
Set the power of a light source.
- source_namestring
The name of the light source.
- powerscalar
The new power of this light source.
- start_camera_acquisition(camera_name, integration_time, frame_interval)
Start acquisition on a camera.
The camera will take images every frame_interval seconds with an integration time of integration_time.
- camera_namestring
The name of the camera.
- integration_timescalar
The integration time of the camera.
- frame_intervalscalar
The time interval between neighboring frames.
- switch_power(outlet_name, powered)
Switch power on an outlet on or off.
This function should be overriden by the child class. It is responsible for setting whatever effect this outlet has on the model.
- outlet_namestring
The name of the outlet.
- poweredboolean
Whether to turn the power on (True) or off (False).