Commit 67e78f7b authored by Mihai Baltac's avatar Mihai Baltac
Browse files

adding multiple heatmaps

parent 65aa95cf
# -*- coding: utf-8 -*-
from nifty.plotting.plotly_wrapper import PlotlyWrapper
import numpy as np
class Heatmap(PlotlyWrapper):
def __init__(self, data, color_map=None, webgl=False,
smoothing=False): # smoothing 'best', 'fast', False
self.data = data
if isinstance(data, list):
self.data = np.zeros((data[0].shape))
for arr in data:
self.data = np.add(self.data, arr)
else:
self.data = data
self.color_map = color_map
self.webgl = webgl
self.smoothing = smoothing
......
......@@ -14,8 +14,10 @@ class Mollweide(Heatmap):
raise ImportError("The module pylab is needed but not available.")
if 'healpy' not in gdi:
raise ImportError("The module healpy is needed but not available.")
data = self._mollview(data)
if isinstance(data, list):
data = [self._mollview(d) for d in data]
else:
data = self._mollview(data)
super(Mollweide, self).__init__(data, color_map, webgl, smoothing)
def _mollview(self, x, xsize=800):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment