Skip to content

imec-int/PolytecController

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Disclaimer

  • This software is NOT an official product of, endorsed by, affiliated with, or supported by Polytec GmbH or any of its subsidiaries. It is an independent, community-maintained, open-source project developed for personal and research use.
  • No warranty: This software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and non-infringement.
  • No official support: Polytec GmbH bears no responsibility for this project. Do not contact Polytec support for issues related to this package.
  • Use at your own risk: While the authors have not experienced any issues on their end, they cannot guarantee the same for others. The authors and contributors are not liable for any damage to equipment, data loss, voided warranties, or any other consequences arising from the use of this software.

Dependencies

  • Make sure polytec file access is installed on your computer. You can get it through polytec update. This will allow you to use the functions defined in the polyfile.py file of this repository, which are useful to extract data from .svd or .pvb files.
  • If you want to actually control a Laser Doppler Vibrometer you will need to have the proprietary "PSV Acquisition" or "Vibsoft" software installed additionnaly - those require specific licenses or hardware dongles. For just reading .svd or .pvd files this is not required.
  • If you want to control the camera of a Polytec Vibroflex you will need to have Pylon installed.

Installation instructions

This assumes you are using uv to manage your python environments.

  1. Your pyproject.toml should look like this:
#Contents of a simple pyproject.toml file
[project]
 #...
dependencies = [
    #...
    "PolytecController>=0.1.0",
]

[tool.uv.sources]
PolytecController = { git = "https://github.com/imec-int/PolytecController.git", branch = "main" }
  1. Run uv sync to update all the dependencies.

Accessing data stored in .svd files

from PolytecController.polyfile import Svd
with Svd("mypath\my_file.svd") as svd:
  svd.print_available_data() #show contents available in the svd file
  x,y,usd=svd.get_point_data(domain_name="FFT",channel_name="Vib",signal_name="Velocity",display_name="Magnitude",point_index=-1, frame= 0)#access data
  svd.plot_image(savepath=savepath,show_scanpoints=True,
                           label_scanpoints=True,
                           label_scanstatus=True,
                           category='All') #plot image and overlay scanpoints on it.
  image=svd.get_image() #May also be of interest: access image stored in svd file

Accessing data stored in .pvd files

from PolytecController.polyfile import Pvd
with Pvd("mypath\my_file.pvd") as pvd:
  pvd.print_available_data()
  x,y,usd=pvd.get_point_data(domain_name="FFT",channel_name="Vib",signal_name="Velocity",display_name="Magnitude",point_index=-1, frame= 0)

Reading settings files

from PolytecController.polyfile import PolySettings
with PolySettings("mypath\my_file.set") as my_set:
  scanpoints=my_set.get_scanpoints(category="All",ref_frame="video")
  print(my_set.infos)

Launching a measurement with psv.

from PolytecController.polysoft import Psv
with Psv() as psv:
  psv.load_settings_from_file(settings_filepath="my_settings.set") #load saved settings
  psv.trigger_scan(savepath="my_results.svd") #launch a scan
  psv.wait_for_scan_end()

  #May also be of interest:
  psv.export_snapshot(savepath="my_image.png") #save the image displayed in the polytec software. Note that this is accessible directly from the svd file if a scan is made.
  psv.save_current_settings(savepath="my_settings.set") #save scan settings

Launching a measurement with Vibsoft.

from PolytecController.polysoft import Vibsoft
with Vibsoft() as vibsoft:
  vibsoft.trigger_scan(savepath="mysavepath.pvd")

Getting a picture from the vibroflex camera.

from PolytecController.polysoft import Pylon
Pylon.export_snapshot(savepath="mypic.png")

Troubleshooting

Unable to launch any command

Try running the most basic thing you can run:

#This should launch PSV
from win32com.client import Dispatch
app=Dispatch("PSV.Application")
app.Activate()

If you are unable to run this it likely indicates that you have a missing registry key. To fix it:

  1. Quit the PSV software
  2. Start a command prompt with administrative rights
  3. Navigate to C:\Program Files\Polytec\PSV 10.1 (or 10.2 etc) using the cd command
  4. run psv.exe /regserver
  5. Restart the computer & try again.

About

A package to control polytec laser doppler vibrometers and extract data from the files they create

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors