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

Add colormap and PSF inset plotting functions #245

Merged
merged 3 commits into from Mar 20, 2015

Conversation

Projects
None yet
3 participants
@adonath
Member

adonath commented Mar 17, 2015

This implements preliminary functions to add a PSF inset and transform world to figure coordinates for FITSFigures. The doc build seems to be broken at the moment.

@cdeil

This comment has been minimized.

Member

cdeil commented Mar 18, 2015

An example that uses this in the docs would be great, to have a URL we can point people to that want to use this.

@coveralls

This comment has been minimized.

coveralls commented Mar 19, 2015

Coverage Status

Coverage decreased (-0.31%) to 46.05% when pulling f2fe1f9 on adonath:aplpy_psf_inset into c96cbcd on gammapy:master.

@@ -7,34 +7,37 @@
__all__ = ['colormap_hess', 'colormap_milagro',
'fits_to_png',
'GalacticPlaneSurveyPanelPlot',
]
'fitsfigure_add_psf_inset',
'world2fig',

This comment has been minimized.

@cdeil

cdeil Mar 20, 2015

Member

I don't think world2fig needs to be part of the public gammapy API in gammapy.image, no?
If you want to expose it, please choose a longer, more descriptive name.

Note that this colormap is often critizised for over-exaggerating small differences
in significance below and above the gray - color transition threshold.
The transition parameter is defined between 0 and 1. To calculate the value
from data units an `~astropy.visualization.ImageNormalize` instance should be

This comment has been minimized.

@cdeil

cdeil Mar 20, 2015

Member

Does this sphinx link work ... I thought ImageNormalize is only exposed in the mpl_normalize sub-namespace.
Can you check the html docs locally?

----------
cmap : str or `~matplotlib.colors.Colormap`
Colormap name or instance.
mode : str

This comment has been minimized.

@cdeil

cdeil Mar 20, 2015

Member

For choices the numpy docstring standard suggests this:

mode : {'skimage', 'hsp'}
    Grayscale conversion method.
luminance = np.sqrt(np.dot(colors[:, :3] ** 2, RGB_weight))
colors[:, :3] = luminance[:, np.newaxis]
else:
raise ValueError('Not a valid grayscale conversion mode.')

This comment has been minimized.

@cdeil

cdeil Mar 20, 2015

Member

Add empty line.

return cmap.from_list(cmap.name + "_grayscale", colors, cmap.N)
def analyze_colormap(cmap, **kwargs):

This comment has been minimized.

@cdeil

cdeil Mar 20, 2015

Member

Maybe rename analyze_colormap to show_colormap or illustrate_colormap?
It doesn't do any analysis itself, just plots things.

@cdeil cdeil changed the title from Added world2fig transform and PSF inset for fitsfigures to Add colormap and PSF inset plotting functions Mar 20, 2015

@cdeil

This comment has been minimized.

Member

cdeil commented Mar 20, 2015

I've left a few inline comments, all minor cleanup.

@adonath adonath force-pushed the adonath:aplpy_psf_inset branch from f2fe1f9 to 38e7d59 Mar 20, 2015

adonath added a commit that referenced this pull request Mar 20, 2015

Merge pull request #245 from adonath/aplpy_psf_inset
Add colormap and PSF inset plotting functions

@adonath adonath merged commit 3a6b9fd into gammapy:master Mar 20, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@cdeil cdeil added the feature label Apr 8, 2015

@cdeil cdeil added this to the 0.2 milestone Apr 8, 2015

@adonath adonath deleted the adonath:aplpy_psf_inset branch Nov 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment