Skip to main content

Bridging between Python and Igor Pro

Project description

PyIgor

PyIgor bridges between Python and WaveMetrics Igor Pro.

Preparation

Usage

Accessing Igor Pro from Python

from pyigor import Connection
import numpy as np

igor = Connection()

### Sending an array to Igor Pro
array = np.sin(np.linspace(0, 10, 100))
igor.put(array, "sinwave")

### Executing a command in Igor Pro
igor("sinwave += 1")

### Getting a wave from Igor Pro
wv = igor.get("sinwave")
print(wv.array)

Accessing Python from Igor Pro

Preparation in Python
from pyigor import Connection

igor = Connection()

### @igor.function decorator makes the function callable from Igor Pro.
@igor.function 
def myfunc(a):
	return a*a

igor.wait_done() # Just to prevent the program quit. You don't need it in the interactive mode.

By using Connection(security_hole=True), you can call any Python code. Meanwhile, this option makes it possible to execute any Python code by HTTP requests: http://localhost/code -> eval(code). Do not use unless you are sure of it.

Calling registered functions from Igor Pro
print PyIgorCall("myfunc(10)")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyigor-0.1.6.tar.gz (5.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page