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.6.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.6-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sefi-2.2.6.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.6.tar.gz
Algorithm Hash digest
SHA256 8dad9dedfdc9006a4eb05a1a3dc4fb6b45775bec37a1cee09b79c3dd9e5a7266
MD5 024c766d32db10346aab90aa3428a375
BLAKE2b-256 cb350fe8a0e32fdb464a9ad5cdf5fcbfac8f8eabca1524c34b0c97ffb8cc83b6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sefi-2.2.6-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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 4e3e08073602401ee5f6d7fa585fefa89abda200f8e39c941eaeaabca62cb9fe
MD5 1546c67cce1beb7f4bcc04a0f3241513
BLAKE2b-256 c73e32884f627470fea87c1996f283e31c67eb34b9235f5e6b84b90ab64c8449

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