Imfit is a program for fitting astronomical images -- more specifically, for fitting images of galaxies, though it can in principle be used for fitting other sources. The user can specify a set of one or more 2D functions (e.g., elliptical exponential, elliptical Sérsic, circular Gaussian) which are added together to generate a model image. This model image is then matched to the input image by adjusting the 2D function parameters via nonlinear minimization of the total χ2. The minimization can be done using a Levenberg-Marquardt method (the default) or a Differential Evolution solver (much slower, but less likely to be trapped in local minima in the χ2 landscape). Imfit can be compiled to use multi-threading (via OpenMP), taking advantage of multiple cores in modern CPUs for extra speed.
Individual 2D functions can be grouped into arbitrary sets sharing a common (x,y) position on the image plane; this allows the fitting of galaxies with off-center components, or of multiple galaxies in the same image. Parameters for individual functions can be held fixed or restricted to user-specified ranges. The model image can (optionally) be convolved with a Point Spread Function (PSF) image to better match the input image; the PSF image can be any square, centered image the user supplies. (A companion program can be used to generate PSF images based on, e.g., 2D Gaussian or Moffat functions -- or any combination of the functions built into Imfit.)
A key characteristic of Imfit is a modular, object-oriented design that makes it easy to add new, user-designed 2D image functions. This is accomplished by writing C++ code for a new image-function class (e.g., by copying and modifying the header and implementation files for one of the existing image functions), modifying one additional file to include references to the new function, and re-compiling the program.
Imfit is an open-source project; the source code is freely available under the GNU Public License (GPL).
These are compressed tar files containing executables for imfit and makeimage, the ``how-to'' documentation PDF (also available separately, below), and a small subdirectory containing example files.
To compile Imfit from source, you will need SCons (it's easy to install and use); you will also need the following external libraries:
Imfit has been tested with GCC versions 4.2 (on Mac OS X) and 4.6 (on Ubuntu Linux); it should compile with other versions of GCC later than 4.2, and it should also work with version 4.0 or 4.1 (though OpenMP speedups will not be available).
NGC 4762 is an edge-on S0 galaxy in the Virgo Cluster; see the classic analysis of photographic-plate photometry by Wakamtsu & Hamabe (1984) for a detailed discussion of this galaxy's large-scale structure.
|
| SDSS gri image (David W. Hogg, Michael R. Blanton, and the Sloan Digital Sky Survey Collaboration) |
Here, I show a 2D decomposition of the inner 3 x 3 kpc of the galaxy, using Imfit to model the Hubble Space Telescope F475W ACS/WFC image from the ACS Virgo Cluster Survey. The exquisite resolution of the HST image reveals evidence for a compact, edge-on nuclear ring, in addition to an elliptical bulge and two separate ``disk'' components (the latter two matching what Wakamatsu & Hamabe suggested were a bar and its surrounding lens). New components for modeling the edge-on ring and the complex edge-on disk components were written, compiled, and then used as part of the overall modeling process.
The final fitting was done using this configuration file and the following command (this actually fits the inner 3 x 6 kpc of the galaxy; note that fitting just a subset of the image can be specified right on the command line):
imfit n4762g_horiz_adu.fits[2263:3063,1858:3458] --config config_imfit_n4762.txt --mask n4762g_mask.fits[2263:3063,1858:3458] --psf acs_psf.fits These are the four main components used in the modeling process (log-scaled isophote contour plots; an additional circular Gaussian representing a central unresolved nuclear source was also used, but is not shown here):
|
+ |
|
+ |
|
+ |
|
|
Bulge (elliptical Sérsic component) |
Stellar nuclear ring (two-sided, edge-on Gaussian ring component) |
Thin disk/bar (broken-exponential edge-on disk component) |
Thick disk/lens (broken-exponential edge-on disk component) |
|
= |
|
versus |
|
| Final PSF-convolved model image | ACS/WFC F475W image |
Last modified 23 May 2012.