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.1.tar.gz
(10.6 MB
view hashes)
Built Distributions
Close
Hashes for pyimfit-0.11.1-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 977f07a8602ee9c5261aaca83142f18d23c7082ef4f331c44b6901ef073b010a |
|
MD5 | beddd31f037af2fac2b5e7dc7a5df90d |
|
BLAKE2b-256 | bd9a15f824cdf54a86ea5ddcdb93c3df8b89ad466adc0b670e6015809b194d05 |
Close
Hashes for pyimfit-0.11.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df894614a9f41e6b870882141f9f999285430af24bfa1e324f24d57e4d3fac73 |
|
MD5 | 89c81644c8ffbc9bc3e0b1f09d852611 |
|
BLAKE2b-256 | 63e41d727ccf52c556f46e3df2dcf121a70f346ba76583d68f478c514512c16a |
Close
Hashes for pyimfit-0.11.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d89c4d8c6bc77a3f19916333ae20ce441e448e342262ec89773086db3160d62 |
|
MD5 | e53bd6c30ef234e4b3105c907d5fba46 |
|
BLAKE2b-256 | 22a79560293e0a5927316a7d2dfdc16ccc0a71ec9140a39dd3f53c2af2b43905 |
Close
Hashes for pyimfit-0.11.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bcda68a741c01c04a39672214ac6668fcc9901d0ca86daa36d050d806fab01cd |
|
MD5 | ce713195bd14f546536f4c7d0db7bfe6 |
|
BLAKE2b-256 | a41136f638f69b36e7e3d3942d6a468c4d48dc2e9d9e14397fe8fa2e2ecc3e44 |
Close
Hashes for pyimfit-0.11.1-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6be0d6e754c7f1d3a73c961f7e4b4e034f50de502ee84cfc6f256790cdc364df |
|
MD5 | 3f1ce68ad9d25c46250295d561841a14 |
|
BLAKE2b-256 | d9c55516813149e0778c5676b2e480e1162b1c1ebc2855f87c06c17ef9020dba |