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-1.0.0.tar.gz
(10.8 MB
view hashes)
Built Distributions
Close
Hashes for pyimfit-1.0.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8b19bd2e9180296d2f967a50ea1dd61e94afcb50bcc8a64e939c012bdeeba20 |
|
MD5 | c4c81e86da9c6daff03d5ee95104df75 |
|
BLAKE2b-256 | b25e3c0447cbf82891e32dd326a08a8a3e5416f25daf285a8d8a066dc9b19216 |
Close
Hashes for pyimfit-1.0.0-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0f14480967cd28e4fe6838e8741ac16901e1682513aa2edd8a0991fb899ccf8 |
|
MD5 | 3d3e2bb785db36737825576a5ac31e4f |
|
BLAKE2b-256 | 56452ea6f6685f946c9db01f7db350b9fa894917129d046d615ac10da9f32094 |
Close
Hashes for pyimfit-1.0.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a96ad2e0536d5cc4287e2d8b080dde2034b597d8e0657ba090ba01f01e4f0982 |
|
MD5 | fffd46949132499848ef568adad4c79d |
|
BLAKE2b-256 | d31d0b3d28fdd3a43d597d591a285952ab2e5f9f466dea2952fbe7103c903012 |
Close
Hashes for pyimfit-1.0.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5b0dbb697f97e8b772f7deafae2bda4a41655fb16b4cbb1c6a57c4970842575 |
|
MD5 | b16de51fe126491581d2d38adffd7619 |
|
BLAKE2b-256 | a484c5f5ea75e6800802d1bd06a5429aa8371f3587ed1496a5c319d03182e47c |
Close
Hashes for pyimfit-1.0.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e9c748ccc0eb381ea5b22140d7ca3bcd81ca0bf24058df855958eaf2e38ab80 |
|
MD5 | 106ea42607b172eddfb64243e107b47f |
|
BLAKE2b-256 | 5f2125ac5bfce22e9010bbb40136c103c0ad93e6cda3129cf329d81e9ec1105c |
Close
Hashes for pyimfit-1.0.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f5a4e94543746c1a2ad34d5691e76a003e95c810c42583e5482a6501b323b72 |
|
MD5 | 8fe736d39819cccd0b1078ba9c426c6f |
|
BLAKE2b-256 | f5b9c6ac025cc84fdfb1f2b2a2e8fafe30322033ba848eebc55d3ad17e16b1a4 |
Close
Hashes for pyimfit-1.0.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06032788d1fdf1e496849736d06e04d4f9d54b31e87e6b18492c5c0c12a701f3 |
|
MD5 | 184770a9bc7ad58eaa5de7970c4b8945 |
|
BLAKE2b-256 | 0830981df8debc9fbc94dbd668c028772c66a863082fea1d772f9b3eed197677 |
Close
Hashes for pyimfit-1.0.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b4468200b1cdd09f228b04eb75e906fac79d478c1e3f6570019990f24d1020f |
|
MD5 | d34be524b9816920d7e476530a9901e2 |
|
BLAKE2b-256 | 8476cc9554957da1e926af45a7d362f3ea879b1a533ed6781989480b403aaa37 |