def plot_containment_radii(fraction): """Plotting script for 68% and 95% containment radii.""" psf_gc = FermiGalacticCenter.psf() gtpsf_table_gc = get_psf_table(psf_gc, 10000, 300000, 15) psf_vela = FermiVelaRegion.psf() gtpsf_table_vela = get_psf_table(psf_vela, 10000, 300000, 15) if fraction == 68: true_table_rep = load_lat_psf_performance('P7REP_SOURCE_V15_68') true_table = load_lat_psf_performance('P7SOURCEV6_68') rad = 'CONT_68' elif fraction == 95: true_table_rep = load_lat_psf_performance('P7REP_SOURCE_V15_95') true_table = load_lat_psf_performance('P7SOURCEV6_95') rad = 'CONT_95' plt.plot(gtpsf_table_gc['ENERGY'], gtpsf_table_gc[rad], color='red',label='Fermi Tools PSF @ Galactic Center') plt.plot(gtpsf_table_vela['ENERGY'], gtpsf_table_vela[rad], color='blue', label='Fermi Tools PSF @ Vela Region') plt.plot(true_table_rep['energy'], true_table_rep['containment_angle'], color='green', linestyle='--', label='P7REP_SOURCE_V15') plt.plot(true_table['energy'], true_table['containment_angle'], color='black', linestyle='--', label='P7SOURCEV6') plt.xlim([10000, 300000]) plt.legend() plt.semilogx() plt.xlabel('Energy/MeV') plt.ylabel('PSF Containment Radius/deg') return plt
"""Produces an image from 1FHL catalog point sources. """ from gammapy.datasets import FermiGalacticCenter from gammapy.image import make_empty_image, catalog_image # Create image of defined size reference = make_empty_image(nxpix=3600, nypix=1800, binsz=0.1) psf_file = FermiGalacticCenter.psf() # Create image image = catalog_image(reference, psf, catalog='1FHL', source_type='point', total_flux='True') hdu = image.to_fits()[0] hdu.writeto('Image_1FHL.fits', clobber=True)
"""Produces an image from 1FHL catalog point sources. """ from gammapy.datasets import FermiGalacticCenter from gammapy.image import make_empty_image, catalog_image # Create image of defined size reference = make_empty_image(nxpix=3600, nypix=1800, binsz=0.1) psf_file = FermiGalacticCenter.psf() # Create image image = catalog_image(reference, psf, catalog='1FHL', source_type='point', total_flux='True') hdu = image.to_fits()[0] hdu.writeto('Image_1FHL.fits', clobber=True)