Modularity & Expandability
Description oimodeler modules
As described below and shown in the diagram, oimodeler is a modular software:
Models are created with the
oimModelmodule and base components inoimComponent, which include model parameters fromoimParam.Interferometric data can be loaded from standard OIFITS files using the
oimDatamodule. This also supports loading flux/spectra in various formats with theoimData.oimFluxDataclass, which can be optionally filtered by theoimData.oimDataFilterclass, using filters from theoimDataFiltermodule.Data simulation and calculation are handled by the
oimSimulatormodule, which takesoimData.oimDataandoimModel.oimModelobjects as input to simulate data at the same spatial and spectral coordinates as the observations. It also computes model/data chi2.Model fitting is performed by fitters in the
oimFittermodule, which also takesoimData.oimDataandoimModel.oimModelclasses as input.The
oimPlotsmodule provides plotting functions for OIFITS data and oimodeler objects.The
oimUtilsmodule contains various utility functions for manipulating OIFITS data.
oimModel
The oimModel module focuses on creating models for optical interferometry.
Models are modular and consist of one or more
oimComponent.oimComponent objects. They can generate
complex coherent fluxes and images, which can then be integrated into an
oimSimulator object and/or any fitter in the
oimFitter module for data analysis and modeling. See the model
section for more details.
oimComponent
The oimComponent module manages model components that can be defined
analytically in the Fourier plan (e.g., Uniform Disks, 2D Gaussian distributions) or in the image plane
(useful when no analytical Fourier formula exists). An oimComponent can
also wrap external code, such as functions computing images, radial profiles, or hyperspectral cubes,
or image-fit files (e.g., from radiative transfer models). Additionally, components can be easily
inherited to create new custom components.
oimParam
The oimParam module contains basic model parameters. Its
oimParam.oimParam class defines component parameters
(based on base classes from the oimComponent module). It also
includes parameter linkers (oimParam.oimParamLinker),
normalizers (oimParam.oimParamNormalize), and advanced
interpolators (oimParam.oimParamInterpolator)
that enable building chromatic and time-dependent models.
oimData
The oimData module allows to encapsulate interferometric
(also photometric and spectroscopic) data. The oimData.oimData
class contains the original OIFITS data as a list of
astropy.io.fits.hdulist
but also provide optimization of the data as vector/structure for faster model fitting.
oimFluxData
The oimData module encapsulates interferometric, photometric, and spectroscopic data.
The oimData.oimData class holds the original OIFITS data as a list of
astropy.io.fits.hdulist objects and
also provides optimized data structures (vectors) for faster model fitting.
oimDataFilter
The oimDataFilter module handles filtering and modifying data within
oimData.oimData classes. It supports data selection (truncation,
array removal, flagging) based on criteria like wavelength or SNR, as well as data manipulation
methods such as smoothing, binning, and error computation.
oimSimulator
The oimSimulator module is the core for comparing models
(oimModel.oimModel) and data
(oimData.oimData). It simulates datasets with matching
quantities and spatial/spectral coordinates from both data and model. It also computes \(\chi^2_r\)
for comparison. The oimSimulator.oimSimulator class
is fully compatible with OIFITS2 and can simulate any data type from an OIFITS file
(e.g., VIS2DATA, VISAMP in absolute, differential, and correlated flux).
oimFitter
for implementing various fitters. Current fitters include an MCMC sampler based on the popular emcee library, a simple grid search, and a minimizer using the scipy minimize function.
oimPlots
The oimPlots module provides plotting tools for OIFITS data and
oimodeler objects. The oimPlots.oimAxes subclass extends
matplotlib.pyplot.Axes
with methods tailored to plot OIFITS data from the
astropy.io.fits.hdulist format.
oimUtils
The oimUtils module contains functions to manipulate OIFITS data, such as:
Retrieving baseline names, lengths, orientations, and spatial frequencies
Creating new OIFITS arrays in astropy.io.fits.hdulist format
and more.
Expandability
oimodeler is designed for easy implementation of new model components, fitters, data filters, parameter interpolators, data importers (e.g., for non-OIFITS formats), and plotting tools.
Feel free to contact Anthony Meilland if you develop custom features and would like them included in the oimodeler distribution. Alternatively, submit a pull request on the GitHub repository and become an oimodeler contributor.
For bug reports and feature requests, please use the GitHub issue tracker.