I have just found an nice undocumented(?) feature of WCSAxes running an a jupyter notebook - you can switch the cursor readout between pixel and world coordinate systems by pressing “w”. Very nice! Is there a way to control the format of the values displayed? Currently the RA/Dec are not displayed to sufficient precision for my purposes and the pixel coordinates are displayed with >12 decimal places.
Here is what I am doing so far …
%matplotlib notebook
from astropy.wcs import WCS
from astropy.io import fits
import matplotlib.pyplot as plt
im,hdr = fits.getdata('IMG_0004_2.fits',header=True)
wcs = WCS(hdr)
ax = plt.subplot(projection=wcs)
ax.imshow(im,origin='lower',cmap='Greens')
ax.grid(color='gray', ls='solid')
plt.title('Press w to switch between pixel and sky coords');