Open stlgolfer opened 1 year ago
Thank you for this contribution! Log-spaced time bins are a great idea, and will be especially useful for pre-SN neutrinos once we officially support them in snewpy. The code looks fine to me; after removing the testing files and commented out code (and perhaps some bits of very minor cleanup) this should be okay to merge.
I’m so sorry, but it seems I missed the forest for the trees in my earlier review:
if tmax <= 0 or tmin <= 0:
raise ValueError("Cannot apply log to time windows that are less than or equal to 0. Consider adjusting model time window")
The problem is that the generate_time_series
function here doesn’t let the user adjust the time window by passing tmin
and tmax
as arguments (only generate_fluence
does!), so this error message is not actionable.
These inconsistent and confusing arguments are definitely something we need to fix as part of #209 (which just got moved a little higher up my priority list). In the meantime, should we put this PR on hold? Or is it worth adding tmin
and tmax
arguments to generate_time_series
in this PR as well, even though we’ll overhaul the generate functions soon anyway?
This PR is to continue the discussion in the tg3-detectorresponse slack channel regarding logarithmically spaced time bins in the
generate_time_fluence
feature insnowglobes.py
. I've also implemented @JostMigenda 'sValueError
idea for dealing with negative times. Please note that this PR is merely a prototype and it includes two files:data_handlers.py
andlog_bins.py
that are necessary to testing but are not intended to be included in the final product.