You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've found differences in the EBL absorption(with Saldana-Lopez model) between agnpy and the data released by Saldana-Lopez.
Then I checked the function load_absorption_table and found that all the models use np.unique() to return the sorted unique elements of an array. However, we don't need to sort data in Saldana-Lopez model.
The text was updated successfully, but these errors were encountered:
@huangylei, thanks a lot for reporting this.
I will make a fix soon.
Do you have a snippet to show the issue you are reporting?
The interpolated values are checked against the original table values in the tests, so I am surprised by this.
I used the table that Saldana-Lopez provided, and compared it with the result by agnpy. They are different. (Unfortunately
I cannot find the code)
I checked the function load_absorption_table into:
defload_absorption_table(self):
"""load the reference values from the table file to be interpolated later"""f=fits.open(self.model_file)
self.energy_ref= (
np.sqrt(f["ENERGIES"].data["ENERG_LO"] *f["ENERGIES"].data["ENERG_HI"])
*u.keV
)
# Franceschini file has two columns repeated, eliminate themifself.model=="franceschini":
self.z_ref=np.unique(f["SPECTRA"].data["PARAMVAL"])
self.values_ref=np.unique(f["SPECTRA"].data["INTPSPEC"], axis=0)
else:
self.z_ref=f["SPECTRA"].data["PARAMVAL"]
self.values_ref=f["SPECTRA"].data["INTPSPEC"]
It worked and perfectly match the result that Saldana-Lopez provided. After this change, the aborption should be:
I've found differences in the EBL absorption(with Saldana-Lopez model) between
agnpy
and the data released by Saldana-Lopez.Then I checked the function
load_absorption_table
and found that all the models usenp.unique()
to return the sorted unique elements of an array. However, we don't need to sort data in Saldana-Lopez model.The text was updated successfully, but these errors were encountered: