Skip to content
项目

关于

SED_Tools is a sofware suite to provide easy attainment, manipulation and creation of synthetic photometry data products

人工智能与机器学习

这些数字如何统计

实测星标增长

24小时
0
7天
-3
15天
-3
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

SED_Tools logo

SED_Tools

Stellar spectral grids and photometric filter curves, ready for MESA and for Python

Tests PyPI DOI

SED_Tools downloads stellar spectral grids (model spectra indexed by Teff, log g and [M/H]) and photometric filter transmission curves, and converts them to one set of units. From these it writes the flux cubes, lookup tables and filter folders that MESA's colors module and SED_Model read. The same work can be done from the command line (sed-tools) or through a Python API.

  • Spectral grids from the NJM mirror, SVO, MSG and MAST (BOSZ): a grid may be downloaded whole or in part, then rebuilt, combined, densified and interpolated.
  • Filter curves from the NJM mirror, the instrument teams' own files or SVO, with the detector convention (photon or energy counting) recorded in each file.
  • Optical-path components (filter, optics, detector QE and the site's atmosphere) are kept separate where the team publishes them separately, and composed on request.
  • Synthetic photometry, filter properties and zero points, search and citations; ML tools extend incomplete spectra or generate spectra from their parameters.

The NJM mirror is optional. Without it, SED_Tools falls back on installed copies, the original-source builders and SVO.

Install

pip install sed-tools                 # Python >= 3.10
pip install "sed-tools[full]"         # adds scipy, scikit-learn, torch, xlrd, dust_extinction

Data are stored under ~/.sed_tools/data by default. sed-tools config shows the location and changes it.

Quick start: command line

sed-tools                                     # interactive menu
sed-tools filters GAIA/GAIA                   # download a filter set
sed-tools grids --grids Kurucz2003all --teff 4000 8000 --logg 3 5   # part of a grid (about 110 MB)
sed-tools filters-info GAIA/GAIA              # what a filter set contains and where it came from
sed-tools --help                              # every command; `sed-tools <command> --help` for its options

Quick start: Python

from sed_tools.api import SED, Filters

Filters.fetch("GAIA", "GAIA")
SED.fetch("Kurucz2003all", teff_min=4000, teff_max=8000, logg_min=3, logg_max=5)
sed = SED.local("Kurucz2003all/Kurucz2003all_alpha_0p00_lh_1p25_vtur_2_km_s")
mags = sed(teff=5777, logg=4.44, metallicity=0.0).photometry("GAIA", system="AB")
print({name: round(result.magnitude, 2) for name, result in mags.items()})
# Magnitudes of the surface flux (G is about -38.5 for the Sun); scale by (R/d)^2 for a star at distance d.

Using the data in MESA

Every download prints the lines that belong in the &colors inlist, for example:

instrument  = '/home/you/.sed_tools/data/filters/GAIA/GAIA'
stellar_atm = '/home/you/.sed_tools/data/stellar_models/Kurucz2003all/Kurucz2003all_alpha_0p00_lh_1p25_vtur_2_km_s'

Paste them as printed. MESA reads the absolute paths, so nothing needs to be copied into MESA's own data folder. sed-tools mesa-path PATH prints the lines again for any installed grid or filter set, and sed-tools vega downloads the Vega spectrum that MESA uses for Vega magnitudes.

A grid split into ‘variants’ (Kurucz2003all: [alpha/M] 0 and 0.4) has one folder per variant, and MESA reads one of them; the grid's top folder is for SED_Tools only. Do not copy a whole split grid into $MESA_DIR/data/colors_data/stellar_models/: its files mix with MESA's own Kurucz2003all, and it replaces MESA's lookup table. The MESA guide gives the details.

Documentation

Guide Contents
Install Extras, installing from source, the data directory
Quick start A filter set, part of a grid, a spectrum and its magnitudes, the MESA lines
Spectral grids Sources, partial downloads, local grids, split grids and the all-axes cube, rebuild, combine, densify, import, coverage
Filters Fetching, storage, detector types, components and atmospheres, composing, combining, label_check
Photometry and zero points AB and Vega magnitudes, band integration, filter properties, zero points, display colours
MESA Inlist lines, mesa-path, mesa_prepare, Vega, what not to copy
Machine learning SED completer and generator
Command line Every sed-tools command, the menu, exit codes
Python API SED, SpectralGrid, Spectrum, Filters, examples, the CLI-to-API table
NJM mirror What the mirror serves, its catalogue and cache, working without it
Developing Package layout, tests, golden tests, releases
Citing SED_Tools, the data providers, Filters.cite
Changelog Changes in each release
Notebooks Worked examples

Citation

Please cite the archived release through Zenodo, using the concept DOI. It covers all versions and resolves to the latest: 10.5281/zenodo.18321943.

Version 0.6.0: 10.5281/zenodo.24117340

The metadata are in CITATION.cff. SED_Tools is the data-preparation pipeline for MESA's colors module (colors/README.rst). The filter curves and spectra belong to the teams that published them; please cite them as well. Filters.cite("GAIA/GAIA") prints the references and the acknowledgements each provider asks for.

Contributing and licence

Bug reports and pull requests are welcome; see CONTRIBUTING.md, the Code of Conduct and the Security Policy. We thank @andysantarelli, @tianzhijia and @rhdtownsend for their issues and suggestions. We also thank MESA, the SVO Filter Profile Service, MAST and Rich Townsend's MSG grids for the data and services used.

Released under the MIT License.

探索相关项目

加载中…