Plotting an heliographic grid on ground-based images, I have a different behaviour with the new version of SunPy and the old one I was using (2.0.3). It seems related to the value of CDELT in the meta-data.
The resulting grid fits well the sun disk with sunpy 2.0.3:
with it’s too big with sunpy 5.0.0:
It gets the right size when I force CDELT1=CDELT2=1
The fits file is here: https://www.sidc.be/uset/data/cameras/output_img/FTS/L1c/USET_CalciumII-K/2023/09/UCC20230923092010.FTS
And the code is:
hdul = fits.open(filename)
header = hdul.header
uset_map = sunpy.map.Map((hdul.data, header))
fig = plt.figure()
ax = plt.subplot(projection=uset_map)
Any idea what could cause this difference ?
Not everyone defines the radius of the Sun the same way, so we look in the FITS header for the value that should be used. When a header does not explicitly define the physical radius of the Sun (via the keyword
RSUN_REF), we infer it from the angular radius of the Sun (via the keyword
RADIUS, in decreasing order of priority).
The issue here is that your FITS file has the following:
SOLAR_R = 984.6052312720685 / [pixel] estimated radius of the sun
sunpy is hardcoded to assume that
SOLAR_R is provided in arcseconds, not pixels.
I recommend you open a GitHub issue so we can discuss whether
SOLAR_R being provided in pixels is something that should be supported. In the meantime, you can work around this issue by converting
SOLAR_R in your header to arcseconds, e.g.:
uset_map.meta['solar_r'] *= uset_map.meta['cdelt1']
Thank you for your answer ! Following your suggestion, I have posted this on GitHub.