Overview
The oimodeler package is a project aiming at developing a modular and easily
expandable python-based modelling software for optical interferometry.
Note
The project started end of 2021, and the software, although fully functional, is currently in an early stage of development.
Software modularity
As described in the following and shown in the diagram below, oimodeler is a
modular software:
Models can be created with the
oimModelmodule and various base components contained in theoimComponentmodule which contain model parameters from theoimParammodule.Interferometric data can be loaded with functionality from the
oimDatamodule from standard OIFITS files. This module also allows to load flux/spectra in various formats with theoimData.oimDataclass that can optionallly be filtered using theoimData.oimDataFilterclass with various filters from theoimDataFiltermodule.Data simulation/calculation can be done with the
oimSimulatormodule that takesoimData.oimDataandoimModel.oimModelclasses as input to simulate data from the model at the same spatial/spectral coordinates as the data. The module also allows to compute the model/data chi2.The fitting is done with fitters contained in the
oimFittermodule that as its input also takes theoimData.oimDataandoimModel.oimModelclasses to perform model fitting.Note
Currently only a simple emcee fitter is implemented.
The
oimPlotsmodule contains plotting functions for OIFITS data andoimodelerobjects.The
oimUtilsmodule contains various functions to manipulate OIFITS data.
Modules
oimModel
The oimModel module is dedicated to the creation of
models for optical interferometry. The models are modular and composed of one or many
oimComponent.oimComponent objects.
They can produce complex coherent flux and images and can subsequently be plugged into
an oimSimulator object and/or
any of the fitters contained in the oimFitter
for data analysis and/or modelling.
oimComponent
The oimComponent module deals with model components
that can be defined analytically in the Fourier plane (e.g., Uniform Disks,
2D-Gaussian distribution, etc.) or image plane (useful if there exists no analytical
formula in the Fourier plane). An oimComponent
can also be used to wrap external code (functions computing images,
radial profiles, and hyperspectral cubes), or image-fit files (for instance
produced using a radiative transfer model). An oimComponent
can, in addition, be easily inherited from to create new custom components.
oimParam
The oimParam module contains basic model parameters. It oim.Param.oimParam class is used for the
definition of components’ parameters (Built from any of the base classes from the
oimComponent module). There are also parameter linkers
(oimParam.oimParamLinker) as well as
normalizers (oimParam.oimParamNormalize),
and advanced parameter interpolators (oimParam.oimParamInterpolator)
that allow to build chromatic and time dependent models.
oimData
The oimData module allows to encapsulate interferometric
(also photometric and spectroscopic) data. The oimData.oimData
class allows to retrieve the original data as a list of astropy.io.fits.hdulist
(via the oimData.data attribute), but also provide optimization of the data as vector/structure
for faster model fitting.
Warning
Photometric and spectroscopic data not yet implemented!
oimDataFilter
The oimDataFilter module is dedicated to filtering and
modifying data contained in oimData.oimData classes.
It allows data selection (truncating, removing arrays, and flagging)
based on various criteria (wavelengths, SNR …), and other data manipulation, such as
smoothing and binning of the data.
oimSimulator
The oimSimulator module is the basic module for model
(oimModel.oimModel) and data
(oimData.oimData) comparison. It allows to
simulate a new dataset (stored in the oimSimulator.simulatedData attribute) with
the same quantities and spatial/spectral coordinates of the data and a model. It also allows to compute chi2
for data and model comparison. The oimSimulator.oimSimulator
class is fully compatible with the OIFITS2 format and can simulated any kind of data type
from an OIFITS file (VIS2DATA, VISAMP in absolute, differential and correlated
flux).
oimFitter
The oimFitter module is dedicated to model fitting. The
parent class oimFitter.oimFitter is an abstract
class that can be inherited from to implement various fitters. Currently. only a simple
emcee-based fitter is implemented
with oimFitter.oimEmceeFitter.
oimPlots
The oimPlots module contains various plotting tools for
OIFITS data and oimodeler objects. The oimPlots.oimAxes
is a subclass of the matplotlib.pyplot.Axes
class with methods dedicated to produce plotted OIFITS data from the astropy.io.fits.hdulist
format.
oimUtils
The oimUtils module contains various functions to
manipulate OIFITS data such as,
Retrieving baselines names, length, orientation, getting spatial frequencies
Creating new OIFITS arrays in astropy.io.fits.hudlist format.
and more.
Expandability
oimodeler is written to allow easy implementation of new model component,
fitters, data filters, parameter intepolators, data loader (e.g., for non-OIFITS
format data), and plots. Feel free to contact
Anthony Meilland if you developped custom features and want
them to be included in the oimodeler distribution or make a pull-request
on the Github repository
and become a oimodeler contributer. For bug-reports and feature requests,
please use the GitHub issue tracker.