Skip to main content

banner

Python numpy scipy astropy matplotlib

Overview

PMOIRED is a Python3 module which allows to model astronomical spectro-interferometric data stored in the OIFITS format (Duvert et al. 2017). Parametric modeling is used to describe the observed scene as blocks such as disks, rings and Gaussians which can be combined and their parameters linked. It includes plotting, least-square fitting and bootstrapping estimation of uncertainties. For spectroscopic instruments (such as GRAVITY), tools are provided to model spectral lines and correct spectra for telluric lines.

The modelling of data is based on several principles:

  • The model is composed of a combination of basic building blocks (see the model definition notebook)
  • Simple building blocks include uniform disks, uniform rings, Gaussians.
  • Building blocks can be deformed (analytically), including stretched in one preferred direction, or slanted. This can efficiently simulate inclined components.
  • More complicated blocks are available, such as disks/rings with arbitrary radial profile, and possibility to include azimuthal intensity variations.
  • Each component has a spectrum, including modelling of emission or absorption lines (Gaussian or Lorentzian)
  • In order for the computation to be fast (a requirement to perform data fitting), basic blocks have analytical or semi-analytical complex visibilities. Moreover, for the same reason, their spectral component is independent of the geometry.

The principles are close to tools such as LITpro. However, PMOIRED offers additional features:

  • Modelling in the spectral dimension. For this reason, it contains a module to do basic telluric correction (only for VLTI/GRAVITY at the moment)
  • Models' parameters can be expressed a function of each others, which allows to build complex geometrical shapes: astronomical realistic models can be build this way, without compromising on execution speed.
  • Uncertainties can be estimated using bootstrapping (data resampling by date+telescope) to mitigate the effects of correlations between data.
  • The values of parameters can be explored using grid and or random search.
  • Synthetic data for VLTI array observations can be generated from data cubes.

diagramme

Install

Use pmrd.py script

The simplest way to use PMOIRED on MacOS / Linux, with python3 and git installed (requires about 1G of disk space):

wget https://raw.githubusercontent.com/amerand/PMOIRED/refs/heads/master/pmrd.py
chmod +x pmrd.py
./pmrd.py --install

which will install PMOIRED from this repository in the environment located in ~/.pmrd.

Then, you can start a python console, ipython, notebook or jupyter-lab by typing ./pmrd -p, ./pmrd -i, ./pmrd -n or ./pmrd -j respectively. Run the examples by typing ./pmrd.py -e

You can update PMOIRED from github with ./pmrd.py -u. Removing the environment is achieved with ./python pmrd.py --remove.

Install with git

The Github version is the most up-to-date. To install from the github repository directly:

pip3 install git+https://github.com/amerand/PMOIRED

you can also clone the repository and install with pip:

git clone https://github.com/amerand/PMOIRED
cd PMOIRED
pip3 install .

Install with pip

PMOIRED is regularly pushed to PyPI at https://pypi.org/project/pmoired/ so you can install directly using pip, by typing:

pip3 install pmoired

Note that the pip version is not updated as often, and to get the latests features and bug fix, it is recommended to use the git version, or better yet, pmrd.py (see above).

Uninstall

To uninstall (works for both PyPI and github versions):

pip3 uninstall pmoired

if you use pmrd.py, the following will remove the whole environment:

python pmrd.py --remove

Examples and tutorials

This repository comes with a Jupyter Notebook showing basic model syntax. You can call this page from Python:

>>> import pmoired
>>> pmoired.modelsDefinitions()

Full examples, how to load real data and analyse them, are available in a separate repository: PMOIRED_examples. These examples are Jupyter Notebooks reproducing published results with other tools, and serve both as tutorials and verification of PMOIRED. They cover most of the features of PMOIRED, from the basics to more advanced operations.

You can also check the following material:

Using and quoting PMOIRED

References to PMOIRED should point to the 2022 SPIE Telescopes+Instrumentation conference proceeding paper.

This code is a research project in continuous development and not properly fully documented. If you want to get the best analysis for your data, do not hesitate to contact me: I try to be responsive, in particular with junior scientists. New features are driven by collaborations: if you think PMOIRED is missing something, definitely contact me!

I maintain a list of works published using PMOIRED in a curated bibliography.

I used to to request co-authorship on publications using PMOIRED (until Feb 2023): this is no longer the case, unless I contributed directly to the work in question

Limitations and known issues

Running a script in ipython hangs

PMOIRED uses the multiprocessing library to parallelise some computations (e.g. bootstrapping, grid search). This library has some issues if you run a script containing such computation is an interactive shell (using %run or run in ipython or Spyder). The provided examples as notebooks do not suffer from this problem. If you want to use PMOIRED in .py scripts you run in iPython, you should structure your .py script more or less as follow:

import pmoired
import matplotlib

matplotlib.interactive(True)
__spec__ = None
if __name__=='__main__':
    [code]

in iPython, you can now type %run myscript.py.

Dependencies

The latest version of PMOIRED has been tested on:

  • python 3.13.1
  • numpy 2.2.0 (need >2.0)
  • scipy 1.14.1
  • astropy 7.0.0
  • astroquery 0.4.7
  • matplotlib 4.3.3
  • jupyterlab 4.4.1

Acknowledgments

PMOIRED has received contributions from Akke Corporaal, Evgenia Koumpia and Robert Klement.

This project has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement No 101004719.

EU ORP

Metadata

Release files for pmoired 26.10.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pmoired 26.10.1
File Size Uploaded Provenance
pmoired-26.10.1.tar.gz 7.8 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pmoired 26.10.1
File Interpreter ABI Platform
pmoired-26.10.1-py3-none-any.whl Python 3 none any Details

Total release size: 15.6 MB

Release files / pmoired-26.10.1.tar.gz

Download URL pmoired-26.10.1.tar.gz
Size 7.8 MB
Tags Source
SHA-256 checksum
How to use checksums
afae09fa1e95ae3c0bce67cd3644ac5e4754924b3e031bd280bb522e60f110bf
BLAKE2b-256 checksum
How to use checksums
011498ce9cbcfb22d1f3288a3b1ef3f960837a14eea60551ab848647441332ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.1

Release files / pmoired-26.10.1-py3-none-any.whl

Download URL pmoired-26.10.1-py3-none-any.whl
Size 7.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
7e87a2762b4dc77a954d6353a4b521a56899eb2d3f4d42b02808eb7eba2f7aee
BLAKE2b-256 checksum
How to use checksums
3f61b06caf28a1f83690ab5dd997587e45e93ce972d7d97c1d8f651dd223406c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.1

Security for pmoired 26.10.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page