labscript.outputs.Shutter
- class Shutter(name, parent_device, connection, delay=(0, 0), open_state=1, **kwargs)[source]
Bases:
DigitalOut
Customized version of
DigitalOut
that accounts for the open/close delay of a shutter automatically.When using the methods
open()
andclose()
, the shutter open and close times are precise without haveing to track the delays. Note: delays can be set using runmanager globals and periodically updated via a calibration.Warning
If the shutter is asked to do something at
t=0
, it cannot start moving earlier than that. This means the initial shutter states will have imprecise timing.- __init__(name, parent_device, connection, delay=(0, 0), open_state=1, **kwargs)[source]
Instantiates a Shutter.
- Parameters:
name (str) – python variable to assign the object to.
parent_device (
IntermediateDevice
) – Parent device the digital output is connected to.connection (str) – Physical output port of the device the digital output is connected to.
delay (tuple, optional) – Tuple of the (open, close) delays, specified in seconds.
open_state (int, optional) – Allowed values are
0
or1
. Defines which state of the digital output opens the shutter.
- Raises:
LabscriptError – If the
open_state
is not0
or1
.
Methods
__init__
(name, parent_device, connection[, ...])Instantiates a Shutter.
add_device
(device)Adds a child device to this device.
add_instruction
(time, instruction[, units])Adds a hardware instruction to the device instruction list.
apply_calibration
(value, units)Apply the calibration defined by the unit conversion class, if present.
close
(t)Command the shutter to close at time
t
.disable
(t)Commands the output to disable.
do_checks
(trigger_times)Basic error checking to ensure the user's instructions make sense.
enable
(t)Commands the output to enable.
expand_timeseries
(all_times, flat_all_times_len)This function evaluates the ramp functions in self.timeseries at the time points in all_times, and creates an array of output values at those times.
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_change_times
(*args, **kwargs)If this function is being called, it means that the parent Pseudoclock has requested a list of times that this output changes state.
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()
.get_ramp_times
()If this is being called, then it means the parent Pseuedoclock has asked for a list of the output ramp start and stop times.
go_high
(t)Commands the output to go high.
go_low
(t)Commands the output to go low.
init_device_group
(hdf5_file)Creates the device group in the shot file.
instruction_to_string
(instruction)Gets a human readable description of an instruction.
make_timeseries
(change_times)If this is being called, then it means the parent Pseudoclock has asked for a list of this output's states at each time in change_times.
offset_instructions_from_trigger
(trigger_times)Subtracts self.trigger_delay from all instructions at or after each trigger_time.
open
(t)Command the shutter to open at time
t
.quantise_to_pseudoclock
(times)Quantises
times
to the resolution of the controlling pseudoclock.repeat_pulse_sequence
(t, duration, ...)This function only works if the DigitalQuantity is on a fast clock
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.
Attributes
allowed_children
Defines types of devices that are allowed to be children of this device.
allowed_states
clock_limit
Returns the parent clock line's clock limit.
default_value
Brief description of the device.
parent_clock_line
Stores the clocking clockline, which may be itself.
pseudoclock_device
Stores the clocking pseudoclock, which may be itself.
scale_factor
t0
The earliest time output can be commanded from this device at the start of the experiment.
trigger_delay
The earliest time output can be commanded from this device after a trigger.
wait_delay
The earliest time output can be commanded from this device after a wait.
- close(t)[source]
Command the shutter to close at time
t
.Takes the close delay time into account.
Note that the delay time will not be take into account the close delay if the command is made at t=0 (or other times less than the close delay). No warning will be issued for this loss of precision during compilation.
- Parameters:
t (float) – Time, in seconds, when shutter should be closed.
- description = 'shutter'
Brief description of the device.
- 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.
- get_change_times(*args, **kwargs)[source]
If this function is being called, it means that the parent Pseudoclock has requested a list of times that this output changes state.
- Returns:
List of times output changes values.
- Return type:
- open(t)[source]
Command the shutter to open at time
t
.Takes the open delay time into account.
Note that the delay time will not be take into account the open delay if the command is made at t=0 (or other times less than the open delay). No warning will be issued for this loss of precision during compilation.
- Parameters:
t (float) – Time, in seconds, when shutter should be open.