The nu_e_bar table loaded for the Walk_2019 model contains duplicate entries for the times listed below. Column 1 is the time in s, column 2 is the index in the Walk_2019.time member. This was found by running the model through scipy.interpolate.PchipInterpolator, using model.time as the argument x.
This only features in the nu_e_bar file, and appears to have been resolved for other flavors by commit 1e37a4c
from snewpy.models.ccsn import Walk_2019
from snewpy.neutrino import Flavor
from scipy.interpolate import PchipInterpolator
import numpy as np
model = Walk_2019(filename='<path-to-snewpy-models>/Walk_2019/s40.0c_3DBH_dir1')
time = model.time
try:
interp_lum = PchipInterpolator(x=time, y=model.luminosity[Flavor.NU_E_BAR])
except ValueError as e:
print(e)
diff = np.diff(time)
idx = np.where(diff==0)[0]
print(f"{'time':<10s} {'idx':<5s}")
for t, i in zip(time[idx], idx):
# Add +1 to index to point at duplicate entries
print(f"{t.value:<10f} {i+1:<5d}")
The nu_e_bar table loaded for the Walk_2019 model contains duplicate entries for the times listed below. Column 1 is the time in s, column 2 is the index in the
Walk_2019.time
member. This was found by running the model throughscipy.interpolate.PchipInterpolator
, usingmodel.time
as the argumentx
.This only features in the nu_e_bar file, and appears to have been resolved for other flavors by commit 1e37a4c
https://github.com/SNEWS2/snewpy/blob/main/models/Walk_2019/s40.0c_3DBH_dir1_LS220_nuebar
Code to replicate & find duplicate entries
Expected Output