Skip to main content

Python API for Nanosurf controllers and Nanosurf style application framework

Project description

Nanosurf Python library and application package

The Nanosurf Python package contains classes and functions for the following topics:

  • Remote control of Nanosurf Studio and classic Nanosurf Atomic-Force-Microscopes
  • A large number of general functions for data analysis
  • Application Framework to create powerful graphical applications based on QT
  • MacOS and Linux platform can use the library for off-line analysis
  • Multiple demo applications

Prerequisites

  • Python 3.9 up to 3.12 installed on Windows OS. Get the installation from 'python.org'
  • Nanosurf Studio or any classic Nanosurf controller software with 'Scripting Interface' option activated

Installation and upgrading

To install the package, open a Windows Command Prompt and run:

pip install nanosurf

To upgrade your nanosurf package to the newest version, open Windows Command Prompt and run:

pip install nanosurf -U

Running the examples

In the library, Nanosurf provides a documentation, demo scripts, applications for some hardware addons and templates to give you a quick start. They are in the nanosurf package sub folders "app" and "doc". But where are they on your system?

Depending on the exact installation of python, the package folders can be at very different places. Open Windows Command Prompt and type:

python 
>>> import nanosurf
>>> nanosurf.help()

The output of this command print the exact path to the app and doc folder.

We suggest to use Visual Studio Code as your IDE to run, write and debug your Python code. Use one of path to open the example scripts

AFM Software Programmers Manual

The classic Nanosurf AFM Control Software has a own programmers manual and can be found in the Scripting Manual in Nanosurf controller software under Help tab: Help -> Manuals -> Script Programmers Manual

Unfortunately the Nanosurf Studio application do not yet have its own programmers manual. But we are working hard to provide this soon.

