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(imfitConfigFile)
# 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-1.0.2.tar.gz
(10.8 MB
view hashes)
Built Distributions
Close
Hashes for pyimfit-1.0.2-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a11c5dfe8c05fa6a57e33ae42b6e181888f3455db9bf09c6c910ec145ee26d0 |
|
MD5 | 5d0cf373219452e988b95afcc904663a |
|
BLAKE2b-256 | e91ea252f1d9bed1bbc9baf0f27689ea7a49510eb40a43015f8e5e90eff9b84b |
Close
Hashes for pyimfit-1.0.2-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6af25f1eaffda21b43cf23e67cf67cc2c9ac27384c48130d7c83062303180e3 |
|
MD5 | d2f474230509230eada8ee59f830963f |
|
BLAKE2b-256 | b43c4541b69abc864fd8e8b64204df8ff8d43976699f02ae5fb79ae7fe75566e |
Close
Hashes for pyimfit-1.0.2-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46b32e0e3a27db9813d6a42b31a8ac429cc01224c5f3e08d342242cf058269be |
|
MD5 | 01b5cf5c8dc4c3328fa03a32987aa514 |
|
BLAKE2b-256 | 63ceae0a427a9703aa408cac93b948cfc10b8588ca9bb5300cd7b87de9dd1710 |
Close
Hashes for pyimfit-1.0.2-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f925466e4eba3d215b35d0430826fbafb4b369d4eafc9fd2c3f2925f6118dda |
|
MD5 | 95c1eaf190b067a833bf3b7effe83fbd |
|
BLAKE2b-256 | 77cc885cf9b4c713ebe899658667708ba05dcd0884e966ff01c94e9a6f291593 |
Close
Hashes for pyimfit-1.0.2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 445f3cde4167a31522a6aa34d78d801e55a545d2a4ebc2401eec3509b86c578d |
|
MD5 | f0a0a6ef74f0356712a3e2955905b5e5 |
|
BLAKE2b-256 | 03b2381387b470f16ebffc5e3e103bd37be93383d49d9be3596abe92df02fd2b |