Skip to main content

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


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.1.tar.gz (10.8 MB view details)

Uploaded Source

Built Distributions

pyimfit-1.1-cp312-cp312-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

pyimfit-1.1-cp312-cp312-macosx_10_13_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.12 macOS 10.13+ x86-64

pyimfit-1.1-cp311-cp311-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

pyimfit-1.1-cp311-cp311-macosx_10_9_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

pyimfit-1.1-cp310-cp310-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

pyimfit-1.1-cp310-cp310-macosx_10_9_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

File details

Details for the file pyimfit-1.1.tar.gz.

File metadata

  • Download URL: pyimfit-1.1.tar.gz
  • Upload date:
  • Size: 10.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pyimfit-1.1.tar.gz
Algorithm Hash digest
SHA256 ede06abb63dc2741ad3debf7f866471bfb8fc123eca40da8d4754dbb62e219b1
MD5 e9fcbb5a2fb1643c48349d0af2ea0c35
BLAKE2b-256 36d18d6de714d933e01aa7d0040c4cc186038403897c706807d2ea2ca11af1ca

See more details on using hashes here.

File details

Details for the file pyimfit-1.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyimfit-1.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1a0fc5403a0fad8b671c4b93ad9e0d1d9f8a24af8aa14230be866fdbdc93ca96
MD5 83ec35c5c93162efeaf592760dc3c40a
BLAKE2b-256 48a863db3bbd4a265d36f93a56407b0be14543ac6644fe6d0fcad144903d0b59

See more details on using hashes here.

File details

Details for the file pyimfit-1.1-cp312-cp312-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for pyimfit-1.1-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 d493ccb3d3085ec5e4aeb5dfecf441df58c490f484f7a709af6b40b7fa7b99a6
MD5 00151fe99f10948a69a708b11d45b8a9
BLAKE2b-256 2ad3cc654198ab606ca92e28b9b828a95847f2e7534dde4a4863e62a5a7da588

See more details on using hashes here.

File details

Details for the file pyimfit-1.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyimfit-1.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5ae7e70d7e318c9b271a4d7692d2c70595d8b9c880f4bcab9ed4090a435a5f83
MD5 8a26d8519057ab2a1da24a2f6c23cbfe
BLAKE2b-256 7e0bbeb1ecf5a2e89e1deea9b452a23646c2321906bb16704bd9067c2ccb296f

See more details on using hashes here.

File details

Details for the file pyimfit-1.1-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyimfit-1.1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f7a4212341dc3bca569f35137aa454d013089cc37dbe66eeb40db6accdbfaed8
MD5 6e6853c45bdea316f09b803835e07c1e
BLAKE2b-256 56b5d223a06aa153719dc71cd074b1adb59a7a0efe9abc78e1250f3461bf15f5

See more details on using hashes here.

File details

Details for the file pyimfit-1.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyimfit-1.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a85ca5149944d9fac20f7f83de57dbec0807fe0025305d4916e1d94a8fbe2f77
MD5 f12e75befdd9cb4c6ee9d02c5d180a95
BLAKE2b-256 8a352cd6405a901f13e236516f0647f6b880f8d085db52ab021c6a619e5fb4d2

See more details on using hashes here.

File details

Details for the file pyimfit-1.1-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyimfit-1.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 8deacc7947117ea3f827b219b629af6000abce6939f96607666bd87346b8d027
MD5 56e63e69a0e8a3ab4354154d00980d69
BLAKE2b-256 f6c65e3bcbd251f65cae5b18f4180ef845c851e0718c494e83b838f4b96990f3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page