VERITAS-Observatory / gammapy-tools

Repository with tools for gammapy analysis
GNU General Public License v3.0
2 stars 0 forks source link

Get flux and spectra from ExcessMapEstimator #42

Open samanthalwong opened 1 month ago

samanthalwong commented 1 month ago

Flux/spectral values should come from the RBM ExcessMapEstimator rather than a separate 1D analysis. This allows for the analysis of more extended & off-axis sources.

A possible implementation is to use the FluxMap object that's returned when running ExcessMapEstimator - lima_map in our examples and extracting flux as an integral flux and eflux (which can be returned multiple given energies) to construct an SED. Both of these quantities can be evaluated at the source position using get_by_coord.

e.g., sigma = lima_maps['sqrt_ts'].get_by_coord([source_pos.ra, source_pos.dec, 1 * u.TeV])[0] is how we extract significance (which is energy-independent, so the 1 TeV is arbitrary)

steob92 commented 1 month ago

@samanthalwong I have a slight concern about using ExcessMapEstimator. We typically perform analysis on all events and then report a flux above some energy threshold. Using RBM we're compressing the energy range to a single bin, does this not mean that we either have to report a flux from the entire analysis range or perform the detection analysis above an energy threshold?

samanthalwong commented 1 month ago

I think as long as the integral flux energy threshold is the same or higher than what the ExcessMapEstimator is run with, then you can extract it above the energy specified in the get_by_coord string. Some quantities (e.g., significance, etc.) are compressed but from what I've played around with, things like differential flux are not.

I haven't looked into this too much, but wanted to start moving toward extended source spectra for the next round of validation.