pytweezer.drivers.motmaster module

Driver for a MOTMaster experiment sequencer.

MOTMaster is a .NET application reached over .NET remoting through pythonnet, so this module talks to it via clr rather than a Python instrument library. A MotMasterInterface is constructed with the name of a JSON config file in the package configuration/ dir naming the MOTMaster executable, its remoting URL, the .cs script root, and the DLLs to load; constructing one starts MOTMaster.exe if it isn’t already running and connects, so a constructed interface is a connected one.

class pytweezer.drivers.motmaster.MotMasterInterface(config_file, interval=0.1)[source]

Bases: object

Parameters:
auto_mot(scan_ranges, camera, shots_per_point=1, script='AMOTBasic', field_parameter='MOTCoilsCurrentValue', bg_field_value=0.0, mot_field_value=1.0, display_results=False)[source]

Tune the MOT by scanning wavemeter-lock set points laser by laser.

A background is taken first with the MOT coils at bg_field_value, then each laser named in scan_ranges is stepped over its set points (coils at mot_field_value) while shots_per_point fluorescence frames are read off camera. Background-subtracted counts pick the set point with the most atoms, and the laser is left parked there before moving on to the next one — so lasers are optimised in the order scan_ranges gives.

scan_ranges maps laser name (a key of the config’s lasers block) to the slave frequencies to try, in THz. camera is a device name resolved with get_device(), or an already-connected camera (a client, or the object itself for a camera in this process); a client opened here is closed again on the way out. Configure the camera before calling — exposure, ROI, external trigger, and a setup_acquisition buffer holding at least the whole scan. auto_mot arms it once and then reads consecutive frames, so the camera must capture exactly shots_per_point frames per MOTMaster shot.

Returns, per laser, the scan range, mean and standard-error counts at each point, the chosen set point and the set point the laser started from; pass that dict to plot_auto_mot_results() to see the scans.

Parameters:
Return type:

dict[str, dict[str, Any]]

connect()[source]
Return type:

None

disconnect()[source]
Return type:

None

get_laser_frequencies_actual()[source]
Return type:

dict[str, dict[str, float]]

get_laser_set_points_tcl()[source]
Return type:

dict[str, dict[str, float]]

get_laser_set_points_wml()[source]
Return type:

dict[str, dict[str, float]]

get_motmaster_dictionary()[source]
get_params()[source]
get_params_csdict()[source]
python_to_cs_dict(parameters)[source]
Parameters:

parameters (dict)

save_pattern_info(save_folder, file_tag, task_nr)[source]

Save pattern information to files. calls saveToFiles from MMDataIOHelper

scan_microwave_amplitude(script, synthesizer='Gigatronics Synthesizer 2', values=(), move_yag_spot=False)[source]
Parameters:
Return type:

None

scan_microwave_frequency(script, synthesizer='Gigatronics Synthesizer 2', values=(), move_yag_spot=False)[source]
Parameters:
Return type:

None

scan_motmaster_parameter(script, parameter, values, move_yag_spot=False, callback=None)[source]

Run script once per entry in values, with the MOTMaster parameter parameter set to that entry. callback is called with the value after each shot and its return appended to the results.

Parameters:
Return type:

list[Any]

scan_picomotor_steps(script, motor, interval_steps, total_steps, speed=None, accel=None, callback=None, motmaster_parameter=None, motmaster_values=None)[source]
Parameters:
Return type:

list[Any]

scan_tcl_laser_set_points(script, laser, values, move_yag_spot=False, callback=None, motmaster_parameter=None, motmaster_value=None)[source]
Parameters:
Return type:

list[Any]

scan_wm_laser_set_points(script, laser, values, move_yag_spot=False, callback=None, motmaster_parameter=None, motmaster_value=None)[source]
Parameters:
Return type:

list[Any]

scan_wm_laser_set_points_with_motmaster_multiple_parameters(script, laser, values, move_yag_spot=False, callback=None, motmaster_parameters=None, motmaster_values=None)[source]
Parameters:
Return type:

list[Any]

scan_wm_laser_set_points_with_motmaster_values(script, laser, values, move_yag_spot=False, callback=None, motmaster_parameter=None, motmaster_values=None)[source]
Parameters:
Return type:

list[Any]

set_iterations(iterations)[source]
Parameters:

iterations (int)

set_motmaster_experiment(script)[source]
Parameters:

script (str)

set_run_until_stopped(value)[source]
Parameters:

value (bool)

set_save_toggle(save)[source]
Parameters:

save (bool)

set_trigger_mode(value)[source]
Parameters:

value (bool)

start_motmaster_experiment(parameters=None)[source]
Parameters:

parameters (dict | None)

pytweezer.drivers.motmaster.plot_auto_mot_results(results)[source]

Plot the scans returned by MotMasterInterface.auto_mot(): one panel per laser, normalised number against detuning from the set point the laser started on, with an arrow marking the set point chosen. Returns the (figure, axes) pair.

Parameters:

results (dict[str, dict[str, Any]])