Skip to main content

Alias package for S3Fit (Simultaneous Spectrum and photometric-SED Fitting code for observation of galaxies)

Project description

S3Fit

S3Fit: a Simultaneous Spectrum and photometric-SED Fitting code for observation of galaxies

S3Fit is a Python-based tool for analyzing observational data of galaxies. It offers powerful capabilities for decomposing spectroscopic data by supporting multiple continuum and emission line models with multiple components, making it well-suited for complex systems with mixed contributions from Active Galactic Nuclei (AGNs) and their host galaxies. By simultaneously fitting the spectrum and multi-band photometric Spectral Energy Distribution (SED), S3Fit improves constraints on continuum model properties, which may be poorly determined when fitting spectral data alone due to its limited wavelength coverage. With an optimized fitting strategy, S3Fit efficiently derives the best-fit solution for dozens of model parameters. Additionally, it provides an extensible and user-friendly framework, allowing users to modify model configurations and incorporate new model components as needed.

Features of S3Fit

  • Easy switch between pure spectral fitting and joint spectrum+SED fitting modes.
  • Support for flexible combination of multiple stellar populations with different star formation histories (SFH).
  • Support for flexible combination of multiple emission line components.
  • Support for AGN continuum models across UV/optical and IR wavelength ranges.
  • User-friendly functions for outputting and visualizing fitting results.
  • Highly extensible framework, allowing users to add new features such as new SFH functions, emission lines, and custom model types.

Fitting strategy

The full fitting pipeline of S3Fit is shown in the following flowchart, with a detailed description of the fitting strategy in manuals.

An example of the fitting result of S3Fit is shown in the following plots (and details in this paper).

Usage

Please find guides in manuals for basic and advanced usages of this code. Examples of the usage of S3Fit are provided in example1 and example2

Installation

You can install S3Fit with pip:

pip install s3fit

S3Fit mainly depends on several most widely utilized repositories for science calculation, scipy, numpy, and astropy. The core requirement of S3Fit is the two functions least_squares and lsq_linear in scipy.optimize (please read the fitting strategy for details). A strong dependency of S3Fit on these repositories is not expected. joblib is required to run fitting in multithreading (from v2.3). It is optional to run S3Fit with PyNeb, which is used to calculate intrinsic flux ratios of emission lines:

pip install s3fit[pyneb]

Dependencies:

python >= 3.10
scipy >= 1.12.0
numpy >= 1.26.4
astropy >= 6.0.0
joblib >= 1.5.2
matplotlib >= 3.9.1
pyneb >= 1.1.23 (optional)

Future updating

  • Add ISM dust and synchrotron models (you may also add them or other models by yourself following the advanced usage manual).
  • Add iron pseudo continuum templates and Balmer continuum of type-1 AGN (supported in v2.3).
  • Absorption lines (supported in v2.3).

Citation

If you would like to use S3Fit, please cite with the following BibTeX code:

@software{2025ascl.soft03024C,
       author = {{Chen}, Xiaoyang},
        title = "{S3Fit: Simultaneous Spectrum and photometric-SED Fitting code for galaxy observations}",
 howpublished = {Astrophysics Source Code Library, record ascl:2503.024},
         year = 2025,
        month = mar,
          eid = {ascl:2503.024},
       adsurl = {https://ui.adsabs.harvard.edu/abs/2025ascl.soft03024C},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

Reference

S3Fit uses the Single Stellar Population (SSP) library HR-pyPopStar (paper). Please download the HR-pyPopStar library and run the converting code to create the SSP models used for S3Fit. You may also want to download an example of the converted SSP model for test in this link.

S3Fit uses the SKIRTor (paper1, paper2) AGN torus model. Please download the SKIRTor library and run the converting code to create the torus models used for S3Fit. Example of this library is also provided in model libraries for a test of S3Fit, which contains the templates with a fixed dust density gradient in radial (p = 1) and angular direction (q = 0.5). Please refer to SKIRTor website for details of the model parameters.

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

sefi-2.2.5.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sefi-2.2.5-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file sefi-2.2.5.tar.gz.

File metadata

  • Download URL: sefi-2.2.5.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for sefi-2.2.5.tar.gz
Algorithm Hash digest
SHA256 7bc9737bd3b4d5acf0827c81442119d7cd3fccaea8dbfa173245399c8cb342a4
MD5 f9b4633c6f1d5952df3f6abd9336ca0f
BLAKE2b-256 83416b5a6ef299976b0861221780f19fcd2f388a5b8cd6aecb8d9688f4a40a59

See more details on using hashes here.

File details

Details for the file sefi-2.2.5-py3-none-any.whl.

File metadata

  • Download URL: sefi-2.2.5-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for sefi-2.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 e1d4980acae1f536f4c4bae709c9a505271b8c650d3da0ec4e06e802957f9ff7
MD5 f9319442f209a113c59b51ba1082d6a3
BLAKE2b-256 4aac49c9c60db48bd4944ce6d6b77d64e21c24ccc2150c1e80a7eac63cb13479

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