Skip to main content

Combine spectra by forward modelling

Project description

frizzle

Combine spectra by forward modeling (Hogg & Casey, 20xx).

Test Status Coverage Status Documentation Status

Install

uv add frizzle

Getting Started

Combine eight Doppler-shifted spectra of the same source onto a common output grid:

import numpy as np
from frizzle import frizzle
from frizzle.test_utils import make_one_dataset

R = 1.35e5
x_min, x_max = 8.7000, 8.7025

# generate eight synthetic spectra at slightly different Doppler shifts
xs, ys, ivars, bs, delta_xs, _ = make_one_dataset(
    dx=1 / R, snr=12, random_seed=17, x_min=x_min, x_max=x_max,
)

# output wavelength grid
λ_out = np.arange(x_min + 1 / R, x_max, 1 / R)

# concatenate everything into 1-D arrays for frizzle
λ    = np.hstack([xs - dx for dx in delta_xs])
flux = np.hstack(ys)
ivar = np.hstack(ivars)
mask = ~np.hstack(bs).astype(bool)         # True = drop this pixel

# combine
y_star, C_star, flags, meta = frizzle(λ_out, λ, flux, ivar, mask)

See the documentation for a worked example with plots, the most useful kwargs, and why forward modeling beats interpolation.

Authors

  • David W Hogg (NYU) (MPIA) (Flatiron)
  • Andy Casey (Monash) (Flatiron)

With contributions from:

  • Matt Daunt (NYU);
  • Thomas Hilder (Monash);
  • Adrian Price-Whelan (Flatiron);
  • the Astronomical Data Group at the Flatiron Institute; and
  • the Inference Group at Monash University.

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

frizzle-0.2.5.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

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

frizzle-0.2.5-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file frizzle-0.2.5.tar.gz.

File metadata

  • Download URL: frizzle-0.2.5.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for frizzle-0.2.5.tar.gz
Algorithm Hash digest
SHA256 0bd482db990f5ac852cd625554762e21d24046e073c6894a966abc8f95d68993
MD5 cf425e7a5c89ccd5b105483012d6c834
BLAKE2b-256 eabfdaca5d3a5286d5b07ac0747732ec95f558e742c9ce3ae9c5011f1c59b965

See more details on using hashes here.

Provenance

The following attestation bundles were made for frizzle-0.2.5.tar.gz:

Publisher: publish.yml on davidwhogg/frizzle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file frizzle-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: frizzle-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for frizzle-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8b8d1e4b523457a88ee69c82b5886c3c89b9c6d9057347bee36ad3142164c724
MD5 7e64541b49ec07f56220228cb6c28a09
BLAKE2b-256 72fde502bf4304341a6c1677ffc002dc2eca6d4b260d6b47790b2dc4ef5176ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for frizzle-0.2.5-py3-none-any.whl:

Publisher: publish.yml on davidwhogg/frizzle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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