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

Feature Request: Use astropy.visualization #63

Open
pllim opened this issue Feb 20, 2019 · 3 comments
Open

Feature Request: Use astropy.visualization #63

pllim opened this issue Feb 20, 2019 · 3 comments
Labels
API Issues that relate to the API itself rather than implementations Feature Request

Comments

@pllim
Copy link
Member

pllim commented Feb 20, 2019

During a hack day project, in which @eteq and Matteo Correnti were a part of, I was given a non-interactive version of a photometry notebook. My task was to use astrowidgets to make some parts interactive. The non-interactive version leveraged astropy.visualization rather nicely. But I had a hard time trying to do exactly the same steps using astrowidgets with Ginga as a backend because ejeschke/ginga#560 is still unresolved. I have a feeling that other backends we would support in the future (e.g., bqplot or Aladdin Lite) might not use astropy.visualization as well. So, I guess that hook into astropy.visualization might have to happen here in the astrowidgets layer.

Relevant snippets:

import matplotlib.pyplot as plt
from astropy.visualization import (ZScaleInterval, SqrtStretch, ImageNormalize)
from astropy.visualization import simple_norm

norm = simple_norm(data, 'sqrt', percent=99.)

plt.figure(figsize=(14, 14))
plt.imshow(data, norm=norm, cmap='Greys')
norm = simple_norm(data, 'log', percent=99.)

plt.figure(figsize=(14, 14))
plt.imshow(data, norm=norm, origin='lower', cmap='viridis')
plt.colorbar()

xref spacetelescope/dat_pyinthesky#7

@kakirastern
Copy link
Contributor

How about when Matplotlib is the backend, would that yield a solution to this request?

@pllim
Copy link
Member Author

pllim commented Mar 13, 2019

Just speaking for myself, I would like this to work in a backend agnostic way, but maybe that is not even possible. Definitely need more looking into. For instance, astropy.visualization.stretch does not rely on Matplotlib, but astropy.visualization.mpl_normalize does.

@kakirastern
Copy link
Contributor

I see... No wonder why you have not mentioned that option in your original post.

@pllim pllim added Feature Request API Issues that relate to the API itself rather than implementations labels Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Issues that relate to the API itself rather than implementations Feature Request
Projects
None yet
Development

No branches or pull requests

2 participants