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

To get frizzy wit it:

uv add frizzle

Getting Started

You should see the documentation for a worked example with plots, the most useful keyword arguments, and for why forward modeling beats interpolation.

If you want a quick crash course, here we will 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)

Authors

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

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: frizzle-0.2.8.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.8.tar.gz
Algorithm Hash digest
SHA256 cdfc20ef832cc2021a97941e27c3182fa0e2c8eae116cbc236c9db0c22b8e031
MD5 324c0d26748593d60652ab89d6b3409d
BLAKE2b-256 9f3daaca3dcc480036115123cbe0c5e1867584dd9c0e903100f566bdd4fb0bca

See more details on using hashes here.

Provenance

The following attestation bundles were made for frizzle-0.2.8.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.8-py3-none-any.whl.

File metadata

  • Download URL: frizzle-0.2.8-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.8-py3-none-any.whl
Algorithm Hash digest
SHA256 e6c1fb591998e0a7b72027004da33ee7b1c3be71c5424fb1b25ee084db2a9690
MD5 5206f73c686932ff0e1404e564662b18
BLAKE2b-256 34cf13459e5badd90c19842f8c065729053e4db92bf937584570b3bbb2e045c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for frizzle-0.2.8-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