Python wrapper for astronomical image-fitting program Imfit
Project description
Pyimfit
This is a Python wrapper for the astronomical image-fitting program Imfit.
Online documentation: https://pyimfit.readthedocs.io/en/latest/.
Sample Usage
The following assumes an interactive Python session (such as an iPython session or Jupyter notebook):
from astropy.io import fits
import pyimfit
imageFile = "<path-to-FITS-file-directory>/ic3478rss_256.fits"
imfitConfigFile = "<path-to-config-file-directory>/config_exponential_ic3478_256.dat"
# read in image data, convert to proper double-precisions, little-endian format
image_data = fits.getdata(imageFile)
# construct model from config file; construct new Imfit fitter based on model,;
model_desc = pyimfit.ModelDescription.load(configFile)
# create an Imfit object, using the previously loaded model configuration
imfit_fitter = pyimfit.Imfit(model_desc)
# load the image data and image characteristics and do a standard fit
# (using default chi^2 statistics and Levenberg-Marquardt solver)
result = imfit_fitter.fit(image_data, gain=4.725, read_noise=4.3, original_sky=130.14)
# check the fit and print the resulting best-fit parameter values
if result.fitConverged is True:
print("Fit converged: chi^2 = {0}, reduced chi^2 = {1}".format(imfit_fitter.fitStatistic,
result.reducedFitStat))
bestfit_params = result.params
print("Best-fit parameter values:", bestfit_params)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyimfit-0.10.2.tar.gz
(10.6 MB
view hashes)
Built Distributions
Close
Hashes for pyimfit-0.10.2-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12cc57dada6a39d787b4b2cfb4e4924cd96c6edf3980425949e15283cf3bd9b3 |
|
MD5 | be1ee3b7080b32993a09eb6c85bb524a |
|
BLAKE2b-256 | deae74fd77da0861017e37c15d397fac6d6803fb0d6e6e86da2192be6ac51cdd |
Close
Hashes for pyimfit-0.10.2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0acaf49a990138088fc819b41dc5dc0d59557ae058429e22cc29cad79c9a29a0 |
|
MD5 | 40f0c01a160b44c6e7ddfebe22381c0f |
|
BLAKE2b-256 | e5d0bc21159b51c00a2d265c60df0b1ce3594b2367122b0b018e64c579242282 |
Close
Hashes for pyimfit-0.10.2-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95424738ffcd1ae1dafe5c6142a98e650d5585c8aada24745b616e1324caa208 |
|
MD5 | 51bdbc62284690f9e3ea5a7b246f58bc |
|
BLAKE2b-256 | 61ef3b90d422258e3316a3ba540fa81a21ed135b6a7e9360c719267cb7d3b732 |
Close
Hashes for pyimfit-0.10.2-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54382da48bdabbb41c1d73b178885fc9d5073a4f7f1d17ed218f5c073066dc1f |
|
MD5 | 9d02948da5c04238ea2e53345535a315 |
|
BLAKE2b-256 | 26ee4fecc63ef20348942970995c42279e94344ecb120e6ec7f3eadb7dfbe34f |