Conversation
…get zero attenuation there, and also add some examples
|
I should also note that this change affects the RNG state, and therefore the unit tests. In these files, you’ll see the first 10 events before and after my change, with info looking like this. That’s event number, the depth of the interaction, and one of the RNG state variables at that point in the code. I also print out the angle from the cherenkov angle, and how many antennas passing the noise check that AraSim sees. What you can see is that old and new agree through event 7, but change going into event 8. And the thing that’s different is that “old” thinks ev 7 has 16 signals, but “new” thinks it has none. And that’s because ev 7 is the first event in the new “no no” region that also was close enough to the cherenkov angle to pass the non-zero signal check and get the noise builder to run. And that’s where the RNGs diverge. Because where ev 7 used to trigger the noise construction in the “old”, in the “new” that doesn’t happen. |
|
(Updated weights will be calculated this weekend) |
Three of AraSim's ice attenuation length functions extrapolate into depths where the underlying fits aren't reliable, and the code that uses them divides by L without checking whether the value makes sense. This PR addresses both. Per D. Besson, the attenuation model isn't trustworthy beyond ~2.5 km depth, and downstream code in
Reportcomputesexp(-d/L)and1/Lwithout guarding against division by zero issues, so bad attenuation lengths can show up as NaNs or unphysical signal estimates in the output.This has changes to both the ice model and report.
In Icemodel:
static constexprclass constants:BEDROCK_DEPTH_M = 2850.(South Pole nominal ice column thickness)MIN_PHYSICAL_ATTEN_M = 1.(attenuation lengths below this are treated as unphysical)GetFreqDepIceAttenuLength,GetARAIceAttenuLength, andEffectiveAttenuationLengthnow return0for:VERBOSE_MODEwarning)temperature()has a new optionalbool strict = falseargument:strict=false(the default, which keeps the API ~the ame), the cubic fit is evaluated and then capped at 0 viastd::min(temp, 0.)so it can't return positive (above-freezing) temperatures at depth.strict=true, out-of-ice depths (z < 0orz > BEDROCK_DEPTH_M) throw a runtime error. Generally people should use strict mode, but this way they can plot if they want to.EffectiveAttenuationLength(const Position&, const int&) constoverload. it was unused.In report, the new depth cutoffs mean the attenuation functions can now return
0. This runs a risk of a nan inexp(-dl / 0). So I put some safe guards in. If the returned value is less thanIceModel::MIN_PHYSICAL_ATTEN_M,IceAttenFactoris set to 0.To demonstrate this works, I plotted attenuation length and temperature vs depth. The old one is first, the new one is second. Note in the new one that the attention length floors to 0 meters, and the temp floors to 0 deg C.
I also added helper scripts for making the plots in
examples/atten_length.Addresses #224.