Exemple #1
0
 def __init__(self, base, linthresh, linscale):
     Transform.__init__(self)
     self.base = base
     self.linthresh = linthresh
     self.linscale = linscale
     self._linscale_adj = (linscale / (1.0 - self.base ** -1))
     self._log_base = np.log(base)
 def __init__(self, **kwargs):
     Transform.__init__(self, **kwargs)
     self.dec0 = 0
     self.ra0 = 180
     self.dec1 = -60
     self.dec2 = 30
     self._update()
Exemple #3
0
 def __init__(self, nonpos):
     Transform.__init__(self)
     if nonpos == 'mask':
         self._handle_nonpos = _mask_non_logit
     else:
         self._handle_nonpos = _clip_non_logit
     self._nonpos = nonpos
 def __init__(self, resolution):
     """
     Resolution is the number of steps to interpolate between each input
     line segment to approximate its path in transformed space.
     """
     Transform.__init__(self)
     self._resolution = resolution
 def __init__(self, trans, dpi_scale_trans, fixed_point):
     Transform.__init__(self)
     self.input_dims = self.output_dims = 2
     self.has_inverse = False
     self.trans = trans
     self.dpi_scale_trans = dpi_scale_trans
     self.fixed_point = num.asarray(fixed_point, dtype=num.float)
Exemple #6
0
 def __init__(self, nonpos):
     Transform.__init__(self)
     if nonpos == 'mask':
         self._fill_value = np.nan
     else:
         self._fill_value = 1e-300
     self._nonpos = nonpos
Exemple #7
0
 def __init__(self, base, nonpos):
     Transform.__init__(self)
     self.base = base
     if nonpos == 'mask':
         self._handle_nonpos = _mask_non_positives
     else:
         self._handle_nonpos = _clip_non_positives
 def __init__(self, resolution):
     '''Create a new Split Lambert transform.
     
     Resolution is the number of steps to interpolate between each
     input line segment to approximate its path in curved Lambert space.
     '''
     Transform.__init__(self)
     self._resolution = resolution
Exemple #9
0
 def __init__(self, resolution=None):
     """
     Create a new WCS transform.
     """
     Transform.__init__(self)
     if resolution is None:
         resolution = 1
     self._resolution = resolution
Exemple #10
0
 def __init__(self, base, linthresh, linscale):
     Transform.__init__(self)
     symlog = SymmetricalLogTransform(base, linthresh, linscale)
     self.base = base
     self.linthresh = linthresh
     self.invlinthresh = symlog.transform(linthresh)
     self.linscale = linscale
     self._linscale_adj = (linscale / (1.0 - self.base ** -1))
 def __init__(self, resolution):
     """
     Create a new Hammer transform.  Resolution is the number of steps
     to interpolate between each input line segment to approximate its
     path in curved Hammer space.
     """
     Transform.__init__(self)
     self._resolution = resolution
Exemple #12
0
 def __init__(self, projection, resolution):
     """
     Create a new Mollweide transform.  Resolution is the number of steps
     to interpolate between each input line segment to approximate its
     path in curved Mollweide space.
     """
     self.projection = projection
     Transform.__init__(self)
     self._resolution = resolution
Exemple #13
0
 def __init__(self, center_longitude, center_latitude, resolution):
     """
     Create a new Lambert transform.  Resolution is the number of steps
     to interpolate between each input line segment to approximate its
     path in curved Lambert space.
     """
     Transform.__init__(self)
     self._resolution = resolution
     self._center_longitude = center_longitude
     self._center_latitude = center_latitude
Exemple #14
0
    def __init__(self, target_grid=None, source_crs=None, ax=None):
        """ Instanciate.

        Parameters
        ----------
        target_grid : salem.Grid
            typically, the map grid
        source_grid
        """
        self.source_crs = source_crs
        self.target_grid = target_grid
        self.ax = ax
        MPLTranform.__init__(self)
Exemple #15
0
    def __init__(self, dist, as_pct=True, out_of_bounds='mask'):
        Transform.__init__(self)
        self.dist = dist
        self.as_pct = as_pct
        self.out_of_bounds = out_of_bounds
        if self.as_pct:
            self.factor = 100.0
        else:
            self.factor = 1.0

        if self.out_of_bounds == 'mask':
            self._handle_out_of_bounds = _mask_out_of_bounds
        elif self.out_of_bounds == 'clip':
            self._handle_out_of_bounds = _clip_out_of_bounds
        else:
            raise ValueError("`out_of_bounds` muse be either 'mask' or 'clip'")
Exemple #16
0
 def __init__(self, nonpos='mask'):
     Transform.__init__(self)
     self._nonpos = nonpos
Exemple #17
0
    set(gca(), 'yticks', [])
    xlabel('intensity')
    ylabel('MRI density')

