Skip to content

Commit

Permalink
Merge pull request #237 from SNEWS2/Sheshuk/fix_preSN
Browse files Browse the repository at this point in the history
Transpose the preSN flux arrays in , to match the (Ntime,Nenergy) shape, same as in CCSN
  • Loading branch information
Sheshuk committed May 16, 2023
2 parents 9096246 + 4360a6e commit 08c3b84
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/snewpy/models/presn.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def get_initial_spectra(self, t, E, flavors=Flavor):
alpha = np.expand_dims(alpha, 0)
b = np.expand_dims(b, 0)
fluence = a * Enu ** alpha * np.exp(-b * Enu) / (u.MeV * u.s)
result = {f: fluence * self.factor[f] for f in flavors}
result = {f: fluence.T * self.factor[f] for f in flavors}
return result


Expand Down Expand Up @@ -103,7 +103,7 @@ def get_initial_spectra(self, t, E, flavors=Flavor):
t = np.array(-t.to_value("hour"), ndmin=1)
E = np.array(E.to_value("MeV"), ndmin=1)
flux = self.interpolated(t, E) / (u.MeV * u.s)
return {f: flux[f].T for f in flavors}
return {f: flux[f] for f in flavors}

class Kato_2017(SupernovaModel):
"""Set up a presupernova model based on
Expand Down Expand Up @@ -138,5 +138,5 @@ def get_initial_spectra(self, t, E, flavors=Flavor):
t = np.array(-t.to_value("s"), ndmin=1)
E = np.array(E.to_value("MeV"), ndmin=1)
flux = self.interpolated(t, E) / (u.MeV * u.s)
return {f: flux[f].T for f in flavors}
return {f: flux[f] for f in flavors}

0 comments on commit 08c3b84

Please sign in to comment.