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 = pyimfit.FixImage(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)
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 imfit_fitter.fitConverged is True:
print("Fit converged: chi^2 = {0}, reduced chi^2 = {1}".format(imfit_fitter.fitStatistic,
imfit_fitter.reducedFitStatistic))
bestfit_params = imfit_fitter.getRawParameters()
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.7.7.tar.gz
(629.8 kB
view hashes)
Built Distributions
Close
Hashes for pyimfit-0.7.7-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 243d5fbe93569deda844819fc69eb125f3dec386f786c498095931f742004441 |
|
MD5 | 2ec17649c34f8b9b0cd1eadf1d5fd67d |
|
BLAKE2b-256 | 2fbbb9ec0a15dbf98b9663df3a636e1b17def655e289d39cf0b22d51cedb8b7b |
Close
Hashes for pyimfit-0.7.7-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 486de02e012bdfed38dbfa45032e1dac3794b674579371017def1e2c24ffabcc |
|
MD5 | 18688748f2c8d2d38f55d73a7f7dae88 |
|
BLAKE2b-256 | 83558f84e513516f099bd0f3f8baf76af2f2dd4c816ec31ae5fa3c5dc863b0c3 |
Close
Hashes for pyimfit-0.7.7-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6bb41ecc701b8875cfda5d551759a056956b04c8d5c0e77e8206498db9c4474c |
|
MD5 | a5fffd3093bf481983e1a26a43b62899 |
|
BLAKE2b-256 | b01d7f944c970d9f8276e4f01b050c518920cf3d3f28055f9e049c559aea0079 |
Close
Hashes for pyimfit-0.7.7-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c24d7468a9a241cab37b216ce4838b2fc1fd7fa00657ccd185e469bc0e96948 |
|
MD5 | bb4d493aa9fc609d9b4ce4c619d88730 |
|
BLAKE2b-256 | a6874d7a2b398d5e379bb1b16ff5d5138238a15df7da29dd0566386ae3e5c4b5 |
Close
Hashes for pyimfit-0.7.7-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 477beb274376f6e0bb66f1be8b10a77cdb98ce9d211916a27389ab72e98ce8e1 |
|
MD5 | 1fdc9eb7fc6c61afe748909688cb9342 |
|
BLAKE2b-256 | 285bca4acc4a655eb694572bf041c61491d69e8085abc09241ff84212bd214d4 |