SNEWS2 / snewpy

A Python package for working with supernova neutrinos
https://snewpy.readthedocs.io
BSD 3-Clause "New" or "Revised" License
26 stars 19 forks source link

Transpose the preSN flux arrays in , to match the (Ntime,Nenergy) shape, same as in CCSN #237

Closed Sheshuk closed 1 year ago

Sheshuk commented 1 year ago

A small fix to make flux/initial_spectra, produced by preSN models have the same shape as in case of CCSN models: provided time and energy arrays, the shape of the of the result spectra should be [len(time), len(energy)].

We don't have the checks for that resulting shapes in our tests. We'll need to revise the test suite (not in this PR)

Sheshuk commented 1 year ago

At the moment it doesn't make any difference - because in all the places like generate_time_series we use python loop over the times, generating time points one by one: https://github.com/SNEWS2/snewpy/blob/9096246377102e9d0e850c11396fa1e62779d642/python/snewpy/snowglobes.py#L110C2-L122

But it will make difference when we'll start using the vectorized computation in the future, so I decided to make the shapes uniform the same way as most of the CCSN models