Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PIG 25 - Unbinned analysis #4253

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

tunbehaun273
Copy link

Description

This pull request will add a pig for the unbinned analysis

Dear reviewer

tunbehaun273 and others added 4 commits December 9, 2022 10:54
Signed-off-by: Tim Unbehaun <tim.unbehaun@fau.de>
Signed-off-by: Tim Unbehaun <tim.unbehaun@fau.de>
@codecov
Copy link

codecov bot commented Dec 10, 2022

Codecov Report

Merging #4253 (4a9bd73) into main (cf3166f) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

❗ Current head 4a9bd73 differs from pull request most recent head 878605a. Consider uploading reports for the commit 878605a to get more accurate results

@@            Coverage Diff             @@
##             main    #4253      +/-   ##
==========================================
- Coverage   94.93%   94.92%   -0.01%     
==========================================
  Files         218      218              
  Lines       30888    30880       -8     
==========================================
- Hits        29322    29314       -8     
  Misses       1566     1566              
Impacted Files Coverage Δ
gammapy/modeling/models/temporal.py 96.58% <100.00%> (ø)
gammapy/modeling/models/tests/test_temporal.py 99.67% <100.00%> (-0.02%) ⬇️

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

The lengths of ==== and *** had no noticable influence
@registerrier registerrier added this to the 1.1 milestone Dec 13, 2022
@adonath adonath changed the title Add the pig for the unbinned analysis PIG 25 - Unbinned analysis Apr 14, 2023
@adonath
Copy link
Member

adonath commented Apr 14, 2023

A few notes from the discussion today:

  • Prototype is available here https://github.com/gammapy/gammapy-unbinned-analysis/tree/main/EventDataset
  • In the current implementation the EventDataset is very similar to the MapDataset, to avoid code duplication the PIG should sketch how the EventMapDataset could e.g. inherit from MapDataset:
    • Which methods would be supported? E.g. EventMapDataset.to_image(), EventMapDataset.cutout() etc.
    • Which methods would be different and how? E.g. EventMapDataset.npred(), also document return types, such as whether the method returns a np.ndarray, Quantity or maybe MapCoord
    • Which methods would just raise an error?
    • Is stacking supported?
    • For simplicity and precision we should just support the EDispMap and PSFMap and not the "kernel" version of those.
  • The EventMapDataset could compute a counts maps "on the fly", this is convenient for visualization.
  • Clarify whether we need a dedicated EventMapDatasetMaker (probably not!)
  • The most complex code in the prototype is here and here. We should have an idea on how to simplify it and make it more re-usable. Here are some ideas:
  • The prototype introduce the concept of and "acceptance" map, which is different from what we have e.g. in MapDatasetOnOff.acceptance this should be resolved.
  • I think the alternative describe an EventDataset with IRFs stored per event, but list the reasons why this is impractical (@tunbehaun273 has a lot of experience, which should be documented somewhere)
  • @registerrier also raised the point pf whether the EventMapDataset is the more fundamental abstraction (to be clarified)
  • @tunbehaun273 and @giacomodamico24 agreed to continue writing the PIG and the we will continue discussion in this PR.

@registerrier registerrier modified the milestones: 1.1, 1.2 Apr 24, 2023
tunbehaun273 and others added 5 commits May 5, 2023 17:27
Co-authored-by: Bruno Khélifi <khelifi@in2p3.fr>
Co-authored-by: Bruno Khélifi <khelifi@in2p3.fr>
Co-authored-by: Bruno Khélifi <khelifi@in2p3.fr>
Co-authored-by: Bruno Khélifi <khelifi@in2p3.fr>
Co-authored-by: Bruno Khélifi <khelifi@in2p3.fr>
@adonath
Copy link
Member

adonath commented Sep 18, 2023

Thanks @tunbehaun273 and @giacomodamico24 for the update! I think the only way to reduce the code duplication would be to move functionality down in the hierarchy to an un-binned data structure, basically an UnbinnedMap or, very similar, a SparseMap, but my current impression is that this is out of reach for this project as we are limited by the time you can provide for implementation. However I wanted to mention it for completeness.

@registerrier registerrier modified the milestones: 1.2, 1.3 Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants