nanosurf


Namenanosurf JSON
Version 1.2.3 PyPI version JSON
download
home_page
SummaryPython API for Nanosurf controllers
upload_time2022-08-04 09:56:30
maintainer
docs_urlNone
authorNanosurf AG
requires_python>=3.9
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Python API for Nanosurf controllers

Package for data acquisition and control of Nanosurf atomic force microscopes.

![Nanosurf Python](https://www.nanosurf.com/images/logos/nsf_python.png)

### Prerequisites

* Python >=3.9 installed on Windows OS.
* A Nanosurf controller software running and a controller connected to the PC.
* Nanosurf Scripting Interface option activated

### Installation and upgrading

Assuming that a Python interpreter is already installed on your PC.

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
```

If for some reason pip does not work, unzip the content of the package
into a folder and in this folder run:
```
python setup.py install
```

### Get help, where are the examples ?

In the library, Nanosurf provides a documentation, some script demos and full fledged application templates to give you a quick start.
But where are these files placed after the installation?

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.

Therefore, the nanosurf package provides a command shell script to help you:

Open Windows Command Prompt and type:
```
nanosurf_help
```

The output of this command print the exact path to the app and doc folder.
Use this path to open the example scripts in Visual Studio Code (or any other python IDE) and run them.

If this shell script does not run you can do it manually:
Open Windows Command Prompt and type:
```
python 
>>> import nanosurf
>>> nanosurf.help()
```

Open the examples in Visual Studio Code (or any other python IDE) and run them

### Usage Example
```
import nanosurf

spm = nanosurf.SPM()  # or .C3000() or .CX(), or .CoreAFM()
application = spm.application

scan = application.Scan
opmode = application.OperatingMode
approach = application.Approach
zcontrol = application.ZController
head = application.ScanHead

# Set file mask
mask = "TestSample-"
application.SetGalleryHistoryFilenameMask(mask)

# Choose cantilever
head.CantileverByGUID = spm.CantileverGUID.Dyn190Al

# Operating mode
opmode.OperatingMode = spm.OperatingMode.DynamicAFM
opmode.VibratingAmpl = 0.5 # [V] 

# Set scan parameters
scan.ImageWidth = 5e-6 # [m]
scan.ImageHeight = 5e-6 # [m]
scan.Scantime = 0.55 # s
scan.Points = 256 # points per line
scan.Lines = 256 # lines
scan.CenterPosX = 10e-6 # [m]
scan.CenterPosY = 10e-6 # [m]
scan.SlopeX = 0.0 # degree
scan.SlopeY = 0.0 # degree
scan.Overscan = 5 #%

# Set Z controller parameters
zcontrol.SetPoint = 70 # [%]
zcontrol.PGain = 3100
zcontrol.IGain = 3500

# Start scan
scan.StartFrameUp()

# Check if scanning
scanning = scan.IsScanning
print(scanning)

# Stop scan
scan.Stop()

# Get image
scan.StartCapture()

del spm

```

### Scripting Manual

Full list of objects and methods can be found in the Scripting Manual
in Nanosurf controller software under Help tab:
Help -> Manuals -> Script Programmers Manual, or [here](https://www.nanosurf.com/downloads/programmers-manual.pdf).


### License
[MIT License](https://en.wikipedia.org/wiki/MIT_License)

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "nanosurf",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "",
    "author": "Nanosurf AG",
    "author_email": "scripting@nanosurf.com",
    "download_url": "https://files.pythonhosted.org/packages/bb/d6/a326a2010c5679723cb8c0edf70458aa9f92da843eb8adf14884fad6dffc/nanosurf-1.2.3.tar.gz",
    "platform": null,
    "description": "# Python API for Nanosurf controllers\n\nPackage for data acquisition and control of Nanosurf atomic force microscopes.\n\n![Nanosurf Python](https://www.nanosurf.com/images/logos/nsf_python.png)\n\n### Prerequisites\n\n* Python >=3.9 installed on Windows OS.\n* A Nanosurf controller software running and a controller connected to the PC.\n* Nanosurf Scripting Interface option activated\n\n### Installation and upgrading\n\nAssuming that a Python interpreter is already installed on your PC.\n\nTo install the package, open a Windows Command Prompt and run:\n```\npip install nanosurf\n```\n\nTo upgrade your nanosurf package to the newest version,\nopen Windows Command Prompt and run:\n```\npip install nanosurf -U\n```\n\nIf for some reason pip does not work, unzip the content of the package\ninto a folder and in this folder run:\n```\npython setup.py install\n```\n\n### Get help, where are the examples ?\n\nIn the library, Nanosurf provides a documentation, some script demos and full fledged application templates to give you a quick start.\nBut where are these files placed after the installation?\n\nThey are in the nanosurf package sub folders \"app\" and \"doc\". \nBut where are they on your system?\n\nDepending on the exact installation of python, the package folders can be at very different places.\n\nTherefore, the nanosurf package provides a command shell script to help you:\n\nOpen Windows Command Prompt and type:\n```\nnanosurf_help\n```\n\nThe output of this command print the exact path to the app and doc folder.\nUse this path to open the example scripts in Visual Studio Code (or any other python IDE) and run them.\n\nIf this shell script does not run you can do it manually:\nOpen Windows Command Prompt and type:\n```\npython \n>>> import nanosurf\n>>> nanosurf.help()\n```\n\nOpen the examples in Visual Studio Code (or any other python IDE) and run them\n\n### Usage Example\n```\nimport nanosurf\n\nspm = nanosurf.SPM()  # or .C3000() or .CX(), or .CoreAFM()\napplication = spm.application\n\nscan = application.Scan\nopmode = application.OperatingMode\napproach = application.Approach\nzcontrol = application.ZController\nhead = application.ScanHead\n\n# Set file mask\nmask = \"TestSample-\"\napplication.SetGalleryHistoryFilenameMask(mask)\n\n# Choose cantilever\nhead.CantileverByGUID = spm.CantileverGUID.Dyn190Al\n\n# Operating mode\nopmode.OperatingMode = spm.OperatingMode.DynamicAFM\nopmode.VibratingAmpl = 0.5 # [V] \n\n# Set scan parameters\nscan.ImageWidth = 5e-6 # [m]\nscan.ImageHeight = 5e-6 # [m]\nscan.Scantime = 0.55 # s\nscan.Points = 256 # points per line\nscan.Lines = 256 # lines\nscan.CenterPosX = 10e-6 # [m]\nscan.CenterPosY = 10e-6 # [m]\nscan.SlopeX = 0.0 # degree\nscan.SlopeY = 0.0 # degree\nscan.Overscan = 5 #%\n\n# Set Z controller parameters\nzcontrol.SetPoint = 70 # [%]\nzcontrol.PGain = 3100\nzcontrol.IGain = 3500\n\n# Start scan\nscan.StartFrameUp()\n\n# Check if scanning\nscanning = scan.IsScanning\nprint(scanning)\n\n# Stop scan\nscan.Stop()\n\n# Get image\nscan.StartCapture()\n\ndel spm\n\n```\n\n### Scripting Manual\n\nFull list of objects and methods can be found in the Scripting Manual\nin Nanosurf controller software under Help tab:\nHelp -> Manuals -> Script Programmers Manual, or [here](https://www.nanosurf.com/downloads/programmers-manual.pdf).\n\n\n### License\n[MIT License](https://en.wikipedia.org/wiki/MIT_License)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python API for Nanosurf controllers",
    "version": "1.2.3",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "78ef5e3e020c9efca215a797cb112756",
                "sha256": "11a1ac56aaaca465ea21f1b1edad7d2fbb08d49ea86046475c28f226f0c07e66"
            },
            "downloads": -1,
            "filename": "nanosurf-1.2.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "78ef5e3e020c9efca215a797cb112756",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 1010140,
            "upload_time": "2022-08-04T09:56:29",
            "upload_time_iso_8601": "2022-08-04T09:56:29.112749Z",
            "url": "https://files.pythonhosted.org/packages/0f/bf/493a57ae6b67b0f4fe2ad5efb5cd18bd9581082e8370e6d2441c87c99317/nanosurf-1.2.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "b8b40e1b73171aa1e51ce69515448068",
                "sha256": "416466694fe1b42a3e00aa5611212acab806e05f6ba87888559da6d28fd2d18c"
            },
            "downloads": -1,
            "filename": "nanosurf-1.2.3.tar.gz",
            "has_sig": false,
            "md5_digest": "b8b40e1b73171aa1e51ce69515448068",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 957283,
            "upload_time": "2022-08-04T09:56:30",
            "upload_time_iso_8601": "2022-08-04T09:56:30.939046Z",
            "url": "https://files.pythonhosted.org/packages/bb/d6/a326a2010c5679723cb8c0edf70458aa9f92da843eb8adf14884fad6dffc/nanosurf-1.2.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-08-04 09:56:30",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "nanosurf"
}
        
Elapsed time: 0.40812s