Skip to content

Instantly share code, notes, and snippets.

@Cadair
Last active December 18, 2015 11:20
Show Gist options
  • Save Cadair/5775070 to your computer and use it in GitHub Desktop.
Save Cadair/5775070 to your computer and use it in GitHub Desktop.
comp map
def add_map(self, input_, zorder=None, alpha=1, levels=False):
"""Adds a map to the CompositeMap
Parameters
----------
input_ : {sunpy.map, string}
Map instance or filepath to map to be added
zorder : int
The index to use when determining where the map should lie along
the z-axis; maps with higher z-orders appear above maps with lower
z-orders.
alpha : float
Opacity at which the map should be displayed. An alpha value of 0
results in a fully transparent image while an alpha value of 1
results in a fully opaque image. Values between result in semi-
transparent images.
"""
if zorder is None:
zorder = max([m.zorder for m in self._maps]) + 10
m = Map(input_)
assert isinstance(Map, GenericMap)
m.zorder = zorder
m.alpha = alpha
m.levels = levels
self._maps.append(m)
@rhewett
Copy link

rhewett commented Jun 14, 2013

Easy fix: add_map should take an already instantiated map, rather than a file name. Done.

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