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.1.tar.gz
(10.8 MB
view hashes)
Built Distributions
Close
Hashes for pyimfit-1.0.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 497b4b194c4490627ba71fa36045fe17add25cdee9246a2e494a84331f307881 |
|
MD5 | 246216cfc1de8d3443870971be1a78ce |
|
BLAKE2b-256 | ee55fa2a09d2b55565060986ea2aa83be79379b6a3270f26c31eaf9cf6bd13b2 |
Close
Hashes for pyimfit-1.0.1-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00898137c691d50de02b13adb13eac49c02bd98245543b6a8af4c00e52e402d4 |
|
MD5 | 36a4c72c183af01b0e5f1551d5814841 |
|
BLAKE2b-256 | 9e2450ba2481c83c4a3f43fff8c9a2cbe22c076b34b1215ceb5c2e6f92822caf |
Close
Hashes for pyimfit-1.0.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21740da77d2cee3c314beb9d7f1735666644d3516790751fbc961eb932b620c6 |
|
MD5 | 83282466b353bf0fe1a8ce041a730f8c |
|
BLAKE2b-256 | 4f8d7612265eb74abe326d5c884128054122e40826aa866580fb67cc48e9f454 |
Close
Hashes for pyimfit-1.0.1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ded246a1c1b8ec19a498ce59b2610a1f2b724ccb032d286d8a4f988ddf84de2 |
|
MD5 | a6831f4e92ac35520ae71ad48eb22c69 |
|
BLAKE2b-256 | 12b58a5d1a0a7fd3e53b4ea64afb09565e4d141222f6569656cf3469d607dadd |
Close
Hashes for pyimfit-1.0.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c8e7405671735d230a4343a03f527d52763d2edc61284e8759cfc3fcbaa9825 |
|
MD5 | 0a2834b096b690a8af6d210b62dfecba |
|
BLAKE2b-256 | f3959eab104703d128bdb0d663c85f5e5254dd8c88cfdc42170d68f51fc4d58e |
Close
Hashes for pyimfit-1.0.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf07fd53f0cb8502cf8ec3a3f2d0988c70b74b225058de7187068852d4f7bb12 |
|
MD5 | 16340b04ac7e4abb00776d87be3cda6d |
|
BLAKE2b-256 | 55b611508c3b094f573dc5163268b3974996f81a2b9468898dce1a4554ae824d |
Close
Hashes for pyimfit-1.0.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91f921ca4cca4d1d1562ce9bfa92100499f4e159bf1a523ca81331c72a5df515 |
|
MD5 | 695e30d4ecf8f6de818a72b74a6403cd |
|
BLAKE2b-256 | 6a22d8614166dcc8c0f46b00cda754139e52a4b2e7a4567657086ebd175b2c41 |
Close
Hashes for pyimfit-1.0.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f39d610a7f4263b23a1b76ed3f6c2e928a63a4737a143bc4b4cbdd05f7e673e |
|
MD5 | 0f7d50382cefed1b95363bb289bb9a83 |
|
BLAKE2b-256 | 84283156628acaa9e14a1473f6aec5fdf0ec9377b87ed5ab6c069683975ce6db |