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.11.2.tar.gz
(10.4 MB
view hashes)
Built Distributions
Close
Hashes for pyimfit-0.11.2-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc16c0e9bc195759735b638db6f43c44a2ba5cd291e7df63c6f70b52f01208cd |
|
MD5 | c8fd785e48a3a7d4e1195ac025457fce |
|
BLAKE2b-256 | f51f494a679009e7075d25f7aafe4f35d862ff5bbb68fa6ac148be23595f81e8 |
Close
Hashes for pyimfit-0.11.2-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d70fb46ca08d6d094bfa2df09d514df72483d6a85cfd513d27684bc5411b07f5 |
|
MD5 | 4dceec06bcad8fe62258e890f75fe057 |
|
BLAKE2b-256 | 2dfa4766c993338dab411fe2003a267bf1c26aa3884b3fc8b0514c33c5f664b2 |
Close
Hashes for pyimfit-0.11.2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 665c7ae1e336ad878b13ba1e716daf6ae7e2855b81481e02d14cdf12b8a0a270 |
|
MD5 | 23f551c66b645211b67b410a8c3d4f68 |
|
BLAKE2b-256 | 2a07af7e4afb68f27fcdb6655b9d2db45658a5c7951e5ba6f5e826a191d3276e |
Close
Hashes for pyimfit-0.11.2-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c8d0be7c97170635392a8daa11461f5fdce1410908523b3f65c43b93901df7b |
|
MD5 | 6a0ff8a318bc97ee243c09714f2043b7 |
|
BLAKE2b-256 | 84d219aa6cdf1621e60aa49ce9a078be4b4168fa1e0bd6985d77db7d6e70141c |
Close
Hashes for pyimfit-0.11.2-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b4022030fbd4ab178dcc373ea1f9ed3fb048475590d8e64dd09881237958e07 |
|
MD5 | aefccdd869837ed58961e76b8ce827f9 |
|
BLAKE2b-256 | 77e2c46a6649591c7a89fbd14c57b242e749fbe1f0e14000eb552a3d5a86fe3a |