if 1:  # plot the EEG
    # load the data
    numSamples, numRows = 800, 4
    data = fromstring(file('data/eeg.dat', 'rb').read(), Float)
    data.shape = numSamples, numRows
    t = arange(numSamples) / float(numSamples) * 10.0
    ticklocs = []
    ax = subplot(212)

    height = 72  # height of one EEG in pixels
    # transform data to axes coord (0,1)
    transy = Transform(Bound1D(-.05, .05), Bound1D(-.2, .2))
    for i in range(numRows):
        thisLine = Line2D(ax.dpi,
                          ax.bbox,
                          t,
                          data[:, i] - data[0, i],
                          transx=ax.xaxis.transData,
                          transy=transy)
        offset = (i + 1) / (numRows + 1)
        thisLine.set_vertical_offset(offset, ax.yaxis.transAxis)

        ax.add_line(thisLine)
        ticklocs.append(offset)

    set(gca(), 'xlim', [0, 10])
    set(gca(), 'xticks', arange(10))
 def __init__(self, projection):
     self.projection = projection
     Transform.__init__(self)
 def __init__(self, nonpos='mask'):
     Transform.__init__(self)
     cbook._check_in_list(['mask', 'clip'], nonpos=nonpos)
     self._nonpos = nonpos
     self._clip = {"clip": True, "mask": False}[nonpos]
Exemple #20
0
 def __init__(self, axis=None):
     Transform.__init__(self)
     self._axis = axis
Exemple #21
0
 def __init__(self, nonpos):
     Transform.__init__(self)
     if nonpos == 'mask':
         self._fill_value = np.nan
     else:
         self._fill_value = 1e-300
 def __init__(self):
     Transform.__init__(self)
Exemple #23
0
 def __init__(self, dist):
     self.dist = dist
     Transform.__init__(self)
Exemple #24
0
 def __init__(self, nonpos='mask'):
     Transform.__init__(self)
     self._nonpos = nonpos
     self._clip = {"clip": True, "mask": False}[nonpos]
Exemple #25
0
 def invalidate(self):
     #print("I don't feel validated! (%s)" % (self.pass_through))
     return Transform.invalidate(self)
Exemple #26
0
 def __init__(self, base):
     Transform.__init__(self)
     self.base = base
Exemple #27
0
 def __init__(self, x_from, y_to):
     self.xpoints = x_from
     self.ypoints = y_to
     Transform.__init__(self)
Exemple #28
0
 def __init__(self, nonpos="mask"):
     Transform.__init__(self)
     self._nonpos = nonpos
Exemple #29
0
 def __init__(self, nonpos):
     Transform.__init__(self)
     if nonpos == 'mask':
         self._handle_nonpos = _mask_non_positives
     else:
         self._handle_nonpos = _clip_non_positives
 def transform_affine(self, values):
     print 'affine'
     return Transform.transform_affine(self, values)
 def __init__(self, axis=None, use_rmin=True):
     Transform.__init__(self)
     self._axis = axis
     self._use_rmin = use_rmin
Exemple #32
0
 def __init__(self, base, nonpos='clip'):
     Transform.__init__(self)
     self.base = base
     self._clip = {"clip": True, "mask": False}[nonpos]
Exemple #33
0
 def __init__(self, center_longitude, center_latitude, resolution):
     Transform.__init__(self)
     self._resolution = resolution
     self._center_longitude = center_longitude
     self._center_latitude = center_latitude
Exemple #34
0
 def __init__(self, nonpos='mask'):
     Transform.__init__(self)
     self._nonpos = nonpos
Exemple #35
0
 def __init__(self, base):
     Transform.__init__(self)
     self.base = base
 def __init__(self, exponent):
     Transform.__init__(self)
     self.exponent = exponent
Exemple #37
0
 def __init__(self, dist, nonpos='mask'):
     Transform.__init__(self)
     self.dist = dist
     self._nonpos = nonpos
Exemple #38
0
 def __init__(self, center_longitude, center_latitude, resolution):
     Transform.__init__(self)
     self._resolution = resolution
     self._center_longitude = center_longitude
     self._center_latitude = center_latitude
Exemple #39
0
 def __init__(self, nonpos='clip'):
     Transform.__init__(self)
     self._clip = {"clip": True, "mask": False}[nonpos]
 def __init__(self, resolution):
     Transform.__init__(self)
     self._resolution = resolution
 def __init__(self, dist):
     self.dist = dist
     Transform.__init__(self)
Exemple #42
0
 def invalidate(self):
     #print("I don't feel validated! (%s)" % (self.pass_through))
     return Transform.invalidate(self)
Exemple #43
0
 def __init__(self, axis=None):
     Transform.__init__(self)
     self._axis = axis
Exemple #44
0
 def __init__(self, x_from, y_to):
     self.xpoints = x_from
     self.ypoints = y_to
     Transform.__init__(self)
Exemple #45
0
 def __init__(self, inverted, **kwargs):
     Transform.__init__(self, **kwargs)
     self.inverted = inverted
Exemple #46
0
 def __init__(self, axis=None, use_rmin=True):
     Transform.__init__(self)
     self._axis = axis
     self._use_rmin = use_rmin
 def __init__(self, resolution):
     Transform.__init__(self)
     self._resolution = resolution