Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default plotting of the Radial Gradient Filters and Enhancement Algorithms is over-normalized #216

Open
GillySpace27 opened this issue Jun 28, 2024 · 3 comments

Comments

@GillySpace27
Copy link
Contributor

Describe the bug

When running the enhancement algorithms, the plot that map.plot() produces and the plot that plt.imshow(map.data) shows are very different, and the imshow one is the correct one. This can be fixed with map.plot(norm=None) or with map.plot_settings["norm"] = None, which is how the radial module modifies the output map to deal with the issue. I think it makes sense for the user to not have to manually supply a norm=None to the plot command.

At least the enhance.mgn and enhance.wow algorithms need to be updated to normalize properly. I'm just not sure how to handle that issue since they are able to take either a map or an array. I guess that it would just need an if type(input) is <> check of some kind.

I suspect that there are other places where this normalization issue is present, too. Note that this bug happens in the ReadTheDocs example gallery, which is where I noticed it. This functionality is already present in some of the functions in the radial module following #205 .

To Reproduce

See https://docs.sunpy.org/projects/sunkit-image/en/stable/generated/gallery/radial_gradient_filters.html

Screenshots

https://docs.sunpy.org/projects/sunkit-image/en/stable/generated/gallery/radial_gradient_filters.html
This is supposed to be an improvement on the raw data, but it is completely uncalibrated.

image

System Details

Required Dependencies
#####################
astropy: 5.3.4
numpy: 1.24.4
packaging: 21.3
parfive: 2.0.2

Optional Dependencies
#####################
asdf: 2.15.2
asdf-astropy: 0.4.0
beautifulsoup4: 4.11.1
cdflib: 1.2.1
dask: 2022.7.0
drms: 0.6.4
glymur: 0.12.8
h5netcdf: Missing h5netcdf>=0.11; extra == "timeseries"
h5py: 3.7.0
lxml: 4.9.1
matplotlib: 3.5.2
mpl-animators: 1.1.0
pandas: 1.4.4
python-dateutil: 2.8.2
reproject: 0.12.0
scikit-image: 0.19.2
scipy: 1.9.1
sqlalchemy: 1.4.39
tqdm: 4.64.1
zeep: 4.2.1

Installation method

pip

@nabobalis
Copy link
Contributor

It might be time to drop support for arrays.

@GillySpace27
Copy link
Contributor Author

GillySpace27 commented Jul 5, 2024

It might be time to drop support for arrays.

Looks like that functionality was only added in the most recent update to these functions. Maybe it would be better to add support for maps/ better support for arrays instead? What do you think?

@nabobalis
Copy link
Contributor

Ideally I want all the functions in sunkit-image to only take in maps or ndcubes. It won't be a fast transition.

We originally created everything with array support but that was a mistake at the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants