6. imd

class pyIMD.imd.InertialMassDetermination

Bases: PyQt5.QtCore.QObject

Constructs a IntertialMassDetermination object

concatenate_files(directory, time_interval, **kwargs)

Method to write concatenate data from single dat files (i.e data logger files from Nanonis software).

Parameters:
  • directory (str) – Directory containing files to concatenate.
  • time_interval (int) – Measurement time interval in milliseconds.
Keyword Arguments:
 

delimiter (str) – Delimiter to be used in the data file to separate columns.(i.e. , s) If empty it uses default given by settings.

Returns:

Writes concatenated data to single .csv file.

Return type:

file (void)

convert_data()

Converts imported data to correct units needed for further calculation.

create_pyimd_project(pre_start_no_cell_path, pre_start_with_cell_path, measurements_path, text_data_delimiter, read_text_data_from_line, calculation_mode, **kwargs)

Create a pyIMD project with the following arguments. Two modes enable the analysis of different experimental setups. PLL mode and Cont.Sweep mode. For more information please read the documentation.

Parameters:
  • pre_start_no_cell_path (str) – File path + file name of initial frequency shift measurement before cell attachment (txt file).
  • pre_start_with_cell_path (str) – File path + file name of initial frequency shift measurement after cell attachment (txt file).
  • measurements_path (str) – File path + file name of the actual measurement (tdms file (default) or txt file).
  • text_data_delimiter (str) – Text file data delimiter i.e ‘ ‘ for tab delimited or ‘,’ for comma separated data.
  • read_text_data_from_line (int) – Line number from which data of pre start measurements should be read Typically the first few lines contain header information and no data.
  • calculation_mode (str) – PLL := phase lock loops mode Cont.Sweep := sweep mode Auto := Auto detection of the mode (experimental)
Keyword Arguments:
 
  • figure_width (float) – Width of result figures
  • figure_height (float) – Height of result figures
  • figure_units (str) – Figure units i.e cm, inch
  • figure_format (str) – Figure format i.e png or pdf
  • figure_resolution_dpi (int) – Resolution of result figures in dpi
  • figure_name_pre_start_no_cell (str) – Figure name of function fit for pre start with no cell loaded data
  • figure_name_pre_start_with_cell (str) – Figure name of function fit for pre start with cell loaded data
  • figure_name_measured_data (str) – Figure name of the resulting mass of the measured data
  • figure_plot_every_nth_point ('int') – Parameter defining how many data points will be plotted. For large data stets to increase readability and reducing file size.
  • conversion_factor_hz_to_khz (float) – Conversion factor to convert from hertz to kilo hertz
  • conversion_factor_deg_to_rad (float) – Conversion factor to convert from degrees to radian
  • spring_constant (float) – Spring constant value of the cantilever
  • initial_parameter_guess (list) – Initial parameter guess
  • lower_parameter_bounds (list) – Lower parameter bounds
  • upper_parameter_bounds (list) – Upper parameter bounds
  • rolling_window_size ('int') – Window size for calculating the rolling average.
  • correct_for_frequency_offset ('bool') – Correct for potential frequency offset during PLL mode.
  • frequency_offset_mode ('str') – Frequency offset correction mode (Auto or Manual)
  • frequency_offset_n_measurements_used ('int') – Number of measurement data points to be used for automatic frequency offset correction
  • frequency_offset ('float') – Frequency offset either set manually or calculated automatically
  • cantilever_length (float) – Cantilever length in microns
  • cell_position (float) – Cell position offset from cantilever tip in microns
  • project_folder_path (str) – Path to project data files. Also used to store pyIMD results such as data and figures.
establish_console_connection()

Establish console connection between the imd object and the settings dialog.

static get_logger_object(name)

Gets a logger object to log messages of pyIMD status to the console in a standardized format.

Returns:Returns a logger object with correct string formatting.
Return type:logger (object)
handle_change_console_text(string)
Parameters:string (str) – String received from Settings instance to print to the console.
load_pyimd_project(file_path)

Loads a pre defined pyIMD project form a XML file.

Parameters:file_path (str) – Full path + file name to the pyIMD project file.
Returns:String reporting the success of failure of loading a pyIMD project.
Return type:status (str)
on_settings_changed(changed_settings)

Update settings

print_pyimd_project()

Prints the current pyIMD settings and parameters to the console.

Returns:pyIMD settings and parameter summary as formatted string.
Return type:pyIMD project summary (str)
run_batch_inertial_mass_determination(*args)

Runs the inertial mass determination calculation in batch mode. Specify one or multiple pyIMD project files which will be run sequentially. NOTE: In a future release this will be parallelized using multiple threads to perform the calculations in parallel to gain speed. Currently the focus is not on speed but the idea is to analyze many experiments conveniently over night for example.

Parameters:args (list) – List of one or many file paths + file names to valid pyIMD project files.
Returns:Returns result structured in a pandas data frame and saves function fit plots as pdf files.
Return type:void
run_inertial_mass_determination()

Runs the inertial mass determination calculation

Returns:Returns result structured in a pandas data frame and saves function fit plots as pdf or png files directly to the disk.
Return type:void
save_pyimd_project(file_path)

Saves the current pyIMD project as XML file.

Parameters:file_path (str) – Full path + file name to the pyIMD project file.
Returns:String reporting the success of failure of loading a pyIMD project.
Return type:status (str)
show_settings_dialog()

Shows the settings dialog in a pop up window.