flaresimulations / synthesizer

Synthesizer - a code for creating synthetic astrophysical observables
https://flaresimulations.github.io/synthesizer/
GNU General Public License v3.0
17 stars 8 forks source link

Add Grid methods that calculate the broadband luminosity or photon luminosity for the entire grid #333

Closed stephenmwilkins closed 11 months ago

stephenmwilkins commented 1 year ago

It would be helpful to have methods on Grid that calculate the broadband luminosity and ionising photon luminosity for the entire grid. For the luminosity it would take a FilterCollection as an argument and return a 2D array of luminosities. For the ionising photon luminosity it would take the min and (optionally) max photon wavelengths (or energies or frequencies) and, again, return a 2D array.

Obviously this could be done in a loop, and maybe that's simplest, and I can implement it. However, @WillJRoper may have a more efficient approach if the apply_filter methods can take 2D arrays?

christopherlovell commented 1 year ago

I don't think you want methods on grid. Rather, you want a method that converts the spectra array on grid into an sed object. You can then treat it like any other sed object

stephenmwilkins commented 1 year ago

Yes, this makes most sense. I wonder if SED objects with 2D arrays (or worse) will work?

christopherlovell commented 1 year ago

They should, see https://flaresimulations.github.io/synthesizer/sed.html#Multiple-SEDs

WillJRoper commented 1 year ago

Dropping in to point out that apply_filter works on an arbitrary dimensional array as long as the final dimension is the wavelength dimension. See the doc string.