Qudi
|
Magnet positioning software for superconducting magnet. More...
Public Member Functions | |
def | __init__ (self, kwargs) |
Here the connections to the power supplies and to the counter are established. | |
def | on_activate (self) |
def | on_deactivate (self) |
def | utf8_to_byte (self, myutf8) |
Convenience function for code refactoring. More... | |
def | byte_to_utf8 (self, mybytes) |
Convenience function for code refactoring. More... | |
def | get_constraints (self) |
Retrieve the hardware constraints from the magnet driving device. More... | |
def | tell (self, param_dict) |
Send a command string to the magnet. More... | |
def | ask (self, param_dict) |
Asks the magnet a 'question' and returns an answer from it. More... | |
def | get_status (self, param_list=None) |
Get the status of the position. More... | |
def | heat_switch (self, axis) |
This function enables heating of the PJSwitch, which is a necessary step to conduct current to the coils. More... | |
def | heat_all_switches (self) |
Just a convenience function to heat all switches at once, as it is unusual to only apply a magnetic field in one direction. | |
def | cool_switch (self, axis) |
Turns off the heating of the PJSwitch, axis depending on user input. More... | |
def | cool_all_switches (self) |
Just a convenience function to cool all switches at once This will take 600s. More... | |
def | initialize (self) |
def | idle_magnet (self) |
Cool all coils of the superconducting magnet to achieve maximum accuracy after aligning. More... | |
def | wake_up_magnet (self) |
Heat all coils of the superconducting magnet to get back to the working state. More... | |
def | switch_mode (self, bool_var) |
def | target_field_setpoint (self, param_dict) |
Function to set the target field (in T), which will be reached through the function ramp(self, param_list). More... | |
def | ramp (self, param_list=None) |
function to ramp the magnetic field in the direction(s) to the target field values More... | |
def | ramp_to_zero (self, axis) |
Function to ramp down a specific coil to zero current. More... | |
def | calibrate (self, param_list=None) |
Calibrates the stage. More... | |
def | set_coordinates (self, param_dict) |
def | move_abs (self, param_dict) |
Moves stage to absolute position (absolute movement) More... | |
def | move_rel (self, param_dict) |
Moves stage in given direction (in spheric coordinates with theta and phi in radian) More... | |
def | transform_coordinates (self, param_dict) |
Function for generic coordinate transformation. More... | |
def | get_current_field (self) |
Function that asks the magnet for the current field strength in each direction. More... | |
def | get_pos (self, param_list=None) |
Gets current position of the stage. More... | |
def | stop_hard (self, param_list=None) |
function that pauses the heating of a specific coil depending on the elements in param_list. More... | |
def | abort (self) |
Stops movement of the stage. More... | |
def | ask_status (self, param_list=None) |
Function that returns the status of the coils ('x','y' and 'z') given in the param_dict. More... | |
def | translated_get_status (self, param_list=None) |
Just a translation of the numbers according to the manual supplied by American Magnets, Inc. More... | |
def | set_velocity (self, param_dict) |
Function to change the ramp rate in T/s (ampere per second) More... | |
def | get_velocity (self, param_list=None) |
Gets the current velocity for all connected axes. More... | |
def | check_constraints (self, param_dict) |
def | rho_pos_max (self, param_dict) |
def | update_coordinates (self, param_dict) |
def | set_magnet_idle_state (self, magnet_idle=True) |
Set the magnet to couple/decouple to/from the control. More... | |
def | get_magnet_idle_state (self) |
Retrieve the current state of the magnet, whether it is idle or not. More... | |
![]() | |
def | __init__ (self, manager, name, config=None, callbacks=None, kwargs) |
Initialise Base class object and set up its state machine. More... | |
def | log (self) |
Returns a logger object. | |
def | is_module_threaded (self) |
Returns whether the module shall be started in a thread. | |
def | on_activate (self) |
Method called when module is activated. More... | |
def | on_deactivate (self) |
Method called when module is deactivated. More... | |
def | getStatusVariables (self) |
Return a dict of variable names and their content representing the module state for saving. More... | |
def | setStatusVariables (self, variableDict) |
Give a module a dict of variable names and their content representing the module state. More... | |
def | getConfiguration (self) |
Return the configration dictionary for this module. More... | |
def | get_connector (self, connector_name) |
Return module connected to the given named connector. More... | |
![]() | |
def | __new__ (cls, name, bases, attrs) |
Collect declared Connectors, ConfigOptions and StatusVars into dictionaries. More... | |
Public Attributes | |
soc_x | |
soc_y | |
soc_z | |
mode | |
![]() | |
module_state | |
connectors | |
Static Public Attributes | |
port = ConfigOption('magnet_port', missing='error') | |
ip_addr_x = ConfigOption('magnet_IP_address_x', missing='error') | |
ip_addr_y = ConfigOption('magnet_IP_address_y', missing='error') | |
ip_addr_z = ConfigOption('magnet_IP_address_z', missing='error') | |
waitingtime = ConfigOption('magnet_waitingtime', 0.01) | |
x_constr = ConfigOption('magnet_x_constr', 1.0) | |
y_constr = ConfigOption('magnet_y_constr', 1.0) | |
z_constr = ConfigOption('magnet_z_constr', 3.0) | |
rho_constr = ConfigOption('magnet_rho_constr', 1.2) | |
Magnet positioning software for superconducting magnet.
Enables precise positioning of the magnetic field in spherical coordinates with the angle theta, phi and the radius rho. The superconducting magnet has three coils, one in x, y and z direction respectively. The current through these coils is used to compute theta, phi and rho. The alignment can be done manually as well as automatically via fluorescence alignment.
Example config for copy-paste:
sc_magnet: module 'sc_magnet.magnet.Magnet' magnet_port 3000 magnet_IP_address_x 192.168.0.12 magnet_IP_address_y 192.168.0.13 magnet_IP_address_z 192.168.0.14 magnet_waitingtime 0.01 # in seconds magnet_x_constr 1.0 magnet_y_constr 2.0 magnet_z_constr 3.0 magnet_rho_constr 1.2
def magnet.Magnet.abort | ( | self | ) |
Stops movement of the stage.
def magnet.Magnet.ask | ( | self, | |
param_dict | |||
) |
Asks the magnet a 'question' and returns an answer from it.
dictionary | param_dict: has to have one of the following keys: 'x', 'y' or 'z' the items have to be valid questions for the magnet. |
def magnet.Magnet.ask_status | ( | self, | |
param_list = None |
|||
) |
Function that returns the status of the coils ('x','y' and 'z') given in the param_dict.
list | param_list: string (elements allowed 'x', 'y' and 'z') for which the status should be returned. Can be None, then the answer is the same as for the list ['x','y','z']. |
For further information on the meaning of the numbers see translated_get_status()
def magnet.Magnet.byte_to_utf8 | ( | self, | |
mybytes | |||
) |
Convenience function for code refactoring.
bytes | mybytes the byte message to be decoded |
def magnet.Magnet.calibrate | ( | self, | |
param_list = None |
|||
) |
Calibrates the stage.
In the case of the super conducting magnet this just means moving all or a user specified coil to zero magnetic field.
dict | param_list: param_list: optional, if a specific calibration of an axis is desired, then the labels of the needed axis should be passed in the param_list. If nothing is passed, then all connected axis will be calibrated. |
After calibration the stage moves to home position which will be the zero point for the passed axis. The calibration procedure will be different for each stage.
def magnet.Magnet.cool_all_switches | ( | self | ) |
Just a convenience function to cool all switches at once This will take 600s.
def magnet.Magnet.cool_switch | ( | self, | |
axis | |||
) |
Turns off the heating of the PJSwitch, axis depending on user input.
string | axis: desired axis (x, y, z) |
def magnet.Magnet.get_constraints | ( | self | ) |
Retrieve the hardware constraints from the magnet driving device.
Provides all the constraints for each axis of a motorized stage (like total travel distance, velocity, ...) Each axis has its own dictionary, where the label is used as the identifier throughout the whole module. The dictionaries for each axis are again grouped together in a constraints dictionary in the form
{'<label_axis0>': axis0 }
where axis0 is again a dict with the possible values defined below. The possible keys in the constraint are defined in the interface file. If the hardware does not support the values for the constraints, then insert just None. If you are not sure about the meaning, look in other hardware files to get an impression.
def magnet.Magnet.get_current_field | ( | self | ) |
Function that asks the magnet for the current field strength in each direction.
def magnet.Magnet.get_magnet_idle_state | ( | self | ) |
Retrieve the current state of the magnet, whether it is idle or not.
def magnet.Magnet.get_pos | ( | self, | |
param_list = None |
|||
) |
Gets current position of the stage.
list | param_list: optional, if a specific position of an axis is desired, then the labels of the needed axis should be passed in the param_list. If nothing is passed, then from each axis the position is asked. |
def magnet.Magnet.get_status | ( | self, | |
param_list = None |
|||
) |
Get the status of the position.
list | param_list: optional, if a specific status of an axis is desired, then the labels of the needed axis should be passed in the param_list. If nothing is passed, then from each axis the status is asked. |
def magnet.Magnet.get_velocity | ( | self, | |
param_list = None |
|||
) |
Gets the current velocity for all connected axes.
dict | param_list: optional, if a specific velocity of an axis is desired, then the labels of the needed axis should be passed as the param_list. If nothing is passed, then from each axis the velocity is asked. |
def magnet.Magnet.heat_switch | ( | self, | |
axis | |||
) |
This function enables heating of the PJSwitch, which is a necessary step to conduct current to the coils.
string | axis: desired axis (x, y, z) |
def magnet.Magnet.idle_magnet | ( | self | ) |
Cool all coils of the superconducting magnet to achieve maximum accuracy after aligning.
def magnet.Magnet.move_abs | ( | self, | |
param_dict | |||
) |
Moves stage to absolute position (absolute movement)
dict | param_dict: dictionary, which passes all the relevant parameters, that should be changed. Usage: {'axis_label': <the-abs-pos-value>}. 'axis_label' must correspond to a label given to one of the axis. In this case the axes are labeled 'rho', 'theta' and 'phi'. |
def magnet.Magnet.move_rel | ( | self, | |
param_dict | |||
) |
Moves stage in given direction (in spheric coordinates with theta and phi in radian)
dict | param_dict: dictionary, which passes all the relevant parameters, which should be changed. Usage: {'axis_label': <the-abs-pos-value>}. 'axis_label' must correspond to a label given to one of the axis. |
def magnet.Magnet.ramp | ( | self, | |
param_list = None |
|||
) |
function to ramp the magnetic field in the direction(s) to the target field values
list | param_list: This param is optional. If supplied it has to contain the labels for the axes, which should be ramped (only cartesian makes sense here), else all axes will be ramped. |
def magnet.Magnet.ramp_to_zero | ( | self, | |
axis | |||
) |
Function to ramp down a specific coil to zero current.
axis | string axis: (allowed inputs 'x', 'y' and 'z') |
def magnet.Magnet.set_magnet_idle_state | ( | self, | |
magnet_idle = True |
|||
) |
Set the magnet to couple/decouple to/from the control.
bool | magnet_idle: if True then magnet will be set to idle and each movement command will be ignored from the hardware file. If False the magnet will react on movement changes of any kind. |
def magnet.Magnet.set_velocity | ( | self, | |
param_dict | |||
) |
Function to change the ramp rate in T/s (ampere per second)
dict | contains as keys the different cartesian axes ('x', 'y', 'z') and the dict contains list of parameters, that have to be supplied. In this case this is segment, ramp_rate and maxval. How does this work? The maxval for the current marks the endpoint and in between you have several segments with differen ramp_rates. |
def magnet.Magnet.stop_hard | ( | self, | |
param_list = None |
|||
) |
function that pauses the heating of a specific coil depending on the elements in param_list.
list | param_list: Can contain elements 'x', 'y' or 'z'. In the case no list is supplied the heating of all coils is stopped |
def magnet.Magnet.target_field_setpoint | ( | self, | |
param_dict | |||
) |
Function to set the target field (in T), which will be reached through the function ramp(self, param_list).
dict | param_dict: Contains as keys the axes to be set e.g. 'x' or 'y' and the items are the float values for the new field generated by the coil of that axis. |
def magnet.Magnet.tell | ( | self, | |
param_dict | |||
) |
Send a command string to the magnet.
dict | param_dict: has to have one of the following keys: 'x', 'y' or 'z' with an appropriate command for the magnet |
def magnet.Magnet.transform_coordinates | ( | self, | |
param_dict | |||
) |
Function for generic coordinate transformation.
This is a refactoring to the old functions (4) to be replaced by just one function
dict | param_dict: contains a param_dict, which contains a list of values to be transformed. The transformation depends on the keys of the first and the second dictionary. Possible keys are: "deg", "rad", "cart" for example if the first key is deg and the second is cartesian then the values in the list will be transformed from deg to cartesian. |
Ordering of the values should be [x,y,z] (cartesian) or [rho, theta, phi] for deg or rad
def magnet.Magnet.translated_get_status | ( | self, | |
param_list = None |
|||
) |
Just a translation of the numbers according to the manual supplied by American Magnets, Inc.
list | param_list: string (elements allowed 'x', 'y' and 'z') for which the translated status should be returned. Can be None, then the answer is the same as for the list ['x','y','z'] |
def magnet.Magnet.utf8_to_byte | ( | self, | |
myutf8 | |||
) |
Convenience function for code refactoring.
string | myutf8 the message to be encoded |
def magnet.Magnet.wake_up_magnet | ( | self | ) |
Heat all coils of the superconducting magnet to get back to the working state.