Installation#

Python#

To install the package, follow these steps:

  1. Install the Microsoft Visual C++ Redistributable(x64) if missing in the system: https://aka.ms/vs/17/release/vc_redist.x64.exe.

  2. First, download and install the latest version of Python 3.11 from the official Python website: https://www.python.org/downloads/

  3. Once you have installed Python 3.11, open a command prompt or terminal window.

  4. Right-click on “Command Prompt” and select “Run as administrator”.

setx PATH "%USERPROFILE%\AppData\Local\Programs\Python\Python311;%USERPROFILE%\AppData\Local\Programs\Python\Python311\Scripts;%PATH%" /M

This will add the Python 3.11 installation directory to the system path variable.

  1. Close the Command Prompt and open a new one to ensure that the changes take effect.

  2. Check if Python is installed correctly by typing the following command:

python --version

This should output the version number of Python that you have installed.

  1. Next, you will need to install the pip package manager. To do this, type the following command:

python -m ensurepip --upgrade

This will install or upgrade pip to the latest version.

snAPI#

  1. Download the latest release from github.com/picoQuant/snAPI/releases from the repository: picoquant/snapi

  2. Finally, you can unpack the files and install your package using pip. Navigate to the directory where your package is located, and type the following command:

pip install .\dist\snAPI-<VERSION NUMBER x.y.z>-cp311-cp311-win_amd64.whl

Dependencies#

  1. Download and install the software for the product you need:
  2. Start the Harp Software and check if the device is working.

  3. Once the installation is complete, verify that the package is installed by running the command import snAPI in a Python interpreter. If no error message is shown, the installation was successful.

Additional Features#

  1. Colored Log is default on Windows 11 but on Windows 10 you have to enable it manually in terminal by executing the included registry key EnableTerminalColors.reg and restart the terminal.

_images/Log.png

Example cutout of a colored log.

  1. To get the full power of coding we suggest to use snAPI with Visual Studio Code.

_images/VSCode.png

VSCode will show the documentation on mouse hover.

Getting Started#

  1. Open a command prompt and navigate to the demos folder.

  2. Open Demo_TimeTrace.py in an editor.

  3. Also change the default configuration to the matching one from the demos/config folder.

sn.loadIniConfig("config\TH260N.ini")
  1. edit the ini file and set the trigger levels

  2. install matplotlib

pip install matplotlib
  1. run the demo

python .\Demo_TimeTrace.py
_images/TimeTrace.png

example of a timetrace window drawn by matplotlib