Skip to content
/ mfit Public

Model fitting software for optical long-baseline interferometry

License

Notifications You must be signed in to change notification settings

jsy1001/mfit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mfit release notes - package release 1.5.3

Description

Mfit is a tool for fitting simple parametrisations of the sky brightness distribution to optical (visible/IR) interferometry data.

Features of mfit include:

  • Asymmetric, multi-component models
  • Four limb-darkening parametrizations (Taylor and Gauss-Hermite expansions, Hestroffer and square-root models), plus support for arbitrary limb-darkening profiles specified numerically (may be wavelength-dependent)
  • Support for wavelength-dependent models (specified model parameters can take different values for different wavebands)
  • Interactive, command-line, and GUI interfaces
  • Plots of data and model
  • Optional marginalisation by numerical integration of the posterior probability (requires commercial NAG library)

The graphical interface, fitgui, can straightforwardly be integrated into other applications written in python.

Please refer to the NEWS file for details of user-visible changes in this release.

Requirements

The program should work on any unix-like operating system (see below for those it has been tested on). You will need a Fortran 90 or 95 compiler to build mfit.

The following libraries are required (not supplied, but free software):

PGPLOT
http://www.astro.caltech.edu/~tjp/pgplot/
CFITSIO
http://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html
FFTW (v3)
http://www.fftw.org/

If you have it, mfit can make use of the commercial Numerical Algorithms Group Fortran Library (Mark 19 recommended) - see http://www.nag.co.uk/numeric/fl/FLdescription.asp

If the NAG library is not available, the marginalisation-by-integration features of mfit (--margerr, --plot mpost, --plot mpost2 in clfit) will not work.

To build mfit, you will need scons - see http://www.scons.org - and a working installation of Python.

To run the fitgui graphical interface, you will need a working installation of Python 3.7 or above and Tkinter (see http://www.python.org).

Files

The files in this package are as follows:

FilenameDescription
<25><40>
ChangeLogPackage ChangeLog (automatically generated from CVS log messages)
README.orgThis file
NEWSOutline of new features in this and previous releases
documentationInstructions for using mfit
SConstructscons configuration file, used to build mfit (see below)
bayes.f90, fit.f90, inout.f90, marginalise.F90, model.f90, plot.f90, postplot.f90, visibility.f90, wrap.f90Routines used by mfit and clfit
main.f90mfit main function
clfit.f90clfit main function
calc.f90Test code for maths module
modelplot.f90, fitsimage.f90Image-space model plot utility
fitgui.pyGUI interface to clfit
fitguiWrapper script for fitgui.py - put this in PATH
fitgui_devAlt. wrapper script for fitgui.py - used for development
test.oifitsTest dataset (COAST data on Capella)
test.modelBinary model that fits test.oifits
pda_xermsg.fReplacement for Starlink routine

The following files, authored by third parties, are distributed with mfit for your convenience:

FilenameDescription
<25><40>
gamma.fGamma function from SPECFUN 2.5 - see readme.specfun
rjbesl.fBessel function from SPECFUN 2.5 - see readme.specfun
readme.specfunReadme for SPECFUN 2.5 routines
gmst.f, dranrm.fSidereal time function from SLALIB
maths_pda.f, fit_pda.fFunctions from Starlink PDA library
f2kcli.f90Fortran 200x Command Line Interface, (c) Interactive Software Services Ltd. - see f2kcli.txt
f2kcli_nagw.f90Fortran 200x Command Line Interface - version for NAGWare f95
f2kcli.txtmanual.txt from f2kcli distribution

Building mfit

Scons is now used to build mfit. If the scons command is not available on your system, retrieve scons from http://www.scons.org and install it.

If your combination of operating system and Fortran 90/95 compiler is not one of those listed below, you may need to edit the section labelled #### May need to edit this section #### at the top of the SConstruct file.

Note that the SConstruct file is a Python script. Please contact the author if the distributed SConstruct file does not work for you and you are not sure how to edit it.

Build mfit by typing scons at the shell prompt (from the directory containing the source code). The following command-line options are supported:

debug=1
compile with debugging flags (-g etc.) - this is the default
debug=0
compile without debugging flags
release=0
compile without optimization flags - this is the default
release=1
compile with optimization flags (-O etc.)
f95=/path/to/f95
use specified compiler, rather than auto-detected one

Mfit has been tested using:

  • Sun Workshop Fortran 95 on Solaris
  • NAGWare Fortran 95 on Solaris
  • NAGWare Fortran 95 on Linux
  • G95 on Linux
  • GFortran 4.6 & 4.3 on Linux (will not work with GFortran versions < 4.3)
  • G95 on MacOS (thanks to Ettore Pedretti)

Please report successes or failures with other compilers/operating systems.

Installing mfit

Build the executables as described above. Install mfit by typing sudo scons install at the shell prompt.

Alternatively, follow these steps to install manually:

  • Edit the command following #! at the top of fitgui so that it starts the Python interpreter on your system.
  • Put the mfit and clfit executables and the fitgui script somewhere in the PATH.
  • Put fitgui.py somewhere in your python module search path (e.g. in one of the directories in $PYTHONPATH).

Using mfit

Please refer to the instructions in the documentation file.

Bugs

Please report the inevitable bugs to jsy1001 (at) cam.ac.uk. Various missing features are listed in documentation.

About

Model fitting software for optical long-baseline interferometry

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published