Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.