From e2e3b62f16ba5a639a3b1fd5d08c81dfe230d322 Mon Sep 17 00:00:00 2001 From: hugoval <76450221+yudgugger@users.noreply.github.com> Date: Thu, 23 May 2024 11:13:15 +0200 Subject: [PATCH] Update README.md --- doc/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/README.md b/doc/README.md index 10a87d62..28c1c3f8 100644 --- a/doc/README.md +++ b/doc/README.md @@ -1600,7 +1600,7 @@ User parameters:

-The measurement parameters are extracted from the SSPFM measurement sheet, and each of the raw SSPFM measurement files is subsequently analyzed within the multi_script function. The single_script function analyzes a single raw SSPFM data file by following these steps: measurements are extracted from the file and calibrated if necessary. They are then segmented and processed into PFM data for each segment. The PFM phase signal is analyzed using the phase_offset_determination function of the utils/nanoloop/phase.py script, both in On Field and Off Field conditions. During this analysis, a phase offset is determined, and the two main peaks are identified and recentered within the phase measurement range. For instance, if the phase value range extends from -180 to 180°, and the two peaks are spaced by 180°, a phase offset will be calculated to position them at -90 and 90°, respectively. This minimizes phase switching across all measurements. Ideally, the phase offsets determined in On and Off Field conditions should be close. The average offset corresponding to the entire measurement file is determined using the mean_phase_offset function of the utils/nanoloop/phase.py script. The phase evolution with respect to the measurement file is generated using the generate_graph_offset function. It should be noted that the case of unipolar phase data (a single peak on the phase histogram) can be handled by the script functions. Typically, this script is used before the first step of processing SSPFM measurements in order to generate the file containing the phase offset value to apply to measurement before the treatment processing. +The measurement parameters are extracted from the SSPFM measurement sheet, and each of the raw SSPFM measurement files is subsequently analyzed within the multi_script function. The single_script function analyzes a single raw SSPFM data file by following these steps: measurements are extracted from the file and calibrated if necessary. They are then segmented and processed into PFM data for each segment. The PFM phase signal is analyzed using the phase_offset_determination function of the utils/nanoloop/phase.py script, both in On Field and Off Field conditions. During this analysis, a phase offset is determined, and the two main peaks are identified and recentered within the phase measurement range. For instance, if the phase value range extends from -180 to 180°, and the two peaks are spaced by 180°, a phase offset will be calculated to position them at -90 and 90°, respectively. This minimizes phase switching across all measurements. Ideally, the phase offsets determined in On and Off Field conditions should be close. The average offset corresponding to the entire measurement file is determined using the mean_phase_offset function of the utils/nanoloop/phase.py script. The phase evolution with respect to the measurement file is generated using the generate_graph_offset function. It should be noted that the case of unipolar phase data (a single peak on the phase histogram) can be handled by the script functions. The list of phase offset values can then be saved using the save_dict_to_txt function from the script. Typically, this script is used before the first step of processing SSPFM measurements in order to generate the file containing the phase offset value to apply to measurement before the treatment processing.

@@ -1676,7 +1676,7 @@ User parameters:

-The measurement parameters are extracted from the SSPFM measurement sheet, and each of the raw SSPFM measurement files is subsequently analyzed within the multi_script function. The single_script function analyzes a single raw SSPFM data file by following these steps: measurements are extracted from the file and phase offset is applied if necessary. A list of phase offsets for each file can be applied with the phase_file_path parameter, containing the path of a file generated with the gui/phase_offset_analyzer.py script, otherwise, a value can be specified with the offset parameter. They are then segmented and processed into PFM data for each segment. For each mode (On and Off Field), the sign of the phase signal gradient with the writing voltage is determined using the phase_bias_grad function from the utils/nanoloop/phase.py script. The two values are compared to determine if a phase inversion has occurred between the On and Off Field modes. Typically, this script is used before the second step of processing SSPFM measurements in order to generate the file containing the boolean value of the main electrostatic parameter to apply to the measurement before the treatment processing. +The measurement parameters are extracted from the SSPFM measurement sheet, and each of the raw SSPFM measurement files is subsequently analyzed within the multi_script function. The single_script function analyzes a single raw SSPFM data file by following these steps: measurements are extracted from the file and phase offset is applied with apply_phase_offset of the script, if necessary. A list of phase offsets for each file can be applied with the phase_file_path parameter, containing the path of a file generated with the gui/phase_offset_analyzer.py script, otherwise, a value can be specified with the offset parameter. They are then segmented and processed into PFM data for each segment. For each mode (On and Off Field), the sign of the phase signal gradient with the writing voltage is determined using the phase_bias_grad function from the utils/nanoloop/phase.py script. The two values are compared with the revert_on_off function from the script to determine if a phase inversion has occurred between the On and Off Field modes. Typically, this script is used before the second step of processing SSPFM measurements in order to generate the file containing the boolean value of the main electrostatic parameter, using the save_dict_to_txt function from the script, to apply to the measurement before the treatment processing.

@@ -2158,7 +2158,7 @@ The entire assemblage of scripts under the figure.py, which facilitates the generation of visual representations in a consistent style. This encompasses the creation of graphs, histograms, and mappings through the functions plot_graph, plot_hist, and plot_map. The print_plots function offers advanced control over the display and storage of visual representations.
fitting.py, which is responsible for executing all fits (excluding hysteresis fitting) based on the minimize function of lmfit library. Fit methods like least_sq, least_square (prioritizing speed), or nelder (prioritizing convergence) can be selected with the fit_method setting. Model and Parameters objects of lmfit are likewise employed, respectively, for the amalgamation of model functions (e.g., adding an affine or constant component that may correspond to noise) and for the management of parameter initialization prior to the fitting process (initial value, range of variation, etc.). It includes a parent class CurveFit and three subclasses, namely GaussianPeakFit, ShoPeakFit, and ShoPhaseFit, each built upon the parent class to execute Gaussian, Sho, and Sho phase (arctangent) fitting, respectively. The parent class incorporates a set of methods shared by the subclasses, including eval for evaluating the fitted peak at specified x-values, fit, plot, and more. The subclasses invoke the parent class during initialization and enable parameter initialization for fitting, with model-specific initial guesses.
iterable.py for handling iterables.
-• multi_proc.py for multi processing functions. If multi_processing setting is active, multi processing is used for datacube_to_nanoloop_s1.py, nanoloop_to_hyst_s2.py and phase_offset_analyzer.py.
+• multi_proc.py for multi processing functions. If multi_processing setting is active, multi processing is used for datacube_to_nanoloop_s1.py, nanoloop_to_hyst_s2.py, phase_offset_analyzer.py and phase_inversion_analyzer.py.
noise.py for noise management. The filter_mean function serves as a filtering mechanism for averaging, offering a choice of filter order to reduce measurement noise. The noise function is used to generate noise of a specific amplitude (widely employed for examples and tests to recreate the most realistic data) using three possible distribution models: uniform, normal, and laplace. Finally, the butter_filter function filters an input signal with a Butterworth filter type ('low', 'high', 'bandpass', or 'bandstop'), along with its associated cutoff frequency or frequencies, and its order.
path_management.py for path management. The function get_filenames_with_conditions allows for the extraction of a list of file names from a directory, with the possibility of adding conditions on a prefix or a suffix. The function gen_bruker_filenames enables the generation of file names in the format used by Bruker, such as string.0_00000.ext. Finally, the function sort_filenames sorts a list of file names by automatically extracting any index included in the file name.
peak.py contains a set of functions for peak handling. detect_peak and find_main_peaks automatically identify peaks in an array of values, relying on the find_peaks function from the scipy.signal library. The function plot_main_peaks allow to plot an array of peaks. It also includes functions for guessing noise components (linear component with guess_affine and constant with guess_bckgnd) and determining peak width with width_peak.