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

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

Merged
merged 1 commit into from
May 16, 2023

Conversation

Sheshuk
Copy link
Contributor

@Sheshuk Sheshuk commented May 16, 2023

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 Sheshuk added the SupernovaModel Implementing/correcting supernova model label May 16, 2023
Copy link
Member

@JostMigenda JostMigenda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

(Just out of curiosity, is there any reason to prefer (Ntime, Nenergy) over (Nenergy, Ntime)? I assume it doesn’t really matter and we can just pick one convention as long as we’re consistent, right?)

@Sheshuk
Copy link
Contributor Author

Sheshuk commented May 16, 2023

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

@Sheshuk Sheshuk merged commit 08c3b84 into main May 16, 2023
8 checks passed
@JostMigenda JostMigenda deleted the Sheshuk/fix_preSN branch June 2, 2023 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SupernovaModel Implementing/correcting supernova model
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants