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.9.0.tar.gz
(8.8 MB
view hashes)
Built Distributions
Close
Hashes for pyimfit-0.9.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe57ffce9af737a4dd2fea3193d29923c0d8fb2f5af184d92b9e2372aa020c3e |
|
MD5 | 82aa51c3d5b78c6a53518fc09f9f0262 |
|
BLAKE2b-256 | df826616059bc4de572638100635994bcfa2b53f30b8218fd2c902347ed96842 |
Close
Hashes for pyimfit-0.9.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 786940332c90a2807922b63c0229e1d30bde587d57d3c596d5f25a613ed45ca6 |
|
MD5 | 2638f6a801febe5fbf730599ba5c338e |
|
BLAKE2b-256 | 5b30a6736288644089d1e19eadec6532d428b01c6723b6bf3bc9c269bd763ace |
Close
Hashes for pyimfit-0.9.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72ffc959a2e1859b8795f298d00bb04c3ca75ea8a95bd52eb1fdb520095a9200 |
|
MD5 | 4c9f0451461dea6de5209d499393816d |
|
BLAKE2b-256 | 8c7a89fc97715caa40a4c4db040af80c0d2000473c38c1cfaf99d5d874ebf0d4 |