iFit: Python interface

  1. Requirements: Python/NumPy
  2. Usage

This feature is experimental.

Requirements: Python/NumPy

Install Python(x,y) for Windows, or Entought Canopy for Windows and MacOSX. Linux flavors provide numpy as e.g. RPM and Debian packages.The IPython package is also recommended.


Navigate to the iFit/Applications/Python directory and launch IPython or Python.
Then issue the command:

>>> from mlabwrap import mlab

From there on, any iFit and Matlab expression can be executed from Python.

>>> a = mlab.iData('filename')
>>> mlab.plot(a)
>>> b = mlab.rdivide(a,2)
The main idea is that any call to iFit/Matlab should be prepended by 'mlab.'.

iFit objects are stored as Python NumPy arrays. Refer to the Methods page to learn about all methods that can be called for iData and iFunc objects.

In addition, there are specialized methods to communicate with iFit/Matlab:
mlab._set('name' value)
assigns name=value in the iFit/Matlab workspace.
retrieves the named variable from the iFit/Matlab workspace.
evaluates the expression/code in the iFit/Matlab workspace.

E. Farhi - iFit Python - Mar. 22, 2017 1.9 - back to Main iFit Page ILL, Grenoble, France <www.ill.eu>