labscript.core.PseudoclockDevice
- class PseudoclockDevice(name, trigger_device=None, trigger_connection=None, **kwargs)[source]
Bases:
TriggerableDevice
Device that implements a pseudoclock.
- __init__(name, trigger_device=None, trigger_connection=None, **kwargs)[source]
Instantiates a pseudoclock device.
- Parameters:
name (str) – python variable to assign to this device.
trigger_device (
DigitalOut
) – Sets the parent triggering output. IfNone
, this is considered the master pseudoclock.trigger_connection (str, optional) – Must be provided if
trigger_device
is provided. Specifies the channel of the parent device.**kwargs – Passed to
TriggerableDevice.__init__()
.
Methods
__init__
(name[, trigger_device, ...])Instantiates a pseudoclock device.
add_device
(device)Adds a child device to this device.
do_checks
(outputs)Basic error checking to ensure the user's instructions make sense.
generate_code
(hdf5_file)Generate hardware instructions for device and children, then save to h5 file.
get_all_children
()Get all children devices for this device.
get_all_outputs
()Get all children devices that are outputs.
get_properties
([location])Get all properties in location.
get_property
(name[, location])Method to get a property of this device already set using
Device.set_property()
.init_device_group
(hdf5_file)Creates the device group in the shot file.
offset_instructions_from_trigger
(outputs)Offset instructions for child devices by the appropriate trigger times.
quantise_to_pseudoclock
(times)Quantises
times
to the resolution of the controlling pseudoclock.Sets the initial trigger time of the pseudoclock.
set_properties
(properties_dict, property_names)Add one or a bunch of properties packed into properties_dict
set_property
(name, value[, location, overwrite])Method to set a property for this device.
trigger
(t, duration[, wait_delay])Ask the trigger device to produce a digital pulse of a given duration to trigger this pseudoclock.
Attributes
Defines types of devices that are allowed to be children of this device.
Brief description of the device.
Whether this device is the master pseudoclock.
minimum_recovery_time
Minimum time required before another trigger can occur.
parent_clock_line
Stores the clocking clockline, which may be itself.
pseudoclock_device
Stores the clocking pseudoclock, which may be itself.
t0
The earliest time output can be commanded from this device at the start of the experiment.
Type of trigger.
- allowed_children = [<class 'labscript.core.Pseudoclock'>]
Defines types of devices that are allowed to be children of this device.
- Type:
- description = 'Generic Pseudoclock Device'
Brief description of the device.
- do_checks(outputs)[source]
Basic error checking to ensure the user’s instructions make sense.
- Parameters:
outputs (list) – List of outputs to check.
- generate_code(hdf5_file)[source]
Generate hardware instructions for device and children, then save to h5 file.
Will recursively call
generate_code
for all children devices.- Parameters:
hdf5_file (
h5py.File
) – Handle to shot file.
- offset_instructions_from_trigger(outputs)[source]
Offset instructions for child devices by the appropriate trigger times.
- Parameters:
outputs (list) – List of outputs to offset.
- set_initial_trigger_time(t)[source]
Sets the initial trigger time of the pseudoclock.
If this is the master pseudoclock, time must be 0.
- Parameters:
t (float) – Time, in seconds, to trigger this device.
- trigger(t, duration, wait_delay=0)[source]
Ask the trigger device to produce a digital pulse of a given duration to trigger this pseudoclock.
- trigger_delay = 0
- trigger_minimum_duration = 0
- wait_delay = 0