counts.geom.axes[0].center, name="energy", unit="GeV", interp="log" ) geom = WcsGeom(wcs=counts.geom.wcs, npix=counts.geom.npix, axes=[axis]) coord = counts.geom.get_coord() data = exposure_hpx.interp_by_coord(coord) exposure = WcsNDMap(geom, data, unit=exposure_hpx.unit) print(exposure.geom) print(exposure.geom.axes[0]) # In[ ]: # Exposure is almost constant accross the field of view exposure.slice_by_idx({"energy": 0}).plot(add_cbar=True); # In[ ]: # Exposure varies very little with energy at these high energies energy = [10, 100, 1000] * u.GeV exposure.get_by_coord({"skycoord": gc_pos, "energy": energy}) # ## Galactic diffuse background # The Fermi-LAT collaboration provides a galactic diffuse emission model, that can be used as a background model for # Fermi-LAT source analysis. #
geom = WcsGeom(wcs=counts.geom.wcs, npix=counts.geom.npix, axes=[axis]) coord = counts.geom.get_coord() data = exposure_hpx.interp_by_coord(coord) # In[ ]: exposure = WcsNDMap(geom, data, unit=exposure_hpx.unit, dtype=float) print(exposure.geom) print(exposure.geom.axes[0]) # In[ ]: # Exposure is almost constant accross the field of view exposure.slice_by_idx({ "energy": 0 }).plot(add_cbar=True) # In[ ]: # Exposure varies very little with energy at these high energies energy = [10, 100, 1000] * u.GeV exposure.get_by_coord({"skycoord": gc_pos, "energy": energy}) # ## Galactic diffuse background # The Fermi-LAT collaboration provides a galactic diffuse emission model, that can be used as a background model for # Fermi-LAT source analysis. # # Diffuse model maps are very large (100s of MB), so as an example here, we just load one that represents a small cutout for the Galactic center region.