SNEWS2 / snewpy

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

Duplicates in Tamborra_2014, 11.2 solar masses for all flavours #265

Closed jakob2508 closed 10 months ago

jakob2508 commented 10 months ago

In SNEWPY version 1.4b1 the luminosity of the Tamborra 2014, 11.2 M_solar model for all flavours (s11.2c_3D_dir1_LS220_nue, s11.2c_3D_dir1_LS220_nuebar and s11.2c_3D_dir1_LS220_nux) have duplicates in the last two lines.

As an example here are the last five lines of the s11.2c_3D_dir1_LS220_nue file:

0.34828 22.514 12.543 199.6
0.34878 22.577 12.569 200.44
0.34928 22.53 12.57 200.44
0.34979 22.398 12.554 199.84
0.34979 22.398 12.554 199.84

I am reporting this because if the luminosity is interpolated, some interpolators might report issues that the time sequence is not strictly monotonic.

Here is some minimal code that allows you to check how many duplicates there are. In the case of a non-duplicate time array, the array counts should only contain ones.

from snewpy.models import Tamborra_2014
model = Tamborra_2014(progenitor_mass=11.2 * u.solMass, direction=1)
time = model.time
unique, counts = np.unique(time, return_counts=True)
print(counts)
jakob2508 commented 10 months ago

For me deleting the last line in all of the above files solved the issue.

JostMigenda commented 10 months ago

Hey @jakob2508, thanks for reporting this! You’re right, we should remove those duplicate lines—can you submit a pull request with these changes?

jakob2508 commented 10 months ago

Hey @JostMigenda, I have changed the flux files in my local branch but I can't push them. Could it be that I don't have the permissions?

JostMigenda commented 10 months ago

Yep, only members of the SNEWS2 organization here on GitHub can push their branches to the repo directly. If you're planning to contribute more to snewpy, we can add you as a member; but for now, can you please create a fork of the repository and then create a PR from the fork?