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

Uploaded Python 3

File details

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

File metadata

  • Download URL: sefi-2.2.4.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.4.tar.gz
Algorithm Hash digest
SHA256 110febe4fde46158f8e143335f489fd7eb433e5a1b2cdb267b9e16931da88572
MD5 a5711c9d0f87763c361136f5862b8106
BLAKE2b-256 f272fbfa7bd1272bab9d2baabbd7fe24a7c19b6284b68019b911dfbb2d41ee05

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sefi-2.2.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 757239957cfa622efa2080b2ef78259230978c40dcca1415135ac0d689ada326
MD5 4f7b0d69109c16c37dfc3e7dacb3e589
BLAKE2b-256 34d4aaccc787099a5c937ffbb25b408815a8ac2a9f470f4c656a45233e035512

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