(self, m, fig=None, nest=False, cmap=None, norm=None, coord=None)
m: the map to be zoomed (already plotted in Mollweide view)
        fig: the figure to instrument (None->gcf())
m: the map to be zoomed (already plotted in Mollweide view)
        fig: the figure to instrument (None->gcf())
m : the map to be zoomed ( already plotted in Mollweide view ) fig : the figure to instrument ( None - > gcf () )
def __init__(self, m, fig=None, nest=False, cmap=None, norm=None, coord=None):
        """m: the map to be zoomed (already plotted in Mollweide view)
        fig: the figure to instrument (None->gcf())
        """
        import pylab

        self.reso_list = [
            0.05,
            0.1,
            0.2,
            0.3,
            0.5,
            0.75,
            1.0,
            1.5,
            3.0,
            5.0,
            10.0,
            15.0,
            30.0,
            45.0,
            60.0,
        ]
        self._map = m
        self._nest = nest
        self._cmap = cmap
        self._norm = norm
        self._coord = coord
        self._range_status = 0  # 0:normal, 1:global map min,max, 2: saved
        self.save_min = self.save_max = None
        self._graton = False
        # find min, max of map
        if isinstance(m, dict):
            if len(m) == 0:
                self._mapmin, self._mapmax = -1.0, 1.0
            else:
                self._mapmin, self._mapmax = min(m.values()), max(m.values())
        else:
            mgood = m[m != UNSEEN]
            if mgood.size == 0:
                self._mapmin, self._mapmax = -1.0, 1.0
            else:
                self._mapmin, self._mapmax = mgood.min(), mgood.max()
            del mgood
        if fig is None:
            f = pylab.gcf()
        else:
            f = pylab.figure(fig)
        self.f = f
        f.zoomtool = self
        (
            self._moll_ax,
            self._moll_cb_ax,
            self._gnom_ax,
            self._gnom_cb_ax,
        ) = f.get_axes()[:4]
        self._grat_ax = f.get_axes()[4]
        self._text_reso, self._text_coord, self._text_loc = self._gnom_ax.texts
        self._xsize = self._gnom_ax.proj.arrayinfo["xsize"]
        self._ysize = self._gnom_ax.proj.arrayinfo["ysize"]
        try:
            self._reso_idx = self.reso_list.index(self._gnom_ax.proj._arrayinfo["reso"])
        except ValueError as e:
            raise ValueError("Resolution not in %s" % self.reso_list)
        (self.zoomcenter,) = self._moll_ax.plot([0], [0], "ok", mew=1, ms=15, alpha=0.1)
        (self.zoomcenter2,) = self._moll_ax.plot(
            [0], [0], "xr", ms=15, alpha=0.5, mew=3
        )
        self._text_range = self._gnom_ax.text(
            -0.4,
            -0.2,
            "scale mode: loc",
            transform=self._gnom_ax.transAxes,
            va="baseline",
            ha="left",
        )
        self.draw_gnom(0, 0)
        self._connected = False
        self.connect_callbacks()
def __init__ ( self , m , fig = None , nest = False , cmap = None , norm = None , coord = None ) : import pylab self . reso_list = [ 0.05 , 0.1 , 0.2 , 0.3 , 0.5 , 0.75 , 1.0 , 1.5 , 3.0 , 5.0 , 10.0 , 15.0 , 30.0 , 45.0 , 60.0 , ] self . _map = m self . _nest = nest self . _cmap = cmap self . _norm = norm self . _coord = coord self . _range_status = 0 # 0:normal, 1:global map min,max, 2: saved self . save_min = self . save_max = None self . _graton = False # find min, max of map if isinstance ( m , dict ) : if len ( m ) == 0 : self . _mapmin , self . _mapmax = - 1.0 , 1.0 else : self . _mapmin , self . _mapmax = min ( m . values ( ) ) , max ( m . values ( ) ) else : mgood = m [ m != UNSEEN ] if mgood . size == 0 : self . _mapmin , self . _mapmax = - 1.0 , 1.0 else : self . _mapmin , self . _mapmax = mgood . min ( ) , mgood . max ( ) del mgood if fig is None : f = pylab . gcf ( ) else : f = pylab . figure ( fig ) self . f = f f . zoomtool = self ( self . _moll_ax , self . _moll_cb_ax , self . _gnom_ax , self . _gnom_cb_ax , ) = f . get_axes ( ) [ : 4 ] self . _grat_ax = f . get_axes ( ) [ 4 ] self . _text_reso , self . _text_coord , self . _text_loc = self . _gnom_ax . texts self . _xsize = self . _gnom_ax . proj . arrayinfo [ "xsize" ] self . _ysize = self . _gnom_ax . proj . arrayinfo [ "ysize" ] try : self . _reso_idx = self . reso_list . index ( self . _gnom_ax . proj . _arrayinfo [ "reso" ] ) except ValueError as e : raise ValueError ( "Resolution not in %s" % self . reso_list ) ( self . zoomcenter , ) = self . _moll_ax . plot ( [ 0 ] , [ 0 ] , "ok" , mew = 1 , ms = 15 , alpha = 0.1 ) ( self . zoomcenter2 , ) = self . _moll_ax . plot ( [ 0 ] , [ 0 ] , "xr" , ms = 15 , alpha = 0.5 , mew = 3 ) self . _text_range = self . _gnom_ax . text ( - 0.4 , - 0.2 , "scale mode: loc" , transform = self . _gnom_ax . transAxes , va = "baseline" , ha = "left" , ) self . draw_gnom ( 0 , 0 ) self . _connected = False self . connect_callbacks ( )