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

optimization of multiplicity, theta and gh cut #204

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

maxnoe
Copy link
Member

@maxnoe maxnoe commented Nov 20, 2022

No description provided.

@maxnoe maxnoe changed the title Faster optimize cuts optimization of multiplicity, theta and gh cut Nov 20, 2022
@codecov
Copy link

codecov bot commented Nov 20, 2022

Codecov Report

Patch coverage: 94.61% and project coverage change: +1.44 🎉

Comparison is base (642940a) 94.33% compared to head (9bef4fe) 95.78%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #204      +/-   ##
==========================================
+ Coverage   94.33%   95.78%   +1.44%     
==========================================
  Files          58       59       +1     
  Lines        2738     2845     +107     
==========================================
+ Hits         2583     2725     +142     
+ Misses        155      120      -35     
Impacted Files Coverage Δ
pyirf/spectral.py 76.66% <0.00%> (-0.65%) ⬇️
pyirf/cuts.py 95.16% <89.47%> (-0.68%) ⬇️
pyirf/cut_optimization.py 96.36% <96.34%> (+96.36%) ⬆️
.../interpolation/tests/test_griddata_interpolator.py 100.00% <100.00%> (ø)
pyirf/tests/test_optimize_cuts.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Bins in reconstructed energy to use for sensitivity computation
gh_cut_efficiencies: np.ndarray[float, ndim=1]
The cut efficiencies to scan for best sensitivity.
theta_cuts: astropy.table.QTable
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doc is wrong: it's not the cuts being passed here, but the array of values over which the brute-force optimization scan is done, right? Also, for symmetry, shouldn't there be a similar input for multiplicity?

)

with tqdm(total=n_cuts, disable=not progress) as bar:
for multiplicity_index, multiplicity_cut in enumerate(multiplicity_cuts):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be useful to eventually adapt this to use scipy.optimize.brute internally rather than implement the grid-search manually, as that would make it easier to replace it with more efficient optimizers later

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the manual grid search, we can be a bit cleverer than brute force: make the cuts in the outermost loop possible rather than computing all cuts for all computations.

----------
values: ``~numpy.ndarray`` or ``~astropy.units.Quantity``
The values on which the cut should be evaluated
cut_table: ``~astropy.table.Table``
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing doc for bin_index

@maxnoe maxnoe marked this pull request as draft September 15, 2023 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants