2. configuration¶
-
class
pyIMD.configuration.config.
Settings
¶ Bases:
object
Settings initialization with default parameter values stored in pyIMD.configuration.defaults
-
calculation_mode
¶ Parameter defining the calculation mode.
Parameters: mode (str) – The calculation mode. PLL, Cont.Sweep or Auto.
-
cantilever_length
¶ Parameter defining the cantilever length.
Parameters: cantilever_length (float) – Cantilever length in microns.
-
cell_position
¶ Parameter defining the cell position offset.
Parameters: cell_position (float) – Cell position offset in microns from the free end of the cantilever.
-
conversion_factor_deg_to_rad
¶ Parameter defining the data conversion factor from degrees to radians.
Parameters: factor (float) – Data conversion factor from degrees to radians.
-
conversion_factor_hz_to_khz
¶ Parameter defining the data conversion factor from Hz to kHz.
Parameters: factor (float) – Data conversion factor from hertz to kilo hertz.
-
correct_for_frequency_offset
¶ Parameter defining if PLL measurement data should be corrected for a potential frequency offset between the frequency pre start measured after a cell is attached to the cantilever and the actual measurement.
Parameters: correction (boolean) – Boolean. False by default. True runs in the PLL case a frequency offset correction.
-
figure_format
¶ Parameter defining the result figure(s) format.
Parameters: unit (str) – Pdf and png ar currently supported.
-
figure_height
¶ Parameter defining the result figure(s) height.
Parameters: height (float) – Figure height in the unit specified.
-
figure_name_measured_data
¶ Parameter defining the figure name for resulting calculated mass of the measured data.
Parameters: name (str) – Figure name for resulting calculated mass of the measured data.
-
figure_name_pre_start_no_cell
¶ Parameter defining the figure name for the function fit pre start no cell.
Parameters: name (str) – Figure name for the function fit pre start no cell.
-
figure_name_pre_start_with_cell
¶ Parameter defining the figure name for the function fit pre start with cell.
Parameters: name (str) – Figure name for the function fit pre start with cell.
-
figure_plot_every_nth_point
¶ Parameter defining how many data points are used for visualization. For very large data sets a number > 1 could increase the readability of the figure and lower the file size.
Parameters: nth_point (int) – Pdf and png ar currently supported.
-
figure_resolution_dpi
¶ Parameter defining the result figure(s) resolution in dpi.
Parameters: resolution (int) – Figure resolution. E.g. 72, 150, 300.
-
figure_units
¶ Parameter defining the result figure(s) unit.
Parameters: unit (str) – Figure unit. E.g. mm, cm, in.
-
figure_width
¶ Parameter defining the result figure(s) width.
Parameters: width (float) – Figure width in the unit specified.
-
frequency_offset
¶ Parameter defining the frequency offset.
Parameters: freq_offset (int) – Frequency offset with which the measurement data will be corrected with.
-
frequency_offset_mode
¶ Parameter defining the mode to be used to calculate the frequency offset. This applies only to in PLL recorded data.
Parameters: mode (str) – Mode for frequency offset calculation. Either Auto or Manual.
-
frequency_offset_n_measurements_used
¶ Parameter defining how many data points of the measurement should be used to calculate the average frequency offset.
Parameters: n_measurements (int) – Number of measurement data points to be used to calculate the average freq. offset.
-
initial_parameter_guess
¶ Parameter defining the initial parameter guess.
Parameters: array (list) – Initial parameter guess.
-
lower_parameter_bounds
¶ Parameter defining the lower parameter bounds.
Parameters: array (list) – Lower parameter bounds.
-
measurements_path
¶ Parameter defining the path to the measurement file.
Parameters: path (str) – Path to the measurement file. (.tdms or .txt file).
-
new_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 new 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.
-
pre_start_no_cell_path
¶ Parameter defining the path to the pre start no cell file.
Parameters: path (str) – Path to the pre start no cell file (.txt).
-
pre_start_with_cell_path
¶ Parameter defining the path to the pre start with cell file.
Parameters: path (str) – Path to the pre start with cell file (.txt).
-
project_folder_path
¶ Parameter defining the path to the files.
Parameters: path (str) – The path to the files.
-
read_pyimd_project
(file_path)¶ Read a pre defined pyIMD project form a XML file from disk.
Parameters: file_path (str) – Returns: String reporting the success of failure of loading a pyIMD project. Return type: status (str)
-
read_text_data_from_line
¶ Parameter defining the length of the header inside the initial sweep files. From this line number the data will be imported.
Parameters: line_number (int) – Line number from where on to read the data from.
-
rolling_window_size
¶ Parameter defining the window size of the rolling window applied to the data for visualizing the trend.
Parameters: window_size (int) – Rolling window size.
-
selected_files
¶ Parameter defining the selected files for calculation.
Parameters: files (list) – Selected files for calculation.
-
spring_constant
¶ Parameter defining the spring constant of the cantilever.
Parameters: spring_constant (float) – Spring constant of the cantilever.
-
text_data_delimiter
¶ Parameter defining the text file data delimiter.
Parameters: delimiter (str) – Text file data delimiter i.e ‘ ‘ for tab delimited or ‘,’ for comma separated data.
-
upper_parameter_bounds
¶ Parameter defining the upper parameter bounds.
Parameters: array (list) – Upper parameter bounds.
-
write_pyimd_project
(file_path)¶ Write the current pyIMD project as XML file to disk. :param file_path: :type file_path: str
Returns: String reporting the success of failure of loading a pyIMD project. Return type: status (str)
-