# Grid on an image - difference with the old sunpy version and the 5.0.0

**URL:** <https://community.openastronomy.org/t/grid-on-an-image-difference-with-the-old-sunpy-version-and-the-5-0-0/766>\
**Category:** SunPy\
**Tags:** sunpy, fits, question\
**Created:** [September 28, 2023, 4:49pm UTC](https://community.openastronomy.org/t/grid-on-an-image-difference-with-the-old-sunpy-version-and-the-5-0-0/766 "2023-09-28T16:49:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sabrina](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@sabrina](https://community.openastronomy.org/u/sabrina)\
**Post date:** [September 28, 2023, 4:49pm UTC](https://community.openastronomy.org/t/grid-on-an-image-difference-with-the-old-sunpy-version-and-the-5-0-0/766/1 "2023-09-28T16:49:31Z")

</div>

Hello,

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:

 ![sunpy_5_0_0](https://europe1.discourse-cdn.com/flex005/uploads/openastronomy/original/1X/bcd1e50fe2524ab3c2abadaf2fca9e249adb6159.jpeg)

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](https://www.sidc.be/uset/data/cameras/output_img/FTS/L1c/USET_CalciumII-K/2023/09/UCC20230923092010.FTS)

And the code is:

```auto
hdul = fits.open(filename)
header = hdul[0].header
uset_map = sunpy.map.Map((hdul[0].data, header))
fig = plt.figure()
ax = plt.subplot(projection=uset_map)
uset_map.plot()
uset_map.draw_grid()
plt.show()

```

Any idea what could cause this difference ?

Many thanks,  
Sabrina

---

<div class="post-metadata">

**Author:** ![ayshih](https://dub1.discourse-cdn.com/flex005/user_avatar/community.openastronomy.org/ayshih/32/84_2.png) [@ayshih](https://community.openastronomy.org/u/ayshih)\
**Post date:** [September 28, 2023, 8:24pm UTC](https://community.openastronomy.org/t/grid-on-an-image-difference-with-the-old-sunpy-version-and-the-5-0-0/766/2 "2023-09-28T20:24:56Z")

</div>

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 `RSUN_OBS` or `SOLAR_R` or `RADIUS`, in decreasing order of priority).

The issue here is that your FITS file has the following:

```auto
SOLAR_R = 984.6052312720685 / [pixel] estimated radius of the sun

```

However, `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.:

```python
uset_map.meta['solar_r'] *= uset_map.meta['cdelt1']

```

---

<div class="post-metadata">

**Author:** ![sabrina](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@sabrina](https://community.openastronomy.org/u/sabrina)\
**Post date:** [September 29, 2023, 2:40pm UTC](https://community.openastronomy.org/t/grid-on-an-image-difference-with-the-old-sunpy-version-and-the-5-0-0/766/3 "2023-09-29T14:40:32Z")

</div>

Thank you for your answer ! Following your suggestion, I have posted this on GitHub.

cheers,  
Sabrina
