Skip to content
Python interface to Scanivalve MPS4264
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
scanivalve_mps
.gitignore
LICENSE
README.md
example_stream_data.py
requirements.txt
scan_to_csv.py
setup.py

README.md

scanivalve-mps-python

A Python interface to Scanivalve MPS4264.

Getting started

Get the code

pip install -U git+https://github.com/sustain-lab/scanivalve-mps-python

Set the environment

MPS_HOST environment variables must be set to the IP address of the sensor (see label on the bottom side). For example:

export MPS_HOST=191.30.90.1

Run tests

The instrument must be connected and powered to run the tests succesfully.

pytest -v scanivalve_mps/tests.py

Example use

from datetime import datetime
import os
from scanivalve_mps.mps import MPS

host = os.environ['MPS_HOST']

mps = MPS(host)
mps.set_time(datetime.utcnow())

print('Zero calibration...')
mps.calibrate_zero()

# set up the scan parameters
mps.set_format('csv')
mps.set_scan_units('PA')
mps.set_frames_per_scan(100)
mps.set_rate(10)
mps.scan_to_csv('test_run.csv')

mps.disconnect()

Supported functions

  • MPS.bootloader_version()
  • MPS.calibrate_zero()
  • MPS.get_scan_start_time()
  • MPS.get_time()
  • MPS.scan()
  • MPS.scan_to_csv(filename)
  • MPS.set_format(format_code)
  • MPS.set_frames_per_scan(fps)
  • MPS.set_rate(rate)
  • MPS.set_scan_units(units)
  • MPS.set_time(time)
  • MPS.status()
  • MPS.stop()
  • MPS.stream(frames)
  • MPS.version()
You can’t perform that action at this time.