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

Uploaded Python 3

File details

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

File metadata

  • Download URL: frizzle-0.2.6.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.6.tar.gz
Algorithm Hash digest
SHA256 cfdb0752d4d94e76f031588e6231e7affe492f3d238af277e022358f7f4e1610
MD5 172569960ef5614888a6f34074789539
BLAKE2b-256 4e3e8930b8891c4be640337590b24d697300e4094e41dd94fd1ba3931d79eda3

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: frizzle-0.2.6-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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 426c98e11c93e1d2d8b842103af3bec84a16925e2765d76f7254f09eb4edd775
MD5 e24dd698fe51b4f00067b54ba3a8861f
BLAKE2b-256 f7e230508555a55bba76f5b242dacb1e93c81ccf4e4857073a065a957f06ee60

See more details on using hashes here.

Provenance

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