API references

Help Functions

class utilities.help_functions[source]

Helpfull function is a multipurpose class with a variety of function and tasks. It contains functions regarding error handling an file generation as well as generating ramps (e.g. for bias ramps) For more information see he docs for the functions itself

class CAxisTime(orientation, pen=None, linkView=None, parent=None, maxTickLength=-5, showValues=True)[source]

Over riding the tickString method by extending the class

int2dt(ts_mult=1000.0)[source]

Convert seconds value into datatime struct which can be used for x-axis labeeling

tickStrings(values, scale, spacing)[source]

Generate the string labeling of X-axis from the seconds value of Y-axis

close_file(file)[source]

Closed the file specified in param file

create_new_file(filename='default.txt', filepath='default_path', os_file=True, suffix='.txt')[source]

Simply creates a file

Parameters:
  • filename
  • filepath
  • os_file
  • suffix
Returns:

flush_to_file(file, message)[source]

Flushes data to a opend file Only strings or numbers allowed, Lists will work too but may cause data scrambling Only use this with created files from function ‘create_new_file’

get_thicks_for_timestamp_plot(time_array, max_number_of_thicks=10, format='%H:%M:%S')[source]

This gives back a list of tuples for the thicks

get_timestring_from_int(time_array, format='%H:%M:%S')[source]

Converts int time to timestring

int2dt(ts, ts_mult=1000.0)[source]

Convert seconds value into datatime struct which can be used for x-axis labeeling

open_file(filename='default.txt', filepath='default_path')[source]

Just opens a file and returns the file pointer

Returns:File
raise_exception(method)[source]

Intended to be used as decorator for pyQt functions in the case that errors are not correctly passed to the python interpret

ramp_voltage(VisaResource, instrument, order_code, max_value, ramp_steps, time_to_wait, ramp_up=True)[source]

Deprecated This function ramps a value by sending commands after a timeout. Usage, ramping voltage for a device

Parameters:
  • VisaResource – Device which gets the commands
  • instrument
  • order_code – Code which has to be send
  • max_value – Maximum value from where to be ramped
  • ramp_steps – Stepssize
  • time_to_wait – waitingtime
  • ramp_up – Whether or not to ramp from abs up or down
Returns:

ramp_voltage_job(queue, resource, order, voltage_Start, voltage_End, step, wait_time=0.2, complience=0.0001)[source]

Only use this function for simple ramping for the main, never inside a measurement!!!

read_from_file(filename='default.txt', filepath='default_path')[source]

Gives you the content of the file in an list, each list entry is one line of the file (datatype=string) Warning: File gets closed after reading

run_with_lock(method)[source]

Intended to be used as decorator for functions which need to be threadsave. Warning: all functions acquire the same lock, be carefull.

timeit(method)[source]

Intended to be used as decorator for functions. It returns the time needed for the function to run

Parameters:method – method to be timed
Returns:time needed by method
write_init_file(name, data, path='')[source]

This function writes init files for devices and default files

Parameters:
  • name – Name of the file to be written to
  • data – Data in Dict format
  • path – Path where to write
Returns:

write_to_file(content, filename='default.txt', filepath='default_path')[source]

This writes content to a file. Be aware, input must be of type ‘list’ each entry containing the information of one line

New Thread

class utilities.newThread(threadID, name, object__, *args)[source]

Creates new threads easy, it needs the thread ID a name, the function/class, which should run in a seperated thread and the arguments passed to the object

__init__(threadID, name, object__, *args)[source]
Parameters:
  • threadID – ID the thread should have
  • name – Give the thread a name you want
  • object – The object which should run in the new thread
  • args – Arguments passed to object__
get()[source]

returns the Object

run()[source]

Starts running the thread

LOG File

class utilities.LogFile(logging_level='debug')[source]

This class handles the Logfile for the whole framework

get_logging_level()[source]

Checks the logging level input. If it is a string -> convert. Otherwise, do nothing

Framework

class utilities.Framework(values_from_GUI)[source]

Generall class for handling all Framework related tasks, like updating the GUI etc.

start_timer()[source]

Simply starts the timer

Returns:timer
update_()[source]

Periodically updates the functions in self.functions list

Returns:None

Transformation

class utilities.transformation[source]

Class which handles afine transformations in 3 dimensions for handling sensor to jig coordinate systems

vector_trans(v, T, V0)[source]

This function transforms a Vector from the sensor system to the table system by vs*T+V0=vt

Measurement Job Generation

class utilities.measurement_job_generation(main_variables, queue_to_measurement_event_loop)[source]

This class handles all measurement generation items

generate_IVCV(header)[source]

This function generates all that has to do with IV or CV :param header: An additional header :return: the job dictionary

generate_job(additional_settings_dict)[source]

This function handles all the work need to be done in order to generate a job :param additional_settings_dict: If any additional settings are in place

generate_strip(header)[source]

This function generate all tha has to do with strip scans :param header: Additional header :return: strip job dictionary

Table control

class utilities.table_control_class(main_variables, device, queue_to_GUI, shell)[source]

This class handles all interactions with the table. Movement, status etc. This class is designed to be running in different instances.

check_if_ready(timeout=0, maxcounter=-1)[source]

This function checks if the movement of the table is done or not :param timeout: Timeout how long to wait between the attempts :param maxcounter: How often does the function try to get an answer, -1 infinite :return: 0 if ok error if not

check_position(desired_pos)[source]

This function checks if two positions are equal or not

Parameters:desired_pos – The position it should be
Returns:0 if ok error if not
get_current_position()[source]

Queries the current position of the table and writes it to the state machine

initiate_table()[source]

This function triggers the table initiation

Returns:0 if ok error if not
move_down(lifting)[source]

This function moves the table down

Parameters:lifting – hight movement
Returns:none or errorcode
move_to(position, move_down=True, lifting=800, relative_move=False)[source]

This function moves the table to the desired position. position is a list of coordinates The move down parameter can prohibits a down and up movement with the move, !!!!USE WITH CARE!!!!

Returns:None or errorcode
move_to_strip(pad_file, strip, transfomation_class, T, V0, height_movement=800)[source]

Moves to a specific strip

Parameters:
  • transfomation_class
  • height_movement – How much should the table move down
Returns:

None or errorcode

move_up(lifting)[source]

This function moves the table up

Parameters:lifting – hight movement
Returns:none or errorcode
relative_move_to(position, move_down=True, lifting=800)[source]

This function moves the table to the desired position (relative). position is a list of coordinates The move down parameter can prohibit a down and up movement with the move, !!!!USE WITH CARE!!!!

Returns:none or error code
set_axis(axis_list)[source]

This sets the axis on or off. axis_list must contain a list of type [x=bool, y=bool, z=bool]

set_joystick_speed(speed)[source]

This sets the speed for the joystick

stop_move()[source]

This function stops the table movement immediately

Switching control

class utilities.switching_control(settings, devices, queue_to_main, shell)[source]

This class handles all switching controls of all switching matrices

apply_specific_switching(switching_dict)[source]

This function takes a dict of type {“Switching”: [/switch nodes], ….} and switches to these specific type

build_command(device, command_tuple)[source]

Builds the command correctly, so that device recognise the command

Parameters:
  • device – device dictionary
  • command_tuple – command, value
check_switching_action()[source]

Checks what channels are closed on all switching devices

pick_switch_response(device, current_switching)[source]

This function picks the string response and returns a list. :param current_switching: is a string containing the current switching

reset_switching(device='all')[source]

This function resets all switching or one device switching :param device: all oder device object:

switch_to_measurement(measurement)[source]

This function switches all switching systems to a specific measurement type

Parameters:measurement – string e.g. “IV”, “CV” must be defined in the switching dict
Returns:true or false, so if switching was successfull or not