Skip to main content

Component Fitting package

Project description

Python Component Fitting Tool (pycfit)

Python program to replicate many spectral fitting functions of the CFIT system from SolarSoft IDL.

Installation

pip install pycfit

🛠 Important: Conda Environments Must Have Python Installed

If using Conda, ensure your environment includes Python before installing:

conda create --name myenv python
conda activate myenv

pip install pycfit

Use

Use interactive fitter to find an initial model based on an averaged spectra

import pycfit

# Retrieve sample data
wavelength, intensity, uncertainty = pycfit.data.get_example_single_spectra()

# Call the GUI fitter
model = pycfit.cfit_gui(wavelength, intensity, uncertainty=uncertainty)

Use the interactive viewer to fit each point of the raster to the initial model and adjust or mask individual point fittings as needed

# Retrieve a small-patch of sample data
wavelength, intensity, uncertainty, mask = pycfit.data.get_example_grid_spectra(patch=True)

# Create a Grid fitter, using the previously defined model
myGrid = pycfit.cfit_grid(model, wavelength, intensity, 
                uncertainty=uncertainty, mask=mask)

# Fit the whole raster
myGrid.fit(parallel=True, maxiter=100) # Astropy fitter keywords like "maxiter" can be passed through

# Inspect and modify the fits at each point
print(myGrid.shape)
myGrid = pycfit.cfit_grid_gui(myGrid)

# Get results
results = myGrid.get_results()

Contacts:

Software Maintenance:

Ayris Narock: ayris.a.narock@nasa.gov

NASA Official:

Therese Kucera: therese.a.kucera@nasa.gov

License

This project is Copyright (c) National Aeronautics and Space Administration and licensed under the terms of the Apache Software License 2.0 license. This package is based upon the Openastronomy packaging guide <https://github.com/OpenAstronomy/packaging-guide>_ which is licensed under the BSD 3-clause licence. See the licenses folder for more information.

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

pycfit-0.1.6.tar.gz (85.5 MB view details)

Uploaded Source

File details

Details for the file pycfit-0.1.6.tar.gz.

File metadata

  • Download URL: pycfit-0.1.6.tar.gz
  • Upload date:
  • Size: 85.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pycfit-0.1.6.tar.gz
Algorithm Hash digest
SHA256 256b6bc9e54c61602cadd8c77ad759c347df8a2bdfad8f22a1a6585d8ae47c2f
MD5 78dc4dcb4d654c14c3077ee0ee66251e
BLAKE2b-256 5ff95132ff4528e792f9efe5b9ff7c13c6bd2d67564f1e836b9aaf3d75e64cd1

See more details on using hashes here.

Supported by

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