sunkit-image icon indicating copy to clipboard operation
sunkit-image copied to clipboard

Usage of non-AIA images in radial.rhef is broken

Open GillySpace27 opened this issue 1 year ago • 1 comments

Describe the bug

When using different data sources, radial.rhef doesn't always know how to find the center of the image and do the units correctly. I've opened a draft PR #231 that I think might fix the problem but I'm open to some testing and iteration by others. In general I need to generalize the algorithm to be as agnostic to data source as possible. Thanks for your help!

To Reproduce

from sunpy.map import Map
from sunkit_image.radial import rhef
import matplotlib.pyplot as plt
import os

for file in os.listdir("example_data/"):
    if "fits" in file:
        target = os.path.join("example_data", file)
        pmap = Map(target)[0]
        pmap_filt = rhef(pmap)
        plt.figure()
        pmap_filt.plot()
        plt.savefig(target.replace(".fits", ".png"))

Screenshots

Output is nonsense: image

System Details

>>> import sunpy; sunpy.util.system_info()
==============================
sunpy Installation Information
==============================

General
#######
OS: Mac OS 14.5
Arch: 64bit, (arm)
sunpy: 6.0.2
Installation path: /Users/cgilbert/vscode/punch-5-meeting/.venv/lib/python3.12/site-packages/sunpy-6.0.2.dist-info

Required Dependencies
#####################
astropy: 6.1.3
numpy: 1.26.4
packaging: 24.1
parfive: 2.1.0
pyerfa: 2.0.1.4
requests: 2.32.3

Optional Dependencies
#####################
sunpy: 6.0.2

Installation method

git checkout

GillySpace27 avatar Sep 23 '24 17:09 GillySpace27

What was the data you used in that example? We need to consider adding more test data from not-AIA.

nabobalis avatar Sep 23 '24 18:09 nabobalis

Describe the bug

When using different data sources, radial.rhef doesn't always know how to find the center of the image and do the units correctly. I've opened a draft PR #231 that I think might fix the problem but I'm open to some testing and iteration by others. In general I need to generalize the algorithm to be as agnostic to data source as possible. Thanks for your help!

To Reproduce

from sunpy.map import Map
from sunkit_image.radial import rhef
import matplotlib.pyplot as plt
import os

for file in os.listdir("example_data/"):
    if "fits" in file:
        target = os.path.join("example_data", file)
        pmap = Map(target)[0]
        pmap_filt = rhef(pmap)
        plt.figure()
        pmap_filt.plot()
        plt.savefig(target.replace(".fits", ".png"))

Screenshots

Output is nonsense: image

System Details

>>> import sunpy; sunpy.util.system_info()
==============================
sunpy Installation Information
==============================

General
#######
OS: Mac OS 14.5
Arch: 64bit, (arm)
sunpy: 6.0.2
Installation path: /Users/cgilbert/vscode/punch-5-meeting/.venv/lib/python3.12/site-packages/sunpy-6.0.2.dist-info

Required Dependencies
#####################
astropy: 6.1.3
numpy: 1.26.4
packaging: 24.1
parfive: 2.1.0
pyerfa: 2.0.1.4
requests: 2.32.3

Optional Dependencies
#####################
sunpy: 6.0.2

Installation method

git checkout

Seems like i can not reproduce the issue ....

can anyone help me with this?

this is what i get when i try to reproduce!!

Screenshot 2024-11-11 173015

Abinash-bit avatar Nov 11 '24 12:11 Abinash-bit

This issue was fixed by https://github.com/sunpy/sunkit-image/pull/231 and I forgot to close this PR.

In your case, the code example, uses data on the original authors laptop.

nabobalis avatar Nov 11 '24 16:11 nabobalis