prepare_flux

nyx.spectra.library.prepare_flux(wvls_in, flux, wvls_out, validate=True, from_energy=False)[source]

Convert and resample arbitrary flux data to a target wavelength grid.

Parameters:
  • wvls_in (array-like or astropy.units.Quantity) – Source wavelength grid the flux is sampled on, in nm.

  • flux (array-like or astropy.units.Quantity)

  • wvls_out (array-like) – Target wavelength grid to resample onto, in nm.

  • validate (bool) – Whether to validate the input arrays.

  • from_energy (bool) – Whether to convert energy flux to photon flux.

Return type:

jax.Array