Last active
December 18, 2015 11:20
-
-
Save Cadair/5775070 to your computer and use it in GitHub Desktop.
comp map
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Easy fix: add_map should take an already instantiated map, rather than a file name. Done.