Add a StereoDispCombiner#2731
Conversation
47d2798 to
8902c7f
Compare
kosack
left a comment
There was a problem hiding this comment.
We have a predicted disp.sign_score that is not used in this method, which seems odd. Is that the reason why the pair-wise average including both disps is made rather than a simple weighted average over predictions? Is there citation for the MARS method, by the way? i'd be interested to see if simpler methods were tested.
This |
It's also easy to argue why: especially at low energies, disp sign is not really reconstructible (random guess, sign_score ~ 0.5). But with multiple telescopes, it's quite easy to see which option is actually correct and make the weighted average over the correct locations. There are still a couple of different options for stereo disp, but most of them do not actually use the sign prediction, that is only used for mono as far as I know. The MAGIC MARS method is explained in a short paragraph here:
|
add0d93 to
5fb1c20
Compare
Not really, this is more of a book-keeping for doing lower-level performance plots. It could be used for a quality query or similar, but AFAIK, this was not yet done anywhere and would be a completely new development that needs to be tested. Would be a nice study though. |
During the quantitative analysis of the |
d9230cc to
6628171
Compare
|
combiner_theta2_reco_lon_lat_zen_20_az_0_ac_full_array.pdf The |
0779598 to
711e49e
Compare
|
|
I'm not quite sure I understand the logic of weighting distances, which should be related to the absolute value of disp, with the sign score. Especially since we are trying out all combinations, effectively ignoring the predicted sign. |
|
Sorry for the above message, I forgot about the comment of near-parallel high energy showers. So penalizing choosing what the classifier thinks is a clearly wrong sign is good I think. I'm not sure though that weighting the distance achieves this goal. For your comparison plots, it might help to include large percentiles to see differences. It expect this to mostly affect rare events, so the effect is probably only seen in something like a 90 % or 95 % containment, not 68 %. |
|
Could you also maybe expand a bit what datasets you are using here and how they have been processed? |
- property trait of StereoDispCombiner should not be configurable
- reduce .copy() when unecessary - remove indirection in __call__
- 5-10% faster
Update:
Open points for discussion
|
|
|
The With the introduction of the
A few additional notes on
Hope that helps a bit |
I'm not sure that this is the right approach here, but we already do something like this in the number of islands code, where we use the internal representation of a scipy csr sparse matrix, which essentially is an array of variable length arrays. |
|
You could write a numba function that takes a single 1d array of all disp values and an array of multiplicities per stereo event. You can then index into the 1d array of disp values.
https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.csr_array.html |
| return stereo_fov_lon, stereo_fov_lat, True | ||
|
|
||
| if ( | ||
| multiplicity == 2 |
There was a problem hiding this comment.
Why is two a special case here? Don't we need to check min_ang_diff for each pair and check if we got any pairs left after that check?
In a first quick check, it looked like the largest performance losses related to near-parallel main shower axes occur mainly for multiplicity n=2. At the same time, I had found an old comment in the EventDisplay code suggesting that this was also only checked for multiplicity 2, although I realized now that this comment is outdated. After looking through the EventDisplay implementation more carefully, I think you are probably right that it makes more sense to apply this to all events. In EventDisplay, the code computes the mean angle over all pairwise telescope-axis combinations and then applies a cut on this averaged angle. So in that implementation the full event is either kept or rejected; it does not just remove the individual 2-telescope combinations with small angular separation. I also noticed that EventDisplay uses a more L1-like minimum-distance criterion, i.e. a weighted mean pairwise distance, rather than the SSE that is currently implemented in this PR. The SSE penalizes outliers more strongly, which can be beneficial when the correct sign assignment leads to a tight cluster of telescope-wise solutions. On the other hand, the Euclidean distance criterion is probably somewhat more robust against poorly reconstructed main shower axes. In addition, for multiplicities m>5, EventDisplay uses the Hillas-intersection result as a starting point and then chooses for each telescope the DISP sign whose solution lies closest to that Hillas-intersection estimate. This also seems broadly consistent with the results from Lukas Nickel’s Master’s thesis, where the geometric/Hillas reconstruction performs better at higher multiplicities. It also looks like EventDisplay does not apply any explicit To reproduce the EventDisplay behavior more exactly for benchmarking studies, I would otherwise like to implement these three points:
I am just not sure how quickly I will manage that over the next days or weeks, since I am currently finishing my thesis.
That looks like a good alternative. I am just not sure yet whether, and by how much, it would actually be faster in practice. I would need to test that first. Thanks for the comments! |








This is basically the StereoCombiner already implemented here
in
magic-cta-pipe.It combines the mono DISP reconstruction by
Update:
The
StereoDispCombinerhas essentially been generalized so that it can be configured to reproduce both themagic-cta-pipeand theEventDisplaybehavior.For each telescope combination of size
n_tel_combinations, all possible DISP sign assignments are then evaluated, and the sign combination that minimizes the Sum of Squared Errors (SSE) between the participating telescopes is selected. The resulting per-combination FoV positions are then combined using the selected telescope weights, and a weighted mean FoV direction is computed for each subarray event.If a subarray event has an valid telescope multiplicity smaller than
n_tel_combinations(after applyingn_best_telsand any angular-difference cuts), but at least two telescopes remain, the reconstruction is performed using all available telescopes of that subarray event. In this case, only one combination is formed, with a size equal to the event multiplicity, and the optimal DISP sign assignment is determined accordingly. Single-telescope events are handled separately using just the mono reconstruction.Some hints for reviewing are here