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.12.0.tar.gz
(10.7 MB
view hashes)
Built Distributions
Close
Hashes for pyimfit-0.12.0-cp311-cp311-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a84d273f593091b8a3d2e50ff6726de9ee1852ce0dc6d00431cee579da15dead |
|
MD5 | 384935f6d9fbc350e2564478e9b9b043 |
|
BLAKE2b-256 | f3087ed0558feb72cf084dcd0ed84d2206cc409cfa5e3a05f7dbb2395c181eb8 |
Close
Hashes for pyimfit-0.12.0-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df064ad3f3cd09047a292d70f9b1c425a1f45586bfa3273c320ba80822a67c5f |
|
MD5 | 466e4c072204ce63aede7685fa9de7df |
|
BLAKE2b-256 | 7b249d638dffceef62e8ac72ab716b8bbfd0dacd75c7cc4f1cfde2f849789638 |
Close
Hashes for pyimfit-0.12.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3f0e48e326abbb1d102f24daa29b24bb56404f5a338cae0182345d94373dee7 |
|
MD5 | 65bb91e87df4e067577dfdf479dc6dff |
|
BLAKE2b-256 | f06ab1665028caad6e486ce7ad4a8870d636a1a58062cba53806a0f4b5fcc846 |
Close
Hashes for pyimfit-0.12.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a53c5c3b14c8ae7f3a3aaf6e8968447e0b417406632898105d1d811ff56be8d9 |
|
MD5 | 086a365f4b0950de4c610fb71c81a51d |
|
BLAKE2b-256 | 6ef75e85b5d2d977fd147a9bca4197fd3d525c43e4f15a267e1801bd0e1ee665 |
Close
Hashes for pyimfit-0.12.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33f2f57027dadf67e82c81c456055ca443cadd11ebbfe1e2e9f8bfbb443c539f |
|
MD5 | 65df7a57046180ada944fb20f5e0f9b3 |
|
BLAKE2b-256 | 317e32aa2bc21f1b4b40d9e80cc6bc9060bdfa79e5a58915d69ece63a400226f |
Close
Hashes for pyimfit-0.12.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e96c0eb9ed10abfcecc4babc5cd7cd77b6e1f3ff0c48948866b3113d862da7b |
|
MD5 | 40972878bd2ba6cc20adc062f7e395d2 |
|
BLAKE2b-256 | 140c755bbca387eda04f4c3efa6228e3be50fe6920c3e1c8702d694f05d3bfb3 |