MapEvaluator¶
-
class
gammapy.cube.MapEvaluator(model=None, exposure=None, psf=None, edisp=None, evaluation_mode='local')[source]¶ Bases:
objectSky model evaluation on maps.
This evaluates a sky model on a 3D map and convolves with the IRFs, and returns a map of the predicted counts. Note that background counts are not added.
For now, we only make it work for 3D WCS maps with an energy axis. No HPX, no other axes, those can be added later here or via new separate model evaluator classes.
Parameters: - model :
SkyModel Sky model
- exposure :
Map Exposure map
- psf :
PSFKernel PSF kernel
- edisp :
EnergyDispersion Energy dispersion
- evaluation_mode : {“local”, “global”}
Model evaluation mode.
Attributes Summary
bin_volumeMap pixel bin volume (solid angle times energy bin width). coordsReturn evaluator coords energy_bin_widthEnergy axis bin widths ( astropy.units.Quantity)energy_centerTrue energy axis bin centers ( Quantity)energy_edgesTrue energy axis bin edges ( Quantity)geomTrue energy map geometry ( MapGeom)geom_imageImage map geometry ( MapGeom)geom_recoReco energy map geometry ( MapGeom)latlonlon_latSpatial coordinate pixel centers ( lon, lattuple ofQuantity).needs_updateCheck whether the model component has drifted away from its support. solid_angleSolid angle per pixel Methods Summary
apply_edisp(npred)Convolve map data with energy dispersion. apply_exposure(flux)Compute npred cube apply_psf(npred)Convolve npred cube with PSF compute_dnde()Compute model differential flux at map pixel centers. compute_flux()Compute model integral flux over map pixel volumes. compute_npred()Evaluate model predicted counts. update(exposure, psf, edisp, geom)Update MapEvaluator, based on the current position of the model component. Attributes Documentation
-
bin_volume¶ Map pixel bin volume (solid angle times energy bin width).
-
coords¶ Return evaluator coords
-
energy_bin_width¶ Energy axis bin widths (
astropy.units.Quantity)
-
lat¶
-
lon¶
-
needs_update¶ Check whether the model component has drifted away from its support.
-
solid_angle¶ Solid angle per pixel
Methods Documentation
-
apply_edisp(npred)[source]¶ Convolve map data with energy dispersion.
Parameters: - npred :
Map Predicted counts in true energy bins
Returns: - npred_reco :
Map Predicted counts in reco energy bins
- npred :
-
compute_dnde()[source]¶ Compute model differential flux at map pixel centers.
Returns: - model_map :
Map Sky cube with data filled with evaluated model values. Units:
cm-2 s-1 TeV-1 deg-2
- model_map :
-
compute_flux()[source]¶ Compute model integral flux over map pixel volumes.
For now, we simply multiply dnde with bin volume.
-
compute_npred()[source]¶ Evaluate model predicted counts.
Returns: - npred :
Map Predicted counts on the map (in reco energy bins)
- npred :
-
update(exposure, psf, edisp, geom)[source]¶ Update MapEvaluator, based on the current position of the model component.
Parameters: - exposure :
Map Exposure map.
- psf :
gammapy.cube.PSFMap PSF map.
- edisp :
gammapy.cube.EDispMap Edisp map.
- geom :
gammapy.maps.MapGeom Reference geometry of the data.
- exposure :
- model :