Skip to content

Instantly share code, notes, and snippets.

@cdeil
Created August 27, 2018 06:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cdeil/3b74bbd2082dfa549acc4fb2f4af4d9f to your computer and use it in GitHub Desktop.
Save cdeil/3b74bbd2082dfa549acc4fb2f4af4d9f to your computer and use it in GitHub Desktop.
08/27/2018 08:49:20 AM INFO: Cell returned
08/27/2018 08:49:20 AM INFO: Running cell:
jfactory = JFactory(geom=geom, profile=profile, distance=profiles.DMProfile.DISTANCE_GC)
jfact = jfactory.compute_jfactor()
08/27/2018 08:49:24 AM INFO: Cell returned
08/27/2018 08:49:24 AM INFO: Running cell:
jfact_map = WcsNDMap(geom=geom, data=jfact.value, unit=jfact.unit)
fig, ax, im = jfact_map.plot(cmap='viridis', norm=LogNorm(), add_cbar=True)
plt.title('J-Factor [{}]'.format(jfact_map.unit))
# 1 deg circle usually used in H.E.S.S. analyses
sky_reg = CircleSkyRegion(center=position, radius=1 * u.deg)
pix_reg = sky_reg.to_pixel(wcs=geom.wcs)
pix_reg.plot(ax=ax, facecolor='none', edgecolor='red', label='1 deg circle')
plt.legend()
08/27/2018 08:49:25 AM INFO: Cell raised uncaught exception:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-7-820128ce67c9> in <module>()
1 jfact_map = WcsNDMap(geom=geom, data=jfact.value, unit=jfact.unit)
----> 2 fig, ax, im = jfact_map.plot(cmap='viridis', norm=LogNorm(), add_cbar=True)
3 plt.title('J-Factor [{}]'.format(jfact_map.unit))
4
5 # 1 deg circle usually used in H.E.S.S. analyses
~/work/code/gammapy/gammapy/maps/wcsnd.py in plot(self, ax, fig, add_cbar, stretch, **kwargs)
449
450 if cbar:
--> 451 cbar.formatter.set_powerlimits((0, 0))
452 cbar.update_ticks()
453
AttributeError: 'LogFormatterSciNotation' object has no attribute 'set_powerlimits'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment