Skip to main content

BYOST (Build Your Own Spectral Template)

Project description

BYOST (Build Your Own Spectral Template)

Using Principal Component analysis (PCA) and Gaussian Process Regression (GPR) to build a spectral template based on two conditions (such as time and light-curve-shape parameter). This work is initially developped to construct the NIR spectral template of type Ia supernovae using the data obtained by CSP-II, see our publication for details.

But it does NOT need to be limited to spectroscopic data, you can use this for other modeling purposes as long as the dataset and attached conditions show correlations (all value need to be finite). The major process is:

  • Apply PCA on the dataset to reduce the dimension to a small subspace
  • Moeling the subspace (PC projection values) dependence on the given conditons using GPR
  • Inverse PCA transformation using the predicted PC from GPR given disired condition

Installation

Option 1 — install from PyPI with pip:

pip install BYOST

Option 2 — install from source with uv:

git clone https://github.com/DeerWhale/BYOST.git
cd BYOST
uv sync

Use uv run python (or uv run pytest) to run commands in the project environment. For tests and docs: uv sync --extra dev.

Quick guide

1. General useage of this packge

For general useage of the this packge, please see the documentation page.

2. NIR spectral template for Type Ia Supernovae from Lu et al. 2023

The Lu et al. 2023 NIR template building blocks ship with the package (BYOST/files/NIR_template_buildingblocks.h5). No extra download is required:

from BYOST.template import get_Lu2023_NIR_template

epoch = 10   # rest-frame days since B-band maximum
sBV = 0.9    # color stretch

wave, flux = get_Lu2023_NIR_template(epoch, sBV)
# wave: wavelength in Angstroms; flux: template flux (arbitrary units)

epoch and sBV must be single numbers (not lists). Optional keyword GPR_score_threshold (default 0.2) controls which principal components are included in the reconstruction.

Citations

If you used this package for your research work, please kindly cite our paper, much appriciated! :)

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

byost-0.0.14.tar.gz (12.7 MB view details)

Uploaded Source

Built Distribution

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

byost-0.0.14-py3-none-any.whl (11.0 MB view details)

Uploaded Python 3

File details

Details for the file byost-0.0.14.tar.gz.

File metadata

  • Download URL: byost-0.0.14.tar.gz
  • Upload date:
  • Size: 12.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for byost-0.0.14.tar.gz
Algorithm Hash digest
SHA256 d424260daec1723ef4699b02cd16c80195baa8861f918d9dee0c20fe68706a6f
MD5 0ac7c5a3c4defafbe6a7b7c8666c4e77
BLAKE2b-256 ecb49e6bd07e943cc60373d2faf5f227bffea57ba305b9032fa9ceaa918c3772

See more details on using hashes here.

File details

Details for the file byost-0.0.14-py3-none-any.whl.

File metadata

  • Download URL: byost-0.0.14-py3-none-any.whl
  • Upload date:
  • Size: 11.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for byost-0.0.14-py3-none-any.whl
Algorithm Hash digest
SHA256 ddfe5219d7cf4746c235b0856e87f2f96226a0a25245392cb04445508860d85d
MD5 bcaba356d3663ac30fc463b1ba9276bd
BLAKE2b-256 adbf8f12fd93db939fea5d0d90e4b84b2cb142c15b9ccd8e77e5559af37a399d

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