Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add get_band_fluxes to source models #115

Open
OliviaLynn opened this issue Sep 18, 2024 · 0 comments
Open

Add get_band_fluxes to source models #115

OliviaLynn opened this issue Sep 18, 2024 · 0 comments

Comments

@OliviaLynn
Copy link
Member

We should add a method in source models that:

  • takes in a Passband or PassbandGroup (and time t)
  • evaluates the model based on the Passband/PassbandGroup's waves array to get spectral fluxes
  • call the Passband/PassbandGroup's flux_to_bandflux/fluxes_to_bandfluxes on these spectral fluxes
  • returns the band fluxes

Based on Mi's description:

I left a comment on Olivia's passband PR. After looking at the code, I would like to keep advocating for the following interface:
passband = Passband(delta_wave: float | None = 5, trim_percentile: float | None = 0.1) band_flux = source.get_band_fluxes(passband, t)

This will avoid confusion from users having to call spectral_flux = source.evaluate(passband.waves, t) and having to know that the evaluate should be on the passband.waves grid. And not having to check if user has actually call evaluate with the correct grid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant