cta-observatory / pyirf

Python IRF builder
https://pyirf.readthedocs.io/en/stable/
MIT License
15 stars 25 forks source link

Plotting module #31

Closed HealthyPear closed 1 year ago

HealthyPear commented 4 years ago

After discussing with @vuillaut, this is a proposal for a simple plotting module (aka pyirf.plot or pyirf.vizualization).

Context:

This module would provide a simple and fast visualization suite to look into pyirf products (even in-between, for testing and benchmarking) without medium/high knowledge of any science tools.

There is some overlap between this and ctaplot. The latter could focus on sub-DL3 products, but it can still be useful to see e.g. the effective area before cut optimization (even though this can also be done by pyirf since it applies the cuts on DL2 data after reading it).

What we have:

One notebook should be sufficient, each plot saved separately or together, with a set of metadata. Plotting could be done entirely by calling the specific gammapy API (a few methods).

What is missing:

bregeon commented 4 years ago

Sounds like a very good plan, I am only wondering about the gammapy dependency.

For information, although that might be more useful for ctaplot?, we have currently two pieces of code related to plotting IRFs:

HealthyPear commented 4 years ago

Sounds like a very good plan, I am only wondering about the gammapy dependency.

Yes, this is more or less the same discussion as for ctapipe. Personally, I am not a fan of re-inventing the wheel and from one side I would prefer if pyirf performed its internal operations (core utilities - configuration - plotting) in a simple independent way from ctapipe and science tools... Though in the case of plotting the situation is probably more elastic, because

At the same time, I would like something simple and fast for benchmarking, testing or even for a pipeline user that maybe doesn't care to use a full science-tool just for producing 5 plots.

kosack commented 4 years ago

In this module, you might want to delegate as much plotting as you can to gammapy, just to minimize code. GammaPy already has some nice plots for things like IRFs.

maxnoe commented 4 years ago

Plot wishlist

General

HealthyPear commented 4 years ago

Some diagnostic plotting code was present inside pyirf.cut_optimization.CutsDiagnostic (e.g. commit 0bf3f40)

Such plots are a single efficiency plot and one plot per energy bin like the following,

diagnostic_1.34_1.86TeV.pdf efficiencies.pdf

bregeon commented 4 years ago

Just for reference, here is what Gernot's canvas look like: ref_plot

sensitivity, sensitivity ratio, angular resolution, effective area, background rate, energy resolution

again, not sure if pyIRF shall do that, or if it shall be delegated to e.g. ctaplot, but it's a must have, and when we have it we can think about how to do better!

HealthyPear commented 1 year ago

Do we still want to do this, given ctaplot exists and anyway other pipeline-related projects like magic-cta-pipe do the plotting themselves?

Right now, I would go for ctaplot and not add maintain plotting code here.

maxnoe commented 1 year ago

agreed

kosack commented 1 year ago

In fact this has already been implemented in the benchmarking suite.