Library Version History

  • v1.10.1

    • Update: Spectroscopy analysis scripts has improved fit ranges
    • Bugfix: Studio access to I2C-Bus failed
    • Bugfix: nhf_reader did not handle datasets with NaN values
    • Bugfix: nhf_reader converted small integer data ranges incorrect
  • v1.10.0

    • Python 3.13 support
    • update spm_template: support of continuos measurement, input/output channels and fixation of y-range
    • Bugfix: qt_framework was not shutting down modules properly and did not store last settings
  • v1.9.5

    • Bugfix: studio wrapper generator was not python 3.12 compatible
    • Limit installation of nanosurf library from 3.9 up to 3.12.
  • v1.9.4

    • Bugfix: nhf_reader.read_channel() could not be call multiple times correctly
    • Bugfix: nhf_reader.read_channel() channel with "int"-unit have now np.int32
  • v1.9.3

    • updated NHFFileReader class supports nhf-files version 2.1
    • Bugfix: Change list of shown items in NSFComboBox during runtime failed
  • v1.9.2

    • Update installation requirements to fulfill numpy 2.0 minimal library version
    • Bugfix: Change list of shown items in NSFComboBox during runtime failed
  • v1.9.1

    • Bugfix: AccessoryInterface class did not handle port-switching and slave-id readout properly
    • Bugfix: AppFramework: Module without screen could not be initialized properly
  • v1.9.0

    • Python 3.12 support
    • New: Spectroscopy analysis scripts with contact mechanics models
    • New: Control app for the DriveAFM TipAccess Addon
    • New: Control app for the DriveAFM TipCurrent Addon
    • New: Platform support for Linux and Mac: installation and usage of post processing functions are possible
    • updated NHFFileReader class supports now nhf-files version 2
    • updated pyinstaller template supports now scipy import in exe
    • updated documentation with installation guide, library overview and GUI-App programming
  • v1.8.6

    • Bugfix: Class AccessoryInterface did not work after update for Studio i2c support
    • Add option 'log_amp' to plot.plot_bode()
  • v1.8.5

    • Bugfix: Reloading of new Studio wrapper classes in first run did not work
    • Bugfix: sci_math.compress_spectrum() keep channel name intact
    • Add option 'log_y' to plot.plot_spectrum()
  • v1.8.4

    • Bugfix: add missing lupa files for pyinstaller
    • New: add I2C-Devices: MCP45XX, MAX1161x and MMA8451
  • v1.8.3

    • Bugfix: data scaling for channels without calibration factors
  • v1.8.2

    • New intro page for PyPi
  • v1.8.1

    • fix python version requirement check
  • v1.8.0

    • prevent installation with python 3.12 due to incompatible lupa package
    • add I2C class support for Studio
    • nanosurf.app/demo_wave_mode_nma_analysis: added Hertz model
  • v1.7.2

    • New: nanosurf.app/demo_wave_mode_nma_analysis: more options for file dialog
  • v1.7.1

    • Bugfix: Image Points/lines where swapped on gwy_export
  • v1.7.0

    • New: nanosurf.app/demo_wave_mode_nma_analysis: script which calculates max_force, adhesion and stiffness
    • New: nanosurf.lib.util.nhf_reader: Studio measurement files (*.nhf) reader
    • New: nanosurf.lib.util.nid_reader: Classic measurement files (*.nid) reader
    • New: nanosurf.lib.util.gwy_export: Gwyddion data file creator/exporter
    • New: nanosurf.app/py_installer_template: makes creating *.exe from python apps simple
  • v1.6.2

    • New: qt_app_framwork supports multi screen modules
    • Bugfix: settings should not be of dataclass type
  • v1.6.1

    • Bugfix: pip packaging did not copy framework files
  • v1.6.0

    • New: spm_template: A new template to demonstrate simple connection to CX/Studio and measure some data
    • New: app_DriveAFM_Tip_Current_Addon this app controls the amplifier of the Tip-Current Addon
    • New: demo_move_sample_stage. This demo shows basic stage movements
    • New: demo_lateral_force_signal_calibration. This demo shows how to calibrate the lateral force signal
    • New: nanosurf.plot. A package to easily plot data array from lists, numpy array, SciChannel and SciStream
    • New: nanosurf.spm.lowlevel.DataSamplerAccess. A class to make data sampling easier for CX/Studio
    • New: nanosurf.frameworks.qt_app: A framework to easily create nice Qt applications
    • Update: all applications are using the new qt_app framework of the library
    • Update: app_frequency_sweep: add logarithmic plotting capability
    • Bugfix: app_frequency_sweep: excitation mode was inverted
  • v1.5.1

    • Bugfix: Do not convert Lua arrays with string-keys
    • Bugfix: Improved Python enum conversion to Lua
  • v1.5.0

    • Library supports now python v3.11
    • Library supports now PySide2 and PySide6
  • v1.4.1

    • bugfix: Studio vector attributes are defined as .vector instead of .value
    • improve installation instruction for editable mode
  • v1.4.0

    • Add enum support for Nanosurf Studio scripting interface
    • Nanosurf Studio properties and LogicalUnits attributes have common interface style
    • Add revers ramp feature to App_Switching_Spectroscopy
    • Some small improvements to other applications
  • v1.3.4

    • fix bug in frequency_sweep
  • v1.3.3

    • Improve visual appearance of some nsf.gui elements
    • fix eeprom memory write access for i2c.chip_24LC34A
    • better return value for fileutil.create_unique_folder() in case of error
  • v1.3.2

    • Bugfix: Studio - handling of boolean properties was not working
    • Add support for DriveAFM Camera i2c-chip
  • v1.3.1

    • Bugfix: App_switching_spectroscopy - selection of output and amplitude setting had some issues
  • v1.3.0

    • Add simplifies library usage is possible. Just write 'import nanosurf as nsf' and full access to sub-libraries is provided in visual studio code
    • new app: app_switching_spectroscopy provides the possibility to measure in "Switching Spectroscopy"-Mode
    • new qui elements: nsf.gui.NSFEdit and nsf.gui.NSFComboBox
    • Bugfix: Wrong number type in Python for double based property
    • Bugfix: nsf.spm.workflow.frequency_sweep: PositionX/Y/Z was not working as output
  • v1.2.0

    • Add Studio scripting support
  • v1.1.0

    • Add direct I2C motor control
  • v1.0.0

    • Initial release

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nanosurf-1.10.1.tar.gz (12.4 MB view details)

Uploaded Source

Built Distribution

nanosurf-1.10.1-py3-none-any.whl (12.6 MB view details)

Uploaded Python 3

File details

Details for the file nanosurf-1.10.1.tar.gz.

File metadata

  • Download URL: nanosurf-1.10.1.tar.gz
  • Upload date:
  • Size: 12.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.0

File hashes

Hashes for nanosurf-1.10.1.tar.gz
Algorithm Hash digest
SHA256 d4074b763cab8b3230527ca41ba0cc6b85a1295c76791f3f9b5dd69756f32785
MD5 ec23bc301fc6827e5e13d3b0cd8339a0
BLAKE2b-256 d3ea7af5ec8a6a290975bf565f5911a2eb652404d71d0b064e90212e8010f6b2

See more details on using hashes here.

File details

Details for the file nanosurf-1.10.1-py3-none-any.whl.

File metadata

  • Download URL: nanosurf-1.10.1-py3-none-any.whl
  • Upload date:
  • Size: 12.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.0

File hashes

Hashes for nanosurf-1.10.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d63e06479db0053f4323f1dc0ec8fd287f904d9514cc1d751b6f7f8c9a0b370a
MD5 05915ba7826c38ce10baf29812518158
BLAKE2b-256 fde211f4a4b1fd1d896f1191f2ba14291db7cec6fc03545612c376a35a80246f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page