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

Irf maker and cut optimiser #2473

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

Irf maker and cut optimiser #2473

wants to merge 155 commits into from

Conversation

Tobychev
Copy link
Contributor

As we are planning to produce IRFs on events that were not used to select the GH cut, it makes sense to split the procedure generating IRFs into two tools. Because this splitting results in a large restructuring of the the previous PR on generating IRFs (#2315) that was basically working properly, I open a new PR to preserve the discussion on the old attempt and let its more or less functional code serve as easy reference.

@Tobychev Tobychev marked this pull request as draft November 24, 2023 09:45
ctapipe/irf/binning.py Outdated Show resolved Hide resolved
ctapipe/irf/irf_classes.py Outdated Show resolved Hide resolved
ctapipe/irf/irf_classes.py Outdated Show resolved Hide resolved
ctapipe/irf/irf_classes.py Outdated Show resolved Hide resolved
ctapipe/irf/irf_classes.py Outdated Show resolved Hide resolved
ctapipe/irf/binning.py Outdated Show resolved Hide resolved
ctapipe/irf/optimise.py Outdated Show resolved Hide resolved
def __init__(self, gh_cuts=None, offset_lim=None):
self.gh_cuts = gh_cuts
if gh_cuts:
self.gh_cuts.meta["extname"] = "GH_CUTS"
Copy link
Member

Choose a reason for hiding this comment

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

extname is the name of a FITS extension. You should't set this in the metadata of the table, but only when writing out, it's the name argument of write.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I got

TypeError: write_table_fits() got an unexpected keyword argument 'name'

when I tried self.gh_cuts.write(out_name, name="GH_CUTS", format="fits", overwrite=overwrite) and I don't find anything about a name argument to table.write, do you mean I should manage the fits file more directly and just cast the tables to hdus?

ctapipe/irf/optimise.py Outdated Show resolved Hide resolved
ctapipe/irf/select.py Outdated Show resolved Hide resolved
ctapipe/irf/select.py Outdated Show resolved Hide resolved
ctapipe/irf/select.py Outdated Show resolved Hide resolved

quality_criteria = List(
default_value=[
("multiplicity 4", "np.count_nonzero(tels_with_trigger,axis=1) >= 4"),
Copy link
Member

Choose a reason for hiding this comment

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

Do we really want a multiplicity cut of 4 by default? I would remove that and only require the valid reconstruction.

ctapipe/tools/make_irf.py Outdated Show resolved Hide resolved
ctapipe/tools/make_irf.py Outdated Show resolved Hide resolved
ctapipe/tools/make_irf.py Outdated Show resolved Hide resolved
ctapipe/tools/make_irf.py Outdated Show resolved Hide resolved
ctapipe/tools/make_irf.py Outdated Show resolved Hide resolved
ctapipe/tools/make_irf.py Outdated Show resolved Hide resolved
ctapipe/tools/make_irf.py Outdated Show resolved Hide resolved
ctapipe/tools/make_irf.py Outdated Show resolved Hide resolved
ctapipe/tools/make_irf.py Outdated Show resolved Hide resolved
ctapipe/irf/irfs.py Outdated Show resolved Hide resolved
ctapipe/tools/make_irf.py Outdated Show resolved Hide resolved
ctapipe/irf/binning.py Outdated Show resolved Hide resolved
src/ctapipe/irf/optimize.py Outdated Show resolved Hide resolved
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.

4 participants