Skip to content

achael/eht-imaging

Repository files navigation

ehtim (eht-imaging)

Python modules for simulating and manipulating VLBI data and producing images with regularized maximum likelihood methods. This version is an early release so please raise an issue, submit a pull request, or email achael@princeton.edu if you have trouble or need help for your application.

The package contains several primary classes for loading, simulating, and manipulating VLBI data. The main classes are the Image, Movie, Array, Obsdata, Imager, and Caltable classes, which provide tools for loading images and data, producing simulated data from realistic u-v tracks, calibrating, inspecting, and plotting data, and producing images from data sets in various polarizations using various data terms and regularizing functions.

Installation

The latest stable version (1.2.8) is available on PyPi. Simply install pip and run

pip install ehtim

Incremental updates are developed on the dev branch. To use the very latest (unstable) code, checkout the dev branch, change to the main eht-imaging directory, and run:

pip install .

Installing with pip will update most of the required libraries automatically (numpy, scipy, matplotlib, astropy, ephem, future, h5py, and pandas).

If you want to use fast fourier transforms, you will also need to separately install NFFT and its pynfft wrapper. The simplest way is to use conda to install both:

conda install -c conda-forge pynfft

Alternatively, first install NFFT manually following the instructions on the readme, making sure to use the --enable-openmp flag in compilation. Then install pynfft, with pip, following the readme instructions to link the installation to where you installed NFFT. Finally, reinstall ehtim.

For M1 Macs (OS >= v12.0), install the M1 Mac version of pynfft and follow the instructions on the readme. It has the instructions to install fftw, nfft and then pynfft.

Certain eht-imaging functions require other external packages that are not automatically installed. In addition to pynfft, these include networkx (for image comparison functions), requests (for dynamical imaging), and scikit-image (for a few image analysis functions). However, the vast majority of the code will work without these dependencies.

Documentation and Tutorials

Documentation is here.

A intro to imaging tutorial jupyter notebook can be found in the repo at tutorials/ehtim_tutorial.ipynb

Slides for the included tutorial walk through the basic steps of reconstructing EHT images with the code

Here are some other ways to learn to use the code:

  • Start with the script examples/example.py, which contains a series of sample commands to load an image and array, generate data, and produce an image with various imaging algorithms.
  • Older Slides from the EHT2016 data generation and imaging workshop contain a tutorial on generating data with the VLBI imaging website, loading into the library, and producing an image.

Citation

If you use ehtim in your publication, please cite Chael+ 2018.

The latest version is also available as a static doi on Zenodo.

Selected publications that use ehtim