def __call__(self, value): if self.vmax <= self.vmin: self.vmax, self.vmin = self.vmin, self.vmax result = 1 - Normalize.__call__(self, value) self.vmax, self.vmin = self.vmin, self.vmax else: result = Normalize.__call__(self, value) return result
def __call__(self, value, clip=None): # I'm ignoring masked values and all kinds of edge cases to make a # simple example... if self.xvalues is not None: x, y = self.xvalues, self.cvalues return np.ma.masked_array(np.interp(value, x, y)) else: return Normalize.__call__(self, value, clip)
def __call__(self, *args): v = Normalize.__call__(self, *args) return v*v
def __call__(self, epoch, **kargs): if isinstance(epoch, np.ndarray) and len(epoch.shape) == 0: epoch = epoch.item() return Normalize.__call__(self, self.mktime(epoch), **kargs)