Package pylal :: Module metaarray :: Class MetaArray
[hide private]
[frames] | no frames]

Class MetaArray

source code

numpy.ndarray --+
                |
               MetaArray

An array containing a data and metadata. Intended to be subclassed.

On b = MetaArray(a) where a is a MetaArray, metadata is copied, but data is not.

Nested Classes [hide private]
  _metadata_type
Abstract class to hold metadata
Instance Methods [hide private]
 
__new__(subtype, data=None, metadata=None, dtype=None, copy=False, subok=True) source code
 
__array_finalize__(self, obj)
Called anytime a MetaArray is returned; make sure that metadata is set to something.
source code
 
__array_wrap__(self, obj)
Called anytime a ufunc operates on a MetaArray and another object.
source code
 
__repr__(self) source code
 
__str__(self) source code
 
_get_data(self) source code
 
__getstate__(self)
Returns the internal state of the object, for pickling purposes.
source code
 
__setstate__(self, state)
Restores the internal state of the masked array, for unpickling purposes.
source code
 
__reduce__(self)
Returns a 3-tuple for pickling a MetaArray
source code
Class Variables [hide private]
  __array_priority__ = 10.1
  __abs__ = _arraymethod('__abs__')
  __add__ = _arraymethod('__add__')
  __and__ = _arraymethod('__and__')
  __copy__ = _arraymethod('__copy__')
  __deepcopy__ = _arraymethod('__deepcopy__')
  __div__ = _arraymethod('__div__')
  __divmod__ = _arraymethod('__divmod__')
  __floordiv__ = _arraymethod('__floordiv__')
  __hex__ = _arraymethod('__hex__')
  __iadd__ = _arraymethod('__iadd__')
  __iand__ = _arraymethod('__iand__')
  __idiv__ = _arraymethod('__idiv__')
  __ifloordiv__ = _arraymethod('__ifloordiv__')
  __ilshift__ = _arraymethod('__ilshift__')
  __imod__ = _arraymethod('__imod__')
  __imul__ = _arraymethod('__imul__')
  __invert__ = _arraymethod('__invert__')
  __ior__ = _arraymethod('__ior__')
  __ipow__ = _arraymethod('__ipow__')
  __irshift__ = _arraymethod('__irshift__')
  __isub__ = _arraymethod('__isub__')
  __itruediv__ = _arraymethod('__itruediv__')
  __ixor__ = _arraymethod('__ixor__')
  __lshift__ = _arraymethod('__lshift__')
  __mul__ = _arraymethod('__mul__')
  __rmod__ = _arraymethod('__rmod__')
  __rmul__ = _arraymethod('__rmul__')
  __ror__ = _arraymethod('__ror__')
  __rpow__ = _arraymethod('__rpow__')
  __rrshift__ = _arraymethod('__rrshift__')
  __rshift__ = _arraymethod('__rshift__')
  __rsub__ = _arraymethod('__rsub__')
  __rtruediv__ = _arraymethod('__rtruediv__')
  __rxor__ = _arraymethod('__rxor__')
  __sub__ = _arraymethod('__sub__')
  __truediv__ = _arraymethod('__truediv__')
  __xor__ = _arraymethod('__xor__')
  astype = _arraymethod('astype')
  byteswap = _arraymethod('byteswap')
  choose = _arraymethod('choose')
  clip = _arraymethod('clip')
  compress = _arraymethod('compress')
  conj = _arraymethod('conj')
  conjugate = _arraymethod('conjugate')
  copy = _arraymethod('copy')
  cumprod = _arraymethod('cumprod')
  cumsum = _arraymethod('cumsum')
  diagonal = _arraymethod('diagonal')
  fill = _arraymethod('fill')
  flat = _arraymethod('flat')
  flatten = _arraymethod('flatten')
  repeat = _arraymethod('repeat')
  squeeze = _arraymethod('squeeze')
  transpose = _arraymethod('transpose')
  T = property(fget= lambda self: self.transpose())
  H = property(fget= lambda self: self.T.conj())
  A = property(fget= _get_data)
Method Details [hide private]

__array_wrap__(self, obj)

source code 

Called anytime a ufunc operates on a MetaArray and another object. The result of the ufunc is obj. The MetaArray operand is self.

__setstate__(self, state)

source code 

Restores the internal state of the masked array, for unpickling purposes. `state` is typically the output of the ``__getstate__`` output, and is a 5-tuple:

  • class name
  • a tuple giving the shape of the data
  • a typecode for the data
  • a binary string for the data
  • a binary string for the mask.

__reduce__(self)

source code 

Returns a 3-tuple for pickling a MetaArray

  • reconstruction function
  • tuple to pass reconstruction function
  • state, which will be passed to __setstate__