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

Uploaded Python 3

File details

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

File metadata

  • Download URL: frizzle-0.2.7.tar.gz
  • Upload date:
  • Size: 13.2 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.7.tar.gz
Algorithm Hash digest
SHA256 66f3143bcddc65313a14038a328623cc159a7c1c8c0fd4de54ef3407d370770a
MD5 570cab592ae8c2359603349141fb1e85
BLAKE2b-256 1225f366463c24500196ee681d5153d1d19c848aa9ca864dd98f4ade4e7e6e42

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: frizzle-0.2.7-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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 e3c949289eecd8dd794c48a4afa7a20d1f46e07ab68ac950a533cd96a8f7eedd
MD5 a06fd7ba11245af357bcce535d73c03a
BLAKE2b-256 e9d94a77ea4e36fc9e9aa77290ed1a31a2126887155ad59c8dc4272a28dd80d4

See more details on using hashes here.

Provenance

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