PySSFPM is a specific tool developed in Python dedicated to perform data analysis on SSPFM (Switching Spectroscopy Piezoresponse Force Microscopy) measurements with a GUI that aims to be as simple to use as possible and complete to accommodate the user's measurement requirements and conditions. The source code was developed to be easily customizable in order to meet the user's specific needs. Measurements can be processed in both standard SSPFM including fixed-frequency measurements on or off resonance, or with frequency sweeping to reconstruct the resonance peak, as well as SSPFM-DFRT (Dual Frequency Resonance Tracking) mode.
This library is provided in its current state and remains under active development. The motivation behind the creation of the new PySSPFM application for SSPFM measurement processing stemmed from several factors :
• There was a desire to offer the scientific community in the PFM domain an open-source solution that is easily comprehensible, adaptable, and customizable according to individual requirements. All developments adhere to the PEP-8 development standard and are accompanied by comprehensive, internal script documentation.
• PySSPFM has been developed with the aim of achieving the most quantitative and advanced measurement processing compared to other existing solutions.
However, while it has shown reliable performance with the data used by the library's developer, it's crucial to emphasize that there are no assurances that this library will seamlessly process your unique data. Moreover, it should be noted that in order to extract data from a Bruker SPM file, DLL (Dynamic Link Library) files must be installed alongside the Nanoscope Analysis software (Bruker).
If you encounter any bugs or issues, you can kindly bring them to the developer's attention by visiting: PySSPFM issues.
PySSPFM facilitates the processing of a set of SSPFM measurement data points by simply populating a measurement form (template for: measurement sheet model SSPFM). The range of measurement files to be processed may have the extensions:
• .spm
(Bruker)
• .txt
• .csv
• .xlsx
For each of the SSPFM measurement files, amplitude and phase are extracted for each segment using a user-selected method:
• max
: extract maximum or resonance peak (for frequency sweep mode)
• fit
: perform a fit of the resonance peak based on SHO (Simple Harmonic Oscillator) model (for frequency sweep mode)
• single_freq
: mean of the segment (for single frequency mode, in or out of resonance)
• dfrt
: mean of the segment (for DFRT mode)
The measurements are then automatically calibrated, and the piezoresponse hysteresis is created. It is subsequently fitted using an algorithm based on the lmfit library, and the piezoelectric and ferroelectric properties are extracted. Five different artifact decorrelation protocols (quadratic components: electrostatic, electrostrictive, and joules effects) allow for obtaining quantitative piezoelectric and ferroelectric measurements and for acquiring a more comprehensive understanding of material properties, such as the contact surface potential.
Once the processing is complete for all the files, maps are generated. 2D interpolation tools and masks to mitigate the influence of problematic pixels are also available.
Finally, a toolbox is provided for the analysis of processing results: it includes algorithms of:
• Machine learning (K-Means, GMM, PCA)
• Phase separation
• Mapping cross-correlation
• SPM file converter
• ...
See the documentation for more details on PySSPFM workflow.
All code executed and parameter adjustments made through the GUI can be replicated in executable scripts:
• Data Processing
• Toolbox
Then, user can adjust parameters directly either in a pre-filled json file, in a toml file or in the excecutable python code.
You can check the examples (based on both real and simulated SSPFM measurements) to grasp the utilization of the scripts, and the tests to ensure the proper functioning of the scripts. The examples and tests follow the same directory structure as the main PySSPFM scripts.
See the documentation for more details on PySSPFM usage.
pip install PySSPFM
poetry add git+https://github.com/CEA-MetroCarac/PySSPFM.git
pip install git+https://github.com/CEA-MetroCarac/PySSPFM.git
• pytest to run tests python files.
• toml to load user parameters directly from toml file, for excecutable python script.
• Nanoscope Analysis software (Bruker) installed on computer to extract data from SSPFM Bruker measurement files (spm extension).
In the case you use this library for your work, please think about citing it:
• H. Valloire, P. Quéméré, N. Vaxelaire, H. Kuentz, G. Le Rhun, Ł. Borowik, "Enhancing ferroelectric characterization at nanoscale: A comprehensive approach for data processing in spectroscopic piezoresponse force microscopy", J. Appl. Phys, 21 May 2024, 135 (19): 194101, DOI: https://doi.org/10.1063/5.0197226
• Hugo Valloire, Patrick Quemere, 2024, May 22, PySSPFM (Version 2024.06).