Skip to content

sustain-lab/scanivalve-mps-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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()

About

Python interface to Scanivalve MPS4264

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages