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.0.tar.gz
(10.6 MB
view hashes)
Built Distributions
Close
Hashes for pyimfit-0.11.0-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78fad7424cb0861168556a471ae73fb5852b624b799405a1738c569cb3e0169b |
|
MD5 | e9e828fe64d533d242359220f97c15b1 |
|
BLAKE2b-256 | df86c19a899daa7463427f4f33a791b30c837007167da6a926bc6c10e16d494c |
Close
Hashes for pyimfit-0.11.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35988151743821e70fb4aec521982681b3624370c067289101503c903b57c7b5 |
|
MD5 | 84bdadcabe4df44f0ecb0c8f8e5280e0 |
|
BLAKE2b-256 | 004c70a16d881c683b4e4e36954871e857c34d01b915c9d4f89157d03dfcafa7 |
Close
Hashes for pyimfit-0.11.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 557891d87a11a27cc6e1e68bb5cf083eb614e31530a33f755776ffd9f80fc3fe |
|
MD5 | a73b7035b0cc83157a1c491a84705bbf |
|
BLAKE2b-256 | 6d4785132c1a89349552fa02d0e3864ead3a1cb80e9f8b2c27648390be659b2a |
Close
Hashes for pyimfit-0.11.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd7873bad6f62ea92fe736280afc20a91cfa9c1aec28325b703af2a167f2ad91 |
|
MD5 | d705d4d4aaf18a15cbe344add9d52af9 |
|
BLAKE2b-256 | 23df31e031d7e6c2d63a3726cb2a5f5bac6bc089e472eb9b5d5f3d08a6ccaf85 |
Close
Hashes for pyimfit-0.11.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7da5875157e92ab659c807dd2dd65f9c31ac63c4ae288e0ce1b3f5960b2d37db |
|
MD5 | 3a2a7db84f2e27ff48f3deb71199bd50 |
|
BLAKE2b-256 | 85399bf6909f4e8b439223f164a96dbb163c005fb06df845f9f55dcc04a4dd24 |