Current File : //usr/lib64/python2.7/site-packages/numpy/ma/core.pyo
�
E�`Qc�@s�dZdZdZddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�g�Zd�d�lZd�d�lZd�d�lmZmZm	Z	m
Z
mZd�d�lmZ
d�d�ljjZd�d�lmZd�d�ljjZd�d�lmZmZd�d�lmZd�d�lZd�d�lZejd�d�krd�d�lmZnejZ e d��Z!d��Z"d��Z#de$fd���YZ%de%fd���YZ&ie'd�6d�d�d�6d�d�6d�d�6d�d�6d�d�6d�d�6d�d�6d�d�6ej(d�d��d�6ej(d�d��d�6Z)ej*Z+e+j,gej-ej.gD]Z/e/ej0f^q��ej1Z2e2j,gej-ej.gD]Z/e/ej0
f^q6�d�ej3kr�e+j,ej4ej0fg�e2j,ej4ej0
fg�nd��Z5d��Z6d��Z7d��Z8d��Z9d��Z:d��Z;d��Z<d��Z=d��Z>e?d��Z@d��ZAe'd��ZBeBZCe!e'e?d��ZDiZEiZFd�fd���YZGd�fd���YZHd�fd���YZId�fd���YZJd�fd���YZKd�fd���YZLd�fd���YZMd�fd���YZNeLejO�ZOeLejP�ZPeLejQ�ZQeLejR�ZReLejS�ZSeLejT�ZTeLejU�ZUeLejV�ZVeLejW�ZWeLejX�ZXeLejY�ZZZYeLe�ZeLej[�Z[eLej\�Z\eLej]�Z]eLej^�Z^eLej_�Z`eLeja�ZaeLejbd�eKd���ZbeLejcd�eJd���ZceLejdd�eJd���ZdeLejed�eJd���ZeeLejSd�eHd���ZSeLejfd�eGd�d���ZfeLejgd�eGd�d���ZgeLejhd�eKd���ZheLejid�eGd�d�d�d���ZieMejj�ZjeMejk�ZkeMejld�d��ZleMejmd�d��ZmeMejn�Zne?en_eMejo�Zoe?eo_eMejp�Zpe?ep_eMejq�Zqe?eq_eMejr�Zre?er_eMejs�Zse?es_eMejt�ZteMejtd�d��jZueMejv�ZvevjZweMejx�ZxeMejy�ZyeMejz�ZzeMej{�Z{eMej|�Z|eNej}eI�d�d��Z}eNej~eI�d�d��Z~eNejeI�d�d��ZeNej�eI�d�d��Z�eNej�eI�d�d��Z�eNej�eI�d�d��Z�ed��Z�d��Z�d��Z�e�Z�d��Z�d��Z�e�e'e d�Z�e?d�Z�e�e'd�Z�d�Z�d�Z�e'd�Z�e'd�Z�e'd�Z�e'd�Z�e'd	�Z�e'd
�Z�e'd�Z�e'd�Z�e'd
�Z�e'e'd�Z�dde'e'd�Z�e'd�Z�dfd��YZ�e�d�Z�d�Z�e�dddddddd�Z�d�Z�d �Z�d!e�fd"��YZ�d#e�fd$��YZ�defd%��YZ�d&�Z�d�e�fd'��YZ�d(�Z�e�Z�e�Z�d)e�fd*��YZ�e��Z�Z�e�Z�e?e�e�e!e?e'e�e'e'd�d+�
Ze�je_d,�Z�d-e�fd.��YZ�d/e�fd0��YZ�d1e�fd2��YZ�e?e?e?d3�Z�e�j�je�_e?e?e?d4�Z�e�j�je�_e?e?e?d5�Z�e�j�je�_d6fd7��YZ�e�d�Z�e�d�Z�Z�e�d�Z�e�d+�Z�e�d3�Z�e�d4�Z�e�d/�Z�e�d7�Z�e�dQ�Z�e�dT�Z�e��Z�e�d��Z�e��Z�e�d��Z�e�d��Z�e�d��Z�e�d��Z�e�d��Z�e�d8�Z�e�d��Z�e�d��Z�e�d��Z�e�d��Z�e�d��Z�e�d��Z�e?e?d9d:�Z�e?d;�Z�e?d<e?e?d=�Z�e�j�je�_e?e?d>�Z�e�j�je�_e?e?d?�Z�e�j�je�_d�d<e?e'e?d@�Z�e�j�je�_dA�Z�d�dB�Z�e?dC�Z�e�j�je�_d�dD�Z�dE�ZdF�Z�dG�Z�d9dH�Z�dI�Z�e?dJ�Z�dKdL�Z�dM�Z�dN�Z�ej�je�_dO�Z�ej�je�_e?dP�Z�ej�je�_e?e?dQ�Z�e?d9dR�Z�d�e?dS�Z_e_Z�dT�Z�e"ej�jdU�e�_e�Z�dV�Z�e"ej�jdU�e�_e�Z�e'dW�Z�e'dddX�Z�e?e?dY�Z�e?dZ�Z�d[�Z�d\�Z�d]�Z�d^�Z�e�d�d_d`�Z�da�Z�dbfdc��YZ�e�ddde�dee?dfe���Z�ej�Z�ej�Z�e�d<dde�dee?dfe���Z�e�d=�Z�e�dI�Z�e�dK�Z�e�dSdde�dee?dfe���Z�ejZe�d�dde�dee?dfe���ZejZejZe�d�dde�dee?dfe���ZejZd�S(gs�
numpy.ma : a package to handle missing or invalid values.

This package was initially written for numarray by Paul F. Dubois
at Lawrence Livermore National Laboratory.
In 2006, the package was completely rewritten by Pierre Gerard-Marchant
(University of Georgia) to make the MaskedArray class a subclass of ndarray,
and to improve support of structured arrays.


Copyright 1999, 2000, 2001 Regents of the University of California.
Released for unlimited redistribution.

* Adapted for numpy_core 2005 by Travis Oliphant and (mainly) Paul Dubois.
* Subclassing of the base `ndarray` 2006 by Pierre Gerard-Marchant
  (pgmdevlist_AT_gmail_DOT_com)
* Improvements suggested by Reggie Dugard (reggie_AT_merfinllc_DOT_com)

.. moduleauthor:: Pierre Gerard-Marchant

sPierre GF Gerard-Marchantsrestructuredtext entMAErrort	MaskErrortMaskTypetMaskedArraytbool_tabstabsolutetaddtalltallclosetallequaltalltruetamaxtamintangletanomt	anomaliestanytarangetarccostarccoshtarcsintarcsinhtarctantarctan2tarctanhtargmaxtargmintargsorttaroundtarraytasarrayt
asanyarraytbitwise_andt
bitwise_ortbitwise_xortceiltchoosetcliptcommon_fill_valuetcompresst
compressedtconcatenatet	conjugatetcopytcostcoshtcounttcumprodtcumsumtdefault_fill_valuetdiagtdiagonaltdifftdividetdumptdumpstemptyt
empty_liketequaltexptexpand_dimstfabstflatten_masktfmodtfilledtfloortfloor_dividetfix_invalidtflatten_structured_arrayt
frombuffertfromflextfromfunctiontgetdatatgetmasktgetmaskarraytgreatert
greater_equaltharden_maskthypottidentitytidstindicestinnertinnerproducttisMAt
isMaskedArraytis_maskt	is_maskedtisarrayt
left_shifttlesst
less_equaltloadtloadstlogtlog2tlog10tlogical_andtlogical_nott
logical_ortlogical_xort	make_masktmake_mask_descrtmake_mask_nonetmask_ortmaskedtmasked_arraytmasked_equaltmasked_greatertmasked_greater_equalt
masked_insidetmasked_invalidtmasked_lesstmasked_less_equaltmasked_not_equalt
masked_objecttmasked_outsidetmasked_print_optiontmasked_singletont
masked_valuestmasked_wheretmaxtmaximumtmaximum_fill_valuetmeantmintminimumtminimum_fill_valuetmodtmultiplytmvoidtnegativetnomasktnonzerot	not_equaltonestoutertouterproducttpowertprodtproducttptptputtputmasktranktravelt	remaindertrepeattreshapetresizetright_shifttround_troundtset_fill_valuetshapetsintsinhtsizetsometruetsorttsoften_masktsqrttsqueezetstdtsubtracttsumtswapaxesttakettanttanhttracet	transposettrue_dividetvartwheretzerosi����N(tndarrayRR
tiscomplexobjR(R(R(t
getargspect
formatargspec(R=ii(treducecCs4|dkrdS|dkr |Sd}|||fS(s8
    Adds a Notes section to an existing docstring.
    Ns(
    %s

    Notes
    -----
    %s
    (tNone(t
initialdoctnotetnewdoc((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pytdoc_noteZscCs6ytt|��}Wntk
r1}d}nX|S(s$
    Get the signature from obj
    t(R�R�t	TypeError(tobjtsigterrmsg((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pytget_object_signatureks

cBseZdZRS(s&Class for masked array related errors.(t__name__t
__module__t__doc__(((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR~scBseZdZRS(sClass for mask related errors.(R�R�R�(((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�stbg@��x�Dytctfi?Btit?tOsN/AtStus???tVtUtNaTtDsM8[D]tussM8[us]tfloat128cCsJt|d�r$td|j�}n"t|tj�r�|jr^tj|jdj	d�}qF|j	dkr�tj|j
dd�}qFtj|j	d�}n�t|t�r�td}n�t|t�s�t|t
�r�td}n^t|t
�rtd}nBt|t�r td	}n&t|t�r<td
}n
td}|S(
sh
    Return the default fill value for the argument object.

    The default filling value depends on the datatype of the input
    array or the type of the input scalar:

       ========  ========
       datatype  default
       ========  ========
       bool      True
       int       999999
       float     1.e20
       complex   1.e20+0j
       object    '?'
       string    'N/A'
       ========  ========


    Parameters
    ----------
    obj : ndarray, dtype or scalar
        The array data-type or scalar for which the default fill value
        is returned.

    Returns
    -------
    fill_value : scalar
        The default fill value.

    Examples
    --------
    >>> np.ma.default_fill_value(1)
    999999
    >>> np.ma.default_fill_value(np.array([1.1, 2., np.pi]))
    1e+20
    >>>  np.ma.default_fill_value(np.dtype(complex))
    (1e+20+0j)

    tdtypeiR�tMiR�R�R�R�R�R�N(thasattrt_check_fill_valueR�R�t
isinstancetnptsubdtypetdefault_fillertgettkindtstrtfloattinttlongtunicodetcomplex(R�tdefval((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR2�s((	





cCsX|j}|rPg}x.|D]&}t|||�}|j|�qWt|�S||S(N(tnamest_recursive_extremum_fill_valuetappendttuple(tndtypetextremumR�tdeflisttnametfval((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��s	

cCs�d}t|d�r%t|jt�St|t�rCttjdSt|t�rattjdSt|t	�rttjdSt|t
j�r�t|St|��dS(sX
    Return the maximum value that can be represented by the dtype of an object.

    This function is useful for calculating a fill value suitable for
    taking the minimum of an array with a given dtype.

    Parameters
    ----------
    obj : ndarray or dtype
        An object that can be queried for it's numeric type.

    Returns
    -------
    val : scalar
        The maximum representable value.

    Raises
    ------
    TypeError
        If `obj` isn't a suitable numeric type.

    See Also
    --------
    maximum_fill_value : The inverse function.
    set_fill_value : Set the filling value of a masked array.
    MaskedArray.fill_value : Return current fill value.

    Examples
    --------
    >>> import numpy.ma as ma
    >>> a = np.int8()
    >>> ma.minimum_fill_value(a)
    127
    >>> a = np.int32()
    >>> ma.minimum_fill_value(a)
    2147483647

    An array of numeric data can also be passed.

    >>> a = np.array([1, 2, 3], dtype=np.int8)
    >>> ma.minimum_fill_value(a)
    127
    >>> a = np.array([1, 2, 3], dtype=np.float32)
    >>> ma.minimum_fill_value(a)
    inf

    s(Unsuitable type for calculating minimum.R�tfloat_tint_tuintN(R�R�R�t
min_fillerR�R�tntypesttypeDictR�R�R�R�(R�R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��s0cCs�d}t|d�r%t|jt�St|t�rCttjdSt|t�rattjdSt|t	�rttjdSt|t
j�r�t|St|��dS(s\
    Return the minimum value that can be represented by the dtype of an object.

    This function is useful for calculating a fill value suitable for
    taking the maximum of an array with a given dtype.

    Parameters
    ----------
    obj : {ndarray, dtype}
        An object that can be queried for it's numeric type.

    Returns
    -------
    val : scalar
        The minimum representable value.

    Raises
    ------
    TypeError
        If `obj` isn't a suitable numeric type.

    See Also
    --------
    minimum_fill_value : The inverse function.
    set_fill_value : Set the filling value of a masked array.
    MaskedArray.fill_value : Return current fill value.

    Examples
    --------
    >>> import numpy.ma as ma
    >>> a = np.int8()
    >>> ma.maximum_fill_value(a)
    -128
    >>> a = np.int32()
    >>> ma.maximum_fill_value(a)
    -2147483648

    An array of numeric data can also be passed.

    >>> a = np.array([1, 2, 3], dtype=np.int8)
    >>> ma.maximum_fill_value(a)
    -128
    >>> a = np.array([1, 2, 3], dtype=np.float32)
    >>> ma.maximum_fill_value(a)
    -inf

    s(Unsuitable type for calculating maximum.R�R�R�R�N(R�R�R�t
max_fillerR�R�R�R�R�R�R�R�(R�R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR|)s0cCsrg}x_|D]W}|d}t|t�rH|jtt|���q
|jttj|���q
Wt|�S(Ni(R�tlistR�R�t!_recursive_set_default_fill_valueR2R�R�(t
dtypedescrR�tcurrentdescrtcurrenttype((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�hs

 cCs�tj|t|��}g}xwt||�D]f\}}|d}t|t�rr|jtt||���q.|jtj	|d|�j
��q.Wt|�S(NiR�(R�R�tlentzipR�R�R�R�t_recursive_set_fill_valueRtitem(t	fillvalueR�toutput_valueR�tdescrtcdtype((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�rs
&cCs�tj|�}|j}|dkr`|rQ|j}tjt|�d|�}q�t|�}nE|r9g|jD]}|d|df^qp}t|t	tj
f�r�ytj|dtd|�}Wq6tk
r�d}t|||f��q6Xq�|j}tj
|dt�}tjt||�d|�}nlt|t�rf|jdkrft|�}n?ytj|dtd|�}Wntk
r�t|�}nXtj|�S(s�
    Private function validating the given `fill_value` for the given dtype.

    If fill_value is None, it is set to the default corresponding to the dtype
    if this latter is standard (no fields). If the datatype is flexible (named
    fields), fill_value is set to a tuple whose elements are the default fill
    values corresponding to each field.

    If fill_value is not None, its value is forced to the given dtype.

    R�iiR,s"Unable to transform %s to dtype %stSVN(R�R�tfieldsR�R�RR�R2R�R�tvoidtFalset
ValueErrorRtobjectR�t
basestringtchart
OverflowError(t
fill_valueR�RR�t_tfdtypeterr_msg((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�~s6		*
	
cCs#t|t�r|j|�ndS(s�
    Set the filling value of a, if a is a masked array.

    This function changes the fill value of the masked array `a` in place.
    If `a` is not a masked array, the function returns silently, without
    doing anything.

    Parameters
    ----------
    a : array_like
        Input array.
    fill_value : dtype
        Filling value. A consistency test is performed to make sure
        the value is compatible with the dtype of `a`.

    Returns
    -------
    None
        Nothing returned by this function.

    See Also
    --------
    maximum_fill_value : Return the default fill value for a dtype.
    MaskedArray.fill_value : Return current fill value.
    MaskedArray.set_fill_value : Equivalent method.

    Examples
    --------
    >>> import numpy.ma as ma
    >>> a = np.arange(5)
    >>> a
    array([0, 1, 2, 3, 4])
    >>> a = ma.masked_where(a < 3, a)
    >>> a
    masked_array(data = [-- -- -- 3 4],
          mask = [ True  True  True False False],
          fill_value=999999)
    >>> ma.set_fill_value(a, -999)
    >>> a
    masked_array(data = [-- -- -- 3 4],
          mask = [ True  True  True False False],
          fill_value=-999)

    Nothing happens if `a` is not a masked array.

    >>> a = range(5)
    >>> a
    [0, 1, 2, 3, 4]
    >>> ma.set_fill_value(a, 100)
    >>> a
    [0, 1, 2, 3, 4]
    >>> a = np.arange(5)
    >>> a
    array([0, 1, 2, 3, 4])
    >>> ma.set_fill_value(a, 100)
    >>> a
    array([0, 1, 2, 3, 4])

    N(R�RR�(taR	((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��s<cCs+t|t�r|j}nt|�}|S(sr
    Return the filling value of a, if any.  Otherwise, returns the
    default filling value for that type.

    (R�RR	R2(R
tresult((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pytget_fill_value�scCs,t|�}t|�}||kr(|SdS(s
    Return the common filling value of two masked arrays, if any.

    If ``a.fill_value == b.fill_value``, return the fill value,
    otherwise return None.

    Parameters
    ----------
    a, b : MaskedArray
        The masked arrays for which to compare fill values.

    Returns
    -------
    fill_value : scalar or None
        The common fill value, or None.

    Examples
    --------
    >>> x = np.ma.array([0, 1.], fill_value=3)
    >>> y = np.ma.array([0, 1.], fill_value=3)
    >>> np.ma.common_fill_value(x, y)
    3.0

    N(RR�(R
R�tt1tt2((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR'�s
cCs_t|d�r|j|�St|t�r/|St|t�rNtj|d�Stj|�SdS(sn
    Return input as an array with masked data replaced by a fill value.

    If `a` is not a `MaskedArray`, `a` itself is returned.
    If `a` is a `MaskedArray` and `fill_value` is None, `fill_value` is set to
    ``a.fill_value``.

    Parameters
    ----------
    a : MaskedArray or array_like
        An input object.
    fill_value : scalar, optional
        Filling value. Default is None.

    Returns
    -------
    a : ndarray
        The filled array.

    See Also
    --------
    compressed

    Examples
    --------
    >>> x = np.ma.array(np.arange(9).reshape(3, 3), mask=[[1, 0, 0],
    ...                                                   [1, 0, 0],
    ...                                                   [0, 0, 0]])
    >>> x.filled()
    array([[999999,      1,      2],
           [999999,      4,      5],
           [     6,      7,      8]])

    RAR�N(R�RAR�R�tdictR�R(R
R	((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRAs#
cGs�t|�dkrC|d}t|t�r:t|�}q�t}nng|D]}t|�^qJ}|d}t|t�s�t}nx*|dD]}t||�r�|}q�q�W|jdkr�tS|S(s�
    Return the youngest subclass of MaskedArray from a list of (masked) arrays.
    In case of siblings, the first listed takes over.

    iitMaskedConstant(R�R�Rttypet
issubclassR�(tarraystarrtrclsR
tarrclstcls((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pytget_masked_subclassGs
	
	
cCsSy
|j}Wn,tk
r;tj|dtd|�}nX|sO|jt�S|S(sF
    Return the data of a masked array as an ndarray.

    Return the data of `a` (if any) as an ndarray if `a` is a ``MaskedArray``,
    else return `a` as a ndarray or subclass (depending on `subok`) if not.

    Parameters
    ----------
    a : array_like
        Input ``MaskedArray``, alternatively a ndarray or a subclass thereof.
    subok : bool
        Whether to force the output to be a `pure` ndarray (False) or to
        return a subclass of ndarray if appropriate (True, default).

    See Also
    --------
    getmask : Return the mask of a masked array, or nomask.
    getmaskarray : Return the mask of a masked array, or full array of False.

    Examples
    --------

    >>> import numpy.ma as ma
    >>> a = ma.masked_equal([[1,2],[3,4]], 2)
    >>> a
    masked_array(data =
     [[1 --]
     [3 4]],
          mask =
     [[False  True]
     [False False]],
          fill_value=999999)
    >>> ma.getdata(a)
    array([[1, 2],
           [3, 4]])

    Equivalently use the ``MaskedArray`` `data` attribute.

    >>> a.data
    array([[1, 2],
           [3, 4]])

    R,tsubok(t_datatAttributeErrorR�RRtviewR�(R
Rtdata((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRIas,


cCs�t|d|d|dt�}tjtj|j��}|j�sI|S|j|O_|dkrp|j	}n||j|<|S(s�
    Return input with invalid data masked and replaced by a fill value.

    Invalid data means values of `nan`, `inf`, etc.

    Parameters
    ----------
    a : array_like
        Input array, a (subclass of) ndarray.
    copy : bool, optional
        Whether to use a copy of `a` (True) or to fix `a` in place (False).
        Default is True.
    fill_value : scalar, optional
        Value used for fixing invalid data. Default is None, in which case
        the ``a.fill_value`` is used.

    Returns
    -------
    b : MaskedArray
        The input array with invalid entries fixed.

    Notes
    -----
    A copy is performed by default.

    Examples
    --------
    >>> x = np.ma.array([1., -1, np.nan, np.inf], mask=[1] + [0]*3)
    >>> x
    masked_array(data = [-- -1.0 nan inf],
                 mask = [ True False False False],
           fill_value = 1e+20)
    >>> np.ma.fix_invalid(x)
    masked_array(data = [-- -1.0 -- --],
                 mask = [ True False  True  True],
           fill_value = 1e+20)

    >>> fixed = np.ma.fix_invalid(x)
    >>> fixed.data
    array([  1.00000000e+00,  -1.00000000e+00,   1.00000000e+20,
             1.00000000e+20])
    >>> x.data
    array([  1.,  -1.,  NaN,  Inf])

    R,tmaskRN(
RktTrueR�RctisfiniteRRt_maskR�R	(R
R!R,R	tinvalid((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRD�s.
t_DomainCheckIntervalcBs eZdZd�Zd�ZRS(s~
    Define a valid interval, so that :

    ``domain_check_interval(a,b)(x) == True`` where
    ``x < a`` or ``x > b``.

    cCs2||kr||}}n||_||_dS(s9domain_check_interval(a,b)(x) = true where x < a or y > bN(R
R�(tselfR
R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt__init__�s	cCs.tjtj||j�tj||j��S(sExecute the call behavior.(tumathRdRLR�R[R
(R'tx((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt__call__�s(R�R�R�R(R+(((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR&�s	t
_DomainTancBs eZdZd�Zd�ZRS(szDefine a valid interval for the `tan` function, so that:

    ``domain_tan(eps) = True`` where ``abs(cos(x)) < eps``

    cCs
||_dS(s/domain_tan(eps) = true where abs(cos(x)) < eps)N(teps(R'R-((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR(�scCs%tjtjtj|��|j�S(sExecutes the call behavior.(R)R[RR-R-(R'R*((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR+�s(R�R�R�R(R+(((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR,�s	t_DomainSafeDividecBs#eZdZdd�Zd�ZRS(s"Define a domain for safe division.cCs
||_dS(N(t	tolerance(R'R/((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR(scCsJ|jdkr'tjt�j|_ntj|�|jtj|�kS(N(R/R�R�tfinfoR�ttinyR)R(R'R
R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR+sN(R�R�R�R�R(R+(((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR.�st_DomainGreatercBs eZdZd�Zd�ZRS(s)DomainGreater(v)(x) is True where x <= v.cCs
||_dS(s'DomainGreater(v)(x) = true where x <= vN(tcritical_value(R'R3((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR(scCstj||j�S(sExecutes the call behavior.(R)R\R3(R'R*((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR+s(R�R�R�R(R+(((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR2
s	t_DomainGreaterEqualcBs eZdZd�Zd�ZRS(s-DomainGreaterEqual(v)(x) is True where x < v.cCs
||_dS(s+DomainGreaterEqual(v)(x) = true where x < vN(R3(R'R3((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR(scCstj||j�S(sExecutes the call behavior.(R)R[R3(R'R*((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR+s(R�R�R�R(R+(((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR4s	t_MaskedUnaryOperationcBs/eZdZddd�Zd�Zd�ZRS(s�
    Defines masked version of unary operations, where invalid values are
    pre-masked.

    Parameters
    ----------
    mufunc : callable
        The function for which to define a masked version. Made available
        as ``_MaskedUnaryOperation.f``.
    fill : scalar, optional
        Filling value, default is 0.
    domain : class instance
        Domain for the function. Should be one of the ``_Domain*``
        classes. Default is None.

    icCsi||_||_||_t|dt|��|_t|dt|��|_|t|<|t|<dS(s� _MaskedUnaryOperation(aufunc, fill=0, domain=None)
            aufunc(fill) must be defined
            self(x) returns aufunc(x)
            with masked values where domain(x) is true or getmask(x) is true.
        R�R�N(	R�tfilltdomaintgetattrR�R�R�tufunc_domaintufunc_fills(R'tmufuncR6R7((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR(5s			
c	Os_t|�}|jdk	r�tj�}z/tjdddd�|j|||�}Wdtj|�Xtj|�}||j|�O}|t	|�O}n!|j|||�}t	|�}|j
s�|r�tS|S|tk	rytj
||d|�Wqtk
rqXnt|t�r0t|�}nt}|j|�}||_|j|�|S(sExecute the call behavior.R6tignoreR%NR�(RIR7R�R�tgeterrtseterrR�R)R#RJtndimRjR�tcopytoR�R�RRRR$t_update_from(	R'R
targstkwargstdterr_status_iniRtmtsubtype((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR+Cs8	
	
cCsdt|j�S(Ns1Masked version of %s. [Invalid values are masked](R�R�(R'((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt__str__qsN(R�R�R�R�R(R+RH(((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR5$s	.t_MaskedBinaryOperationcBsSeZdZddd�Zd�Zddd�Zd�Zdd�Zd�Z	RS(	sC
    Define masked version of binary operations, where invalid
    values are pre-masked.

    Parameters
    ----------
    mbfunc : function
        The function for which to define a masked version. Made available
        as ``_MaskedBinaryOperation.f``.
    domain : class instance
        Default domain for the function. Should be one of the ``_Domain*``
        classes. Default is None.
    fillx : scalar, optional
        Filling value for the first argument, default is 0.
    filly : scalar, optional
        Filling value for the second argument, default is 0.

    icCso||_||_||_t|dt|��|_t|dt|��|_dt|<||ft	|<dS(sjabfunc(fillx, filly) must be defined.
           abfunc(x, filly) = x for all x to enable reduce.
        R�R�N(
R�tfillxtfillyR8R�R�R�R�R9R:(R'tmbfuncRJRK((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR(�s			
cOs�t|dt�t|dt�}}t|�t|�}}|tkrz|tkr_t}	q�tjt|�|�}	n9|tkr�tj|t|��}	ntj||�}	tj�}
z2tj	dddd�|j
||||�}Wdtj	|
�X|js|	rtS|S|	j
�rgtj|dddd	|	�|j|jkrg||	|7}qgn|jt||��}|	|_t|t�r�t|t�r�|j|�q�|j|�nt|t�r�|j|�n|S(
sExecute the call behavior.RR6R<R%NitcastingtunsafeR�(RIRRJR�R)RdRKR�R=R>R�R?RjRR@R�RRR$R�RRA(R'R
R�RBRCtdatdbtmatmbRFRER((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR+�s>%			c	CsEt|t�rt|�}nt}t|�}t||j�}|jdkr�|jd�}|tk	r�t	|dd�}d|_q�n|tkr�|j
j||�j|�S|j|�}||_
|j
jt|�|d|p�|j�}tjj||�}|j|�}|jdkr7||_
|S|rAtS|S(s'Reduce `target` along the given `axis`.iR,R�i((i(R�RRRJRARKR�R�R�RfR�R�RR$RIR�R)RbR?Rj(	R'ttargettaxisR�ttclassRFttttrtmr((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��s.	*	c	Cs�t|�}t|�}|tkr9|tkr9t}n-t|�}t|�}tjj||�}|jrz|rztSt|�t|�}}|j	j||�}|tk	r�t
j||d|�n|jr�|j
t||��}||_n|S(sFReturn the function applied to the outer product of a and b.

        R�(RJR�RKR)RdR�R?RjRIR�R�R@R�RRR$(	R'R
R�RQRRRFRORPRD((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��s"		cCsRt|t�rt|�}nt}t||j�}|jj||�j|�S(sSAccumulate `target` along `axis` after filling with y fill
        value.

        (R�RRRARKR�t
accumulateR(R'RSRTRURV((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRY�s
cCsdt|j�S(NsMasked version of (R�R�(R'((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRHsN(
R�R�R�R(R+R�R�R�RYRH(((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRIvs	0	t_DomainedBinaryOperationcBs/eZdZddd�Zd�Zd�ZRS(sH
    Define binary operations that have a domain, like divide.

    They have no reduce, outer or accumulate.

    Parameters
    ----------
    mbfunc : function
        The function for which to define a masked version. Made available
        as ``_DomainedBinaryOperation.f``.
    domain : class instance
        Default domain for the function. Should be one of the ``_Domain*``
        classes.
    fillx : scalar, optional
        Filling value for the first argument, default is 0.
    filly : scalar, optional
        Filling value for the second argument, default is 0.

    icCsx||_||_||_||_t|dt|��|_t|dt|��|_|t|<||ft	|<dS(sjabfunc(fillx, filly) must be defined.
           abfunc(x, filly) = x for all x to enable reduce.
        R�R�N(
R�R7RJRKR8R�R�R�R9R:(R'tdbfuncR7RJRK((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR(s				
c
Os�t|dt�t|dt�}}t|�t|�}}tj�}	z2tjdddd�|j||||�}
Wdtj|	�Xtj|
�}||O}||O}t	j
|jd�}|dk	r�|t|||�t
�O}n|js|rtS|
Sntj|
dddd	|�|
||7}
|
jt||��}
||
_t|t�r�t|t�r�|
j|�q�|
j|�nt|t�r�|
j|�n|
S(
sExecute the call behavior.RR6R<R%NiRMRNR�(RIRRJR�R=R>R�R)R#R9R�R�RAR"R?RjR@RRR$R�RRA(
R'R
R�RBRCRORPRQRRRERRFR7((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR+)s8%

		cCsdt|j�S(NsMasked version of (R�R�(R'((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRHQs(R�R�R�R(R+RH(((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRZs
	(gg�?gz�����8g�gV瞯�<icCs�|jryg}xc|jD]X}|j|}t|�dkrQ|d|f}n|j|t|d|�f�qW|S|jr�t|j�}||d<t|�S|SdS(s2Private function allowing recursion in make_descr.ii����iN(R�RR�R�t_recursive_make_descrR�R�R�(tdatatypetnewtypeR�R�tfieldtmdescr((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR\�s	
$	

cCs=t|tj�s$tj|�}ntjt|tj��S(s�
    Construct a dtype description list from a given dtype.

    Returns a new dtype object, with the type of all fields in `ndtype` to a
    boolean type. Field names are not altered.

    Parameters
    ----------
    ndtype : dtype
        The dtype to convert.

    Returns
    -------
    result : dtype
        A dtype that looks like `ndtype`, the type of all fields is boolean.

    Examples
    --------
    >>> import numpy.ma as ma
    >>> dtype = np.dtype({'names':['foo', 'bar'],
                          'formats':[np.float32, np.int]})
    >>> dtype
    dtype([('foo', '<f4'), ('bar', '<i4')])
    >>> ma.make_mask_descr(dtype)
    dtype([('foo', '|b1'), ('bar', '|b1')])
    >>> ma.make_mask_descr(np.float32)
    <type 'numpy.bool_'>

    (R�R�R�R\tbool(R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRg�scCst|dt�S(s1
    Return the mask of a masked array, or nomask.

    Return the mask of `a` as an ndarray if `a` is a `MaskedArray` and the
    mask is not `nomask`, else return `nomask`. To guarantee a full array
    of booleans of the same shape as a, use `getmaskarray`.

    Parameters
    ----------
    a : array_like
        Input `MaskedArray` for which the mask is required.

    See Also
    --------
    getdata : Return the data of a masked array as an ndarray.
    getmaskarray : Return the mask of a masked array, or full array of False.

    Examples
    --------

    >>> import numpy.ma as ma
    >>> a = ma.masked_equal([[1,2],[3,4]], 2)
    >>> a
    masked_array(data =
     [[1 --]
     [3 4]],
          mask =
     [[False  True]
     [False False]],
          fill_value=999999)
    >>> ma.getmask(a)
    array([[False,  True],
           [False, False]], dtype=bool)

    Equivalently use the `MaskedArray` `mask` attribute.

    >>> a.mask
    array([[False,  True],
           [False, False]], dtype=bool)

    Result when mask == `nomask`

    >>> b = ma.masked_array([[1,2],[3,4]])
    >>> b
    masked_array(data =
     [[1 2]
     [3 4]],
          mask =
     False,
          fill_value=999999)
    >>> ma.nomask
    False
    >>> ma.getmask(b) == ma.nomask
    True
    >>> b.mask == ma.nomask
    True

    R$(R8R�(R
((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRJ�s;cCs@t|�}|tkr<ttj|�t|�j�}n|S(s�
    Return the mask of a masked array, or full boolean array of False.

    Return the mask of `arr` as an ndarray if `arr` is a `MaskedArray` and
    the mask is not `nomask`, else return a full boolean array of False of
    the same shape as `arr`.

    Parameters
    ----------
    arr : array_like
        Input `MaskedArray` for which the mask is required.

    See Also
    --------
    getmask : Return the mask of a masked array, or nomask.
    getdata : Return the data of a masked array as an ndarray.

    Examples
    --------

    >>> import numpy.ma as ma
    >>> a = ma.masked_equal([[1,2],[3,4]], 2)
    >>> a
    masked_array(data =
     [[1 --]
     [3 4]],
          mask =
     [[False  True]
     [False False]],
          fill_value=999999)
    >>> ma.getmaskarray(a)
    array([[False,  True],
           [False, False]], dtype=bool)

    Result when mask == ``nomask``

    >>> b = ma.masked_array([[1,2],[3,4]])
    >>> b
    masked_array(data =
     [[1 2]
     [3 4]],
          mask =
     False,
          fill_value=999999)
    >>> >ma.getmaskarray(b)
    array([[False, False],
           [False, False]], dtype=bool)

    (RJR�RhR�R�RIR�(RR!((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRKs2$cCs-y|jjtkSWntk
r(tSXdS(s2
    Return True if m is a valid, standard mask.

    This function does not check the contents of the input, only that the
    type is MaskType. In particular, this function returns False if the
    mask has a flexible dtype.

    Parameters
    ----------
    m : array_like
        Array to test.

    Returns
    -------
    result : bool
        True if `m.dtype.type` is MaskType, False otherwise.

    See Also
    --------
    isMaskedArray : Test whether input is an instance of MaskedArray.

    Examples
    --------
    >>> import numpy.ma as ma
    >>> m = ma.masked_equal([0, 1, 0, 2, 3], 0)
    >>> m
    masked_array(data = [-- 1 -- 2 3],
          mask = [ True False  True False False],
          fill_value=999999)
    >>> ma.is_mask(m)
    False
    >>> ma.is_mask(m.mask)
    True

    Input must be an ndarray (or have similar attributes)
    for it to be considered a valid mask.

    >>> m = [False, True, False]
    >>> ma.is_mask(m)
    False
    >>> m = np.array([False, True, False])
    >>> m
    array([False,  True, False], dtype=bool)
    >>> ma.is_mask(m)
    True

    Arrays with complex dtypes don't return True.

    >>> dtype = np.dtype({'names':['monty', 'pithon'],
                          'formats':[np.bool, np.bool]})
    >>> dtype
    dtype([('monty', '|b1'), ('pithon', '|b1')])
    >>> m = np.array([(True, False), (False, True), (True, False)],
                     dtype=dtype)
    >>> m
    array([(True, False), (False, True), (True, False)],
          dtype=[('monty', '|b1'), ('pithon', '|b1')])
    >>> ma.is_mask(m)
    False

    N(R�RRRR(RF((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRWQs>
cCs�|tkrtSt|t�r�t|t�}t|�}|j|krg|r^|j�}q�|}q�tj	|d|d|�}ntj	t|t�dt
�}|r�|jjr�|j�r�tS|SdS(s\
    Create a boolean mask from an array.

    Return `m` as a boolean mask, creating a copy if necessary or requested.
    The function can accept any sequence that is convertible to integers,
    or ``nomask``.  Does not require that contents must be 0s and 1s, values
    of 0 are interepreted as False, everything else as True.

    Parameters
    ----------
    m : array_like
        Potential mask.
    copy : bool, optional
        Whether to return a copy of `m` (True) or `m` itself (False).
    shrink : bool, optional
        Whether to shrink `m` to ``nomask`` if all its values are False.
    dtype : dtype, optional
        Data-type of the output mask. By default, the output mask has
        a dtype of MaskType (bool). If the dtype is flexible, each field
        has a boolean dtype.

    Returns
    -------
    result : ndarray
        A boolean mask derived from `m`.

    Examples
    --------
    >>> import numpy.ma as ma
    >>> m = [True, False, True, True]
    >>> ma.make_mask(m)
    array([ True, False,  True,  True], dtype=bool)
    >>> m = [1, 0, 1, 1]
    >>> ma.make_mask(m)
    array([ True, False,  True,  True], dtype=bool)
    >>> m = [1, 0, 2, -3]
    >>> ma.make_mask(m)
    array([ True, False,  True,  True], dtype=bool)

    Effect of the `shrink` parameter.

    >>> m = np.zeros(4)
    >>> m
    array([ 0.,  0.,  0.,  0.])
    >>> ma.make_mask(m)
    False
    >>> ma.make_mask(m, shrink=False)
    array([False, False, False, False], dtype=bool)

    Using a flexible `dtype`.

    >>> m = [1, 0, 1, 1]
    >>> n = [0, 1, 0, 0]
    >>> arr = []
    >>> for man, mouse in zip(m, n):
    ...     arr.append((man, mouse))
    >>> arr
    [(1, 0), (0, 1), (1, 0), (1, 0)]
    >>> dtype = np.dtype({'names':['man', 'mouse'],
                          'formats':[np.int, np.int]})
    >>> arr = np.array(arr, dtype=dtype)
    >>> arr
    array([(1, 0), (0, 1), (1, 0), (1, 0)],
          dtype=[('man', '<i4'), ('mouse', '<i4')])
    >>> ma.make_mask(arr, dtype=dtype)
    array([(True, False), (False, True), (True, False), (True, False)],
          dtype=[('man', '|b1'), ('mouse', '|b1')])

    R�R,N(
R�R�R�RAR"RgR�R,R�RRR�R(RFR,tshrinkR�R((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRf�sF	 cCsC|dkr$tj|dt�}ntj|dt|��}|S(s/
    Return a boolean mask of the given shape, filled with False.

    This function returns a boolean ndarray with all entries False, that can
    be used in common mask manipulations. If a complex dtype is specified, the
    type of each field is converted to a boolean type.

    Parameters
    ----------
    newshape : tuple
        A tuple indicating the shape of the mask.
    dtype: {None, dtype}, optional
        If None, use a MaskType instance. Otherwise, use a new datatype with
        the same fields as `dtype`, converted to boolean types.

    Returns
    -------
    result : ndarray
        An ndarray of appropriate shape and dtype, filled with False.

    See Also
    --------
    make_mask : Create a boolean mask from an array.
    make_mask_descr : Construct a dtype description list from a given dtype.

    Examples
    --------
    >>> import numpy.ma as ma
    >>> ma.make_mask_none((3,))
    array([False, False, False], dtype=bool)

    Defining a more complex dtype.

    >>> dtype = np.dtype({'names':['foo', 'bar'],
                          'formats':[np.float32, np.int]})
    >>> dtype
    dtype([('foo', '<f4'), ('bar', '<i4')])
    >>> ma.make_mask_none((3,), dtype=dtype)
    array([(False, False), (False, False), (False, False)],
          dtype=[('foo', '|b1'), ('bar', '|b1')])

    R�N(R�R�R�RRg(tnewshapeR�R((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRh�s+c
sO�fd��|tks'|tkrUt|dt�}t|d|d|d|�S|tksm|tkr�t|dt�}t|d|d|d|�S||kr�t|�r�|St|dd�t|dd�}}||krtd||f��n|jr-t	j
|�}�|||�|Sttj||�d|d|�S(s�
    Combine two masks with the ``logical_or`` operator.

    The result may be a view on `m1` or `m2` if the other is `nomask`
    (i.e. False).

    Parameters
    ----------
    m1, m2 : array_like
        Input masks.
    copy : bool, optional
        If copy is False and one of the inputs is `nomask`, return a view
        of the other input mask. Defaults to False.
    shrink : bool, optional
        Whether to shrink the output to `nomask` if all its values are
        False. Defaults to True.

    Returns
    -------
    mask : output mask
        The result masks values that are masked in either `m1` or `m2`.

    Raises
    ------
    ValueError
        If `m1` and `m2` have different flexible dtypes.

    Examples
    --------
    >>> m1 = np.ma.make_mask([0, 1, 1, 0])
    >>> m2 = np.ma.make_mask([1, 0, 0, 0])
    >>> np.ma.mask_or(m1, m2)
    array([ True,  True,  True, False], dtype=bool)

    csm|jj}xZ|D]R}||}|jjrJ�|||||�qtj|||||�qWdS(N(R�R�R)Rd(tm1tm2tnewmaskR�R�tcurrent1(t_recursive_mask_or(s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRhGs

R�R,RbsIncompatible dtypes '%s'<>'%s'N(
R�RR8RRfRWR�RR�R�R:R)Rd(RdReR,RbR�tdtype1tdtype2Rf((Rhs3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRi#s"$
%	cs_d�}�fd��tj|�}�||��}tjg|D]}|^qFdt�S(sG
    Returns a completely flattened version of the mask, where nested fields
    are collapsed.

    Parameters
    ----------
    mask : array_like
        Input array, which will be interpreted as booleans.

    Returns
    -------
    flattened_mask : ndarray of bools
        The flattened input.

    Examples
    --------
    >>> mask = np.array([0, 0, 1], dtype=np.bool)
    >>> flatten_mask(mask)
    array([False, False,  True], dtype=bool)

    >>> mask = np.array([(0, 0), (0, 1)], dtype=[('a', bool), ('b', bool)])
    >>> flatten_mask(mask)
    array([False, False, False,  True], dtype=bool)

    >>> mdtype = [('a', bool), ('b', [('ba', bool), ('bb', bool)])]
    >>> mask = np.array([(0, (0, 0)), (0, (0, 1))], dtype=mdtype)
    >>> flatten_mask(mask)
    array([False, False, False, False, False,  True], dtype=bool)

    cSs;|jj}|r3g|D]}t||�^qS|SdS(sCFlatten the mask and returns a (maybe nested) sequence of booleans.N(R�R�R?(R!tmnamesR�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt	_flatmask�s!c3seyHxA|D]9}t|d�r>x!�|�D]}|Vq,Wq
|Vq
WWntk
r`|VnXdS(s.Generates a flattened version of the sequence.t__iter__N(R�R�(tsequencetelementR�(t
_flatsequence(s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRp�s


R�(R�RRRa(R!Rlt	flattenedR
((Rps3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR?cs
 	cCs |tk	r|jd|�StS(s:Check whether there are masked values along the given axisRT(R�R(R!RT((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt_check_mask_axis�scCs�t|�}tj|d|dt�}|j|j}}|re||kretd||f��nt|d�r�t||j�}t	|�}nt
}|j|�}||_|S(st
    Mask an array where a condition is met.

    Return `a` as an array masked where `condition` is True.
    Any masked values of `a` or `condition` are also masked in the output.

    Parameters
    ----------
    condition : array_like
        Masking condition.  When `condition` tests floating point values for
        equality, consider using ``masked_values`` instead.
    a : array_like
        Array to mask.
    copy : bool
        If True (default) make a copy of `a` in the result.  If False modify
        `a` in place and return a view.

    Returns
    -------
    result : MaskedArray
        The result of masking `a` where `condition` is True.

    See Also
    --------
    masked_values : Mask using floating point equality.
    masked_equal : Mask where equal to a given value.
    masked_not_equal : Mask where `not` equal to a given value.
    masked_less_equal : Mask where less than or equal to a given value.
    masked_greater_equal : Mask where greater than or equal to a given value.
    masked_less : Mask where less than a given value.
    masked_greater : Mask where greater than a given value.
    masked_inside : Mask inside a given interval.
    masked_outside : Mask outside a given interval.
    masked_invalid : Mask invalid values (NaNs or infs).

    Examples
    --------
    >>> import numpy.ma as ma
    >>> a = np.arange(4)
    >>> a
    array([0, 1, 2, 3])
    >>> ma.masked_where(a <= 2, a)
    masked_array(data = [-- -- -- 3],
          mask = [ True  True  True False],
          fill_value=999999)

    Mask array `b` conditional on `a`.

    >>> b = ['a', 'b', 'c', 'd']
    >>> ma.masked_where(a == 2, b)
    masked_array(data = [a b -- d],
          mask = [False False  True False],
          fill_value=N/A)

    Effect of the `copy` argument.

    >>> c = ma.masked_where(a <= 2, a)
    >>> c
    masked_array(data = [-- -- -- 3],
          mask = [ True  True  True False],
          fill_value=999999)
    >>> c[0] = 99
    >>> c
    masked_array(data = [99 -- -- 3],
          mask = [False  True  True False],
          fill_value=999999)
    >>> a
    array([0, 1, 2, 3])
    >>> c = ma.masked_where(a <= 2, a, copy=False)
    >>> c[0] = 99
    >>> c
    masked_array(data = [99 -- -- 3],
          mask = [False  True  True False],
          fill_value=999999)
    >>> a
    array([99,  1,  2,  3])

    When `condition` or `a` contain masked values.

    >>> a = np.arange(4)
    >>> a = ma.masked_where(a == 2, a)
    >>> a
    masked_array(data = [0 1 -- 3],
          mask = [False False  True False],
          fill_value=999999)
    >>> b = np.arange(4)
    >>> b = ma.masked_where(b == 0, b)
    >>> b
    masked_array(data = [-- 1 2 3],
          mask = [ True False False False],
          fill_value=999999)
    >>> ma.masked_where(a == 3, b)
    masked_array(data = [-- 1 -- --],
          mask = [ True False  True  True],
          fill_value=999999)

    R,RsFInconsistant shape between the condition and the input (got %s and %s)R$(RfR�RR"R�t
IndexErrorR�RiR$RRR(t	conditionR
R,tcondtcshapetashapeRR((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRy�sc	cCstt||�|d|�S(s�
    Mask an array where greater than a given value.

    This function is a shortcut to ``masked_where``, with
    `condition` = (x > value).

    See Also
    --------
    masked_where : Mask where a condition is met.

    Examples
    --------
    >>> import numpy.ma as ma
    >>> a = np.arange(4)
    >>> a
    array([0, 1, 2, 3])
    >>> ma.masked_greater(a, 2)
    masked_array(data = [0 1 2 --],
          mask = [False False False  True],
          fill_value=999999)

    R,(RyRL(R*tvalueR,((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRmscCstt||�|d|�S(s�
    Mask an array where greater than or equal to a given value.

    This function is a shortcut to ``masked_where``, with
    `condition` = (x >= value).

    See Also
    --------
    masked_where : Mask where a condition is met.

    Examples
    --------
    >>> import numpy.ma as ma
    >>> a = np.arange(4)
    >>> a
    array([0, 1, 2, 3])
    >>> ma.masked_greater_equal(a, 2)
    masked_array(data = [0 1 -- --],
          mask = [False False  True  True],
          fill_value=999999)

    R,(RyRM(R*RxR,((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRn5scCstt||�|d|�S(s�
    Mask an array where less than a given value.

    This function is a shortcut to ``masked_where``, with
    `condition` = (x < value).

    See Also
    --------
    masked_where : Mask where a condition is met.

    Examples
    --------
    >>> import numpy.ma as ma
    >>> a = np.arange(4)
    >>> a
    array([0, 1, 2, 3])
    >>> ma.masked_less(a, 2)
    masked_array(data = [-- -- 2 3],
          mask = [ True  True False False],
          fill_value=999999)

    R,(RyR[(R*RxR,((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRqOscCstt||�|d|�S(s�
    Mask an array where less than or equal to a given value.

    This function is a shortcut to ``masked_where``, with
    `condition` = (x <= value).

    See Also
    --------
    masked_where : Mask where a condition is met.

    Examples
    --------
    >>> import numpy.ma as ma
    >>> a = np.arange(4)
    >>> a
    array([0, 1, 2, 3])
    >>> ma.masked_less_equal(a, 2)
    masked_array(data = [-- -- -- 3],
          mask = [ True  True  True False],
          fill_value=999999)

    R,(RyR\(R*RxR,((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRriscCstt||�|d|�S(s�
    Mask an array where `not` equal to a given value.

    This function is a shortcut to ``masked_where``, with
    `condition` = (x != value).

    See Also
    --------
    masked_where : Mask where a condition is met.

    Examples
    --------
    >>> import numpy.ma as ma
    >>> a = np.arange(4)
    >>> a
    array([0, 1, 2, 3])
    >>> ma.masked_not_equal(a, 2)
    masked_array(data = [-- -- 2 --],
          mask = [ True  True False  True],
          fill_value=999999)

    R,(RyR�(R*RxR,((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRs�scCs+tt||�|d|�}||_|S(sa
    Mask an array where equal to a given value.

    This function is a shortcut to ``masked_where``, with
    `condition` = (x == value).  For floating point arrays,
    consider using ``masked_values(x, value)``.

    See Also
    --------
    masked_where : Mask where a condition is met.
    masked_values : Mask using floating point equality.

    Examples
    --------
    >>> import numpy.ma as ma
    >>> a = np.arange(4)
    >>> a
    array([0, 1, 2, 3])
    >>> ma.masked_equal(a, 2)
    masked_array(data = [0 1 -- 3],
          mask = [False False  True False],
          fill_value=999999)

    R,(RyR;R	(R*RxR,toutput((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRl�s	cCsQ||kr||}}nt|�}||k||k@}t||d|�S(sw
    Mask an array inside a given interval.

    Shortcut to ``masked_where``, where `condition` is True for `x` inside
    the interval [v1,v2] (v1 <= x <= v2).  The boundaries `v1` and `v2`
    can be given in either order.

    See Also
    --------
    masked_where : Mask where a condition is met.

    Notes
    -----
    The array `x` is prefilled with its filling value.

    Examples
    --------
    >>> import numpy.ma as ma
    >>> x = [0.31, 1.2, 0.01, 0.2, -0.4, -1.1]
    >>> ma.masked_inside(x, -0.3, 0.3)
    masked_array(data = [0.31 1.2 -- -- -0.4 -1.1],
          mask = [False False  True  True False False],
          fill_value=1e+20)

    The order of `v1` and `v2` doesn't matter.

    >>> ma.masked_inside(x, 0.3, -0.3)
    masked_array(data = [0.31 1.2 -- -- -0.4 -1.1],
          mask = [False False  True  True False False],
          fill_value=1e+20)

    R,(RARy(R*tv1tv2R,txfRt((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRo�s
!cCsQ||kr||}}nt|�}||k||kB}t||d|�S(st
    Mask an array outside a given interval.

    Shortcut to ``masked_where``, where `condition` is True for `x` outside
    the interval [v1,v2] (x < v1)|(x > v2).
    The boundaries `v1` and `v2` can be given in either order.

    See Also
    --------
    masked_where : Mask where a condition is met.

    Notes
    -----
    The array `x` is prefilled with its filling value.

    Examples
    --------
    >>> import numpy.ma as ma
    >>> x = [0.31, 1.2, 0.01, 0.2, -0.4, -1.1]
    >>> ma.masked_outside(x, -0.3, 0.3)
    masked_array(data = [-- -- 0.01 0.2 -- --],
          mask = [ True  True False False  True  True],
          fill_value=1e+20)

    The order of `v1` and `v2` doesn't matter.

    >>> ma.masked_outside(x, 0.3, -0.3)
    masked_array(data = [-- -- 0.01 0.2 -- --],
          mask = [ True  True False False  True  True],
          fill_value=1e+20)

    R,(RARy(R*RzR{R,R|Rt((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRu�s
!cCs�t|�r-tj|j|�}|j}n!tjtj|�|�}t}t|t	|d|��}t
|d|d|d|�S(s�
    Mask the array `x` where the data are exactly equal to value.

    This function is similar to `masked_values`, but only suitable
    for object arrays: for floating point, use `masked_values` instead.

    Parameters
    ----------
    x : array_like
        Array to mask
    value : object
        Comparison value
    copy : {True, False}, optional
        Whether to return a copy of `x`.
    shrink : {True, False}, optional
        Whether to collapse a mask full of False to nomask

    Returns
    -------
    result : MaskedArray
        The result of masking `x` where equal to `value`.

    See Also
    --------
    masked_where : Mask where a condition is met.
    masked_equal : Mask where equal to a given value (integers).
    masked_values : Mask using floating point equality.

    Examples
    --------
    >>> import numpy.ma as ma
    >>> food = np.array(['green_eggs', 'ham'], dtype=object)
    >>> # don't eat spoiled food
    >>> eat = ma.masked_object(food, 'green_eggs')
    >>> print eat
    [-- ham]
    >>> # plain ol` ham is boring
    >>> fresh_food = np.array(['cheese', 'ham', 'pineapple'], dtype=object)
    >>> eat = ma.masked_object(fresh_food, 'green_eggs')
    >>> print eat
    [cheese ham pineapple]

    Note that `mask` is set to ``nomask`` if possible.

    >>> eat
    masked_array(data = [cheese ham pineapple],
          mask = False,
          fill_value=?)

    RbR!R,R	(RVR)R;RR$R�RR�RiRfRk(R*RxR,RbRtR!((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRts3g�h㈵��>g:�0�yE>c
Cs�tj}t||�}t|jjtj�rotj|||�||||��}t	|dt
�}	ntj||�}t
}	t|	t
|d|��}	t|d|	d|d|�S(s�
    Mask using floating point equality.

    Return a MaskedArray, masked where the data in array `x` are approximately
    equal to `value`, i.e. where the following condition is True

    (abs(x - value) <= atol+rtol*abs(value))

    The fill_value is set to `value` and the mask is set to ``nomask`` if
    possible.  For integers, consider using ``masked_equal``.

    Parameters
    ----------
    x : array_like
        Array to mask.
    value : float
        Masking value.
    rtol : float, optional
        Tolerance parameter.
    atol : float, optional
        Tolerance parameter (1e-8).
    copy : bool, optional
        Whether to return a copy of `x`.
    shrink : bool, optional
        Whether to collapse a mask full of False to ``nomask``.

    Returns
    -------
    result : MaskedArray
        The result of masking `x` where approximately equal to `value`.

    See Also
    --------
    masked_where : Mask where a condition is met.
    masked_equal : Mask where equal to a given value (integers).

    Examples
    --------
    >>> import numpy.ma as ma
    >>> x = np.array([1, 1.1, 2, 1.1, 3])
    >>> ma.masked_values(x, 1.1)
    masked_array(data = [1.0 -- 2.0 -- 3.0],
          mask = [False  True False  True False],
          fill_value=1.1)

    Note that `mask` is set to ``nomask`` if possible.

    >>> ma.masked_values(x, 1.5)
    masked_array(data = [ 1.   1.1  2.   1.1  3. ],
          mask = False,
          fill_value=1.5)

    For integers, the fill value will be different in general to the
    result of ``masked_equal``.

    >>> x = np.arange(5)
    >>> x
    array([0, 1, 2, 3, 4])
    >>> ma.masked_values(x, 2)
    masked_array(data = [0 1 -- 3 4],
          mask = [False False  True False False],
          fill_value=2)
    >>> ma.masked_equal(x, 2)
    masked_array(data = [0 1 -- 3 4],
          mask = [False False  True False False],
          fill_value=999999)

    R$RbR!R,R	(R)RRARR�RR�tfloatingR\R8R�R;RiRfRk(
R*RxtrtoltatolR,RbtmabstxnewRtR!((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRxMsE	*cCs�tj|d|dt�}t|dd�}|dk	rwtjt|��}|tk	rh||O}nt|�}ntj|�}t	}|j
|�}||_|S(s�
    Mask an array where invalid values occur (NaNs or infs).

    This function is a shortcut to ``masked_where``, with
    `condition` = ~(np.isfinite(a)). Any pre-existing mask is conserved.
    Only applies to arrays with a dtype where NaNs or infs make sense
    (i.e. floating point types), but accepts any array_like object.

    See Also
    --------
    masked_where : Mask where a condition is met.

    Examples
    --------
    >>> import numpy.ma as ma
    >>> a = np.arange(5, dtype=np.float)
    >>> a[2] = np.NaN
    >>> a[3] = np.PINF
    >>> a
    array([  0.,   1.,  NaN,  Inf,   4.])
    >>> ma.masked_invalid(a)
    masked_array(data = [0.0 1.0 -- -- 4.0],
          mask = [False False  True  True False],
          fill_value=1e+20)

    R,RR$N(R�RR"R8R�R#RIR�RRRR$(R
R,R!RtRR((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRp�s
	t_MaskedPrintOptioncBsMeZdZd�Zd�Zd�Zd�Zdd�Zd�ZeZ	RS(sN
    Handle the string used to represent missing data in a masked array.

    cCs||_t|_dS(s&Create the masked_print_option object.N(t_displayR"t_enabled(R'tdisplay((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR(�s	cCs|jS(s.Display the string to print for masked values.(R�(R'((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��scCs
||_dS(s*Set the string to print for masked values.N(R�(R'ts((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pytset_display�scCs|jS(s(Is the use of the display value enabled?(R�(R'((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pytenabled�sicCs
||_dS(s$Set the enabling shrink to `shrink`.N(R�(R'Rb((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pytenable�scCs
t|j�S(N(R�R�(R'((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRH�s(
R�R�R�R(R�R�R�R�RHt__repr__(((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��s					s--cCsk|jj}xX|D]P}||||}}|jjrMt|||�qtj||d|�qWdS(se
    Puts printoptions in result where mask is True.
    Private function allowing for recursion
    R�N(R�R�t_recursive_printoptionR�R@(RR!tprintoptR�R�tcurdatatcurmask((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��s
tlong_stdsemasked_%(name)s(data =
 %(data)s,
       %(nlen)s mask =
 %(mask)s,
 %(nlen)s fill_value = %(fill)s)
t	short_stdscmasked_%(name)s(data = %(data)s,
       %(nlen)s mask = %(mask)s,
%(nlen)s  fill_value = %(fill)s)
tlong_flxs�masked_%(name)s(data =
 %(data)s,
       %(nlen)s mask =
 %(mask)s,
%(nlen)s  fill_value = %(fill)s,
      %(nlen)s dtype = %(dtype)s)
t	short_flxs�masked_%(name)s(data = %(data)s,
%(nlen)s        mask = %(mask)s,
%(nlen)s  fill_value = %(fill)s,
%(nlen)s       dtype = %(dtype)s)
cCsp|jj}x]|D]U}||}|jjrJt|||||�qtj|||d||�qWdS(sF
    Recursively fill `a` with `fill_value`.
    Private function
    R�N(R�R�t_recursive_filledR�R@(R
R!R	R�R�tcurrent((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�	s

csC�fd��tj|�}|j}|j�}t|t�r�tjg|jD]}t�|j	���^qR�}|j
t�}tjgt|�D]}t�|j	���^q��|_n4tjg|D]}t�|j	���^q��}t
|�dkr?t|j�}||d<t�|��|_n|S(s4
    Flatten a structured array.

    The data type of the output is chosen such that it can represent all of the
    (nested) fields.

    Parameters
    ----------
    a : structured array

    Returns
    -------
    output : masked array or ndarray
        A flattened masked array if the input is a masked array, otherwise a
        standard ndarray.

    Examples
    --------
    >>> ndtype = [('a', int), ('b', float)]
    >>> a = np.array([(1, 1), (2, 2)], dtype=ndtype)
    >>> flatten_structured_array(a)
    array([[1., 1.],
           [2., 2.]])

    c3sNxGt|�D]9}t|d�rAx!�|�D]}|Vq/Wq
|Vq
WdS(s(Flattens a compound of nested iterables.RmN(titerR�(titerabletelmR�(tflatten_sequence(s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�F	s
ii(R�R R�R�R�RRRR�R�RRKR$R�R�(R
tinishapeRDtoutRc((R�s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRE+	s		7	74
t_arraymethodcBs8eZdZed�Zd�Zdd�Zd�ZRS(s
    Define a wrapper for basic array methods.

    Upon call, returns a masked array, where the new ``_data`` array is
    the output of the corresponding method called on the original
    ``_data``.

    If `onmask` is True, the new mask is the output of the method called
    on the initial mask. Otherwise, the new mask is just a reference
    to the initial mask.

    Attributes
    ----------
    _onmask : bool
        Holds the `onmask` parameter.
    obj : object
        The object calling `_arraymethod`.

    Parameters
    ----------
    funcname : str
        Name of the function to apply on data.
    onmask : bool
        Whether the mask must be processed also (True) or left
        alone (False). Default is True. Make available as `_onmask`
        attribute.

    cCs.||_||_d|_|j�|_dS(N(R�t_onmaskR�R�tgetdocR�(R'tfuncnametonmask((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR(~	s			cCsAtt|jd�p'tt|jd�}|dk	r=|jSdS(s<Return the doc of the function (from the doc of the method).N(R8R�R�R�R�R�(R'tmethdoc((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��	scCs
||_|S(N(R�(R'R�tobjtype((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt__get__�	s	c	Os|j}|j}|dkr<t|�}|jd�}n|j}|j}t|�}t||�||�j	|�}|j
|�|jr�|js�|j
|�q|tk	r|j
t||�||��qn&|jr|jjr|j�rtS|S(Ni(R�R�R�R�tpopRR$RR8RRAR?R�t__setmask__R�R�R�RRj(	R'RBtparamst
methodnametinstanceR R!RR((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR+�	s$				!
		%"N(	R�R�R�R"R(R�R�R�R+(((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�a	s
	tMaskedIteratorcBs;eZdZd�Zd�Zd�Zd�Zd�ZRS(s�
    Flat iterator object to iterate over masked arrays.

    A `MaskedIterator` iterator is returned by ``x.flat`` for any masked array
    `x`. It allows iterating over the array as if it were a 1-D array,
    either in a for-loop or by calling its `next` method.

    Iteration is done in C-contiguous style, with the last index varying the
    fastest. The iterator can also be indexed using basic slicing or
    advanced indexing.

    See Also
    --------
    MaskedArray.flat : Return a flat iterator over an array.
    MaskedArray.flatten : Returns a flattened copy of an array.

    Notes
    -----
    `MaskedIterator` is not exported by the `ma` module. Instead of
    instantiating a `MaskedIterator` directly, use `MaskedArray.flat`.

    Examples
    --------
    >>> x = np.ma.array(arange(6).reshape(2, 3))
    >>> fl = x.flat
    >>> type(fl)
    <class 'numpy.ma.core.MaskedIterator'>
    >>> for item in fl:
    ...     print item
    ...
    0
    1
    2
    3
    4
    5

    Extracting more than a single element b indexing the `MaskedIterator`
    returns a masked array:

    >>> fl[2:4]
    masked_array(data = [2 3],
                 mask = False,
           fill_value = 999999)

    cCsF||_|jj|_|jtkr3d|_n|jj|_dS(N(RQRtflattdataiterR$R�R�tmaskiter(R'RQ((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR(�	s
	cCs|S(N((R'((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRm�	scCsa|jj|�jt|j��}|jdk	r]|jj|�}|j|_||_n|S(N(	R�t__getitem__RRRQR�R�R�R$(R'tindxRR$((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��	s$cCs<t|�|j|<|jdk	r8t|�|j|<ndS(N(RIR�R�R�RK(R'tindexRx((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt__setitem__�	scCs:|jj�}|jdk	r6|jj�r6t}n|S(s@
        Return the next value, or raise StopIteration.

        Examples
        --------
        >>> x = np.ma.array([3, 2], mask=[0, 1])
        >>> fl = x.flat
        >>> fl.next()
        3
        >>> fl.next()
        masked_array(data = --,
                     mask = True,
               fill_value = 1e+20)
        >>> fl.next()
        Traceback (most recent call last):
          File "<stdin>", line 1, in <module>
          File "/home/ralf/python/numpy/numpy/ma/core.py", line 2243, in next
            d = self.dataiter.next()
        StopIteration

        N(R�tnextR�R�Rj(R'RD((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��	s	(R�R�R�R(RmR�R�R�(((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��	s.						cBs>eZdZdZeZeZeZ	d}ed}eedd}ed}ed�
Zd�Z
d�Zd}d�Zd}d}d�Zejje_d�Zd	�Zd
�Zd�Zd�Zed
�ZeZd�Zedededd�Zd�Zd�Zede�Zd�Zd�Zedd�dd�Z d�Z!edd�dd�Z"d�Z#edd�dd�Z$d�Z%ede%�Z&ede%�Z'd �Z(d!�Z)ede(de)dd"�Z*d#�Z+d}d$�Z,ede+de,dd%�Z-d}d&�Z.d'�Z/d}d}d(�Z0d)�Z1d*�Z2d+�Z3d,�Z4d-�Z5d.�Z6d/�Z7d0�Z8d1�Z9d2�Z:d3�Z;d4�Z<d5�Z=d6�Z>d7�Z?d8�Z@d9�ZAd:�ZBd;�ZCd<�ZDd=�ZEd>�ZFd?�ZGd@�ZHdA�ZIdB�ZJdC�ZKedeKddD�ZLdE�ZMedeMddF�ZNd}dG�ZOePdH�ZQdI�ZRePdJ�ZSdK�ZTeedL�ZUdMdN�ZVdO�ZWdP�ZXd}d}dQ�ZYd}d}dR�ZZdS�Z[dddTd}d}dU�Z\ej\je\_d}d}d}dV�Z]d}d}d}dW�Z^d}d}d}dX�Z_e_Z`d}d}d}dY�Zad}d}d}dZ�Zbd}d}d[�Zcd}d}d}dd\�Zdeejdjed_d}d}d}dd]�Zfeejfjef_dd}d^�Zgejgjeg_d}d_d}d}d`�Zhd}d}d}da�Zid}d}d}db�Zjdcd_d}ed}dd�Zkd}d}d}de�Zld}df�Zmd}d}d}dg�Znd}d}d}dh�Zod}d}dMdi�ZpePdj�ZqePdk�ZrePdl�Zseddm��ZtePdn�ZuePdodpe�ZvePdj�ZqePdq�Zwd}dr�Zxd}dsdt�Zydudvdw�Zzdx�Z{e{Z|dy�Z}dz�Z~d{�Zd}d|�Z�RS(~s�
    An array class with possibly masked values.

    Masked values of True exclude the corresponding element from any
    computation.

    Construction::

      x = MaskedArray(data, mask=nomask, dtype=None,
                      copy=False, subok=True, ndmin=0, fill_value=None,
                      keep_mask=True, hard_mask=None, shrink=True)

    Parameters
    ----------
    data : array_like
        Input data.
    mask : sequence, optional
        Mask. Must be convertible to an array of booleans with the same
        shape as `data`. True indicates a masked (i.e. invalid) data.
    dtype : dtype, optional
        Data type of the output.
        If `dtype` is None, the type of the data argument (``data.dtype``)
        is used. If `dtype` is not None and different from ``data.dtype``,
        a copy is performed.
    copy : bool, optional
        Whether to copy the input data (True), or to use a reference instead.
        Default is False.
    subok : bool, optional
        Whether to return a subclass of `MaskedArray` if possible (True) or a
        plain `MaskedArray`. Default is True.
    ndmin : int, optional
        Minimum number of dimensions. Default is 0.
    fill_value : scalar, optional
        Value used to fill in the masked values when necessary.
        If None, a default based on the data-type is used.
    keep_mask : bool, optional
        Whether to combine `mask` with the mask of the input data, if any
        (True), or to use only `mask` for the output (False). Default is True.
    hard_mask : bool, optional
        Whether to use a hard mask or not. With a hard mask, masked values
        cannot be unmasked. Default is False.
    shrink : bool, optional
        Whether to force compression of an empty mask. Default is True.

    iicsEtj|d|d|dtd|�}t|dt|��}
t|t�ri|j|jkrit}nt||�s�|r�tj	||�}ntj	|t|��}t
|d�r�t|t�r�|j|_t}n|jj
p�d
}|rt|j�}nt}|tkr8|sS|
r5t|_q5tj|jd|�|_q�t|ttf�r�y2tjg|D]}t|�^qxd|�}Wntk
r�t}nX|tkr5|j�r5||_t|_q5q�|r,|jj�|_t|_t|�tk	r5|j|j_q5q�t|_n�ytj|d|d|�}WnLtk
r�tjg|D]}t|gt|��^qtd|�}nX|j|jkr<|j|j}}|dkr�tj||j�}nD||krtj||j�}n dd	}t |||f��t}n|jtkra||_||_ne|s}||_||_nI|r��fd
���|j|�ntj!||j�|_t|_|dkr�t|dd�}n|dk	rt#||j�|_$n|	dkr/t|dt�|_%n	|	|_%|
|_&|S(s�
    Create a new masked array from scratch.

    Notes
    -----
    A masked array can also be created by taking a .view(MaskedArray).

        R�R,Rtndmint
_baseclassR$is/Mask and data not compatible: data size is %i, smask size is %i.csVxO|jjD]A}||||}}|jjrD�||�q
||O}q
WdS(s'do a|=b on each field of a, recursivelyN(R�R�(R
R�R�taftbf(t
_recursive_or(s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��
st_fill_valuet	_hardmask(N('R�RR"R8RR�RR�R�RR�R$R�R�RgRR�R�R�R�RKRRRt_sharedmaskR,RJR�R�R�R�R�RRdR�R�R�R�R�(RR R!R�R,RR�R	t	keep_maskt	hard_maskRbtoptionsRR�R�tnames_tmdtypeRFtndtnmtmsg((R�s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt__new__B
s�
'!		%


		
2
		
	
				cCs&|d	k	r*t|t�r*t|�}nt}i}|jt|di��|jt|di��t|t�s�|jt|di��ntdt|dd	�dt|dt�dt|dt�dt|dt�dt|d|�d|d|�}|j	j|�|j	j|�d	S(
s/Copies some attributes of obj to self.
        t_optinfot	_basedictt__dict__R�R�R�t_isfieldR�N(
R�R�R�RtupdateR8RRRR�(R'R�R�R�t_dict((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRA�
s$	cCs|j|�t|t�rd|j}|jrOt|dt|j|��}qjt|dt�}nt}||_	|j	tk	r�y|j|j	_Wq�t
k
r�t|_	q�ttfk
r�q�Xn|jjr|j
dkrtd|j�|_
qndS(s$Finalizes the masked array.
        R$N(RAR�R�R�R�R8RhR�R�R$RR�RR�R�R�(R'R�todtypeR$((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt__array_finalize__�
s&
		!	
cCs�|jt|��}|j|�|dk	r�|jj�|_|\}}}ttg|D]}t|�^q\�}t	j
|d�}	|	dk	rst|�dkr�tt|	|�t
�}
nt|	|�t
�}
yt|d}Wn4tk
rt|}ntk
r|j}nX|j�}tj||d|
�|tkrf|
tk	rp|
}qpqs||
B}n|jdkr�|r�tS||_t|_n|S(sp
        Special hook for ufuncs.
        Wraps the numpy array and sets the mask according to context.
        ii����R�N((RRRAR�R$R,R�RiRKR9R�R�RAR"R:R�tKeyErrorR	R�R@R�R�RjRR�(R'R�tcontextRtfuncRBR
targRFR7RDR	((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt__array_wrap__�
s8
(




	cCsu|dkr?|dkr*tj|�}q�tj||�}n�|dkr�y@t|t�rxtj||�}d}ntj||�}Wq�tk
r�tj||�}q�Xntj|||�}t|dt�tk	rM|dkr�|j}nt|�}|j	j|t�|_	y|j
|j	_
WqMttfk
rIqMXnt|dd�dk	rqd|_n|S(NR$R�(
R�R�RRR�R8R�R�RgR$R�RR�(R'R�RRyR�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR's2	
cCs�tj|�}|jj|�jt|��}|j|�|jj}|dkrm|j	jt
�|_	nI|j	tkr�t|_	n.|j	jg|D]}|t
f^q��|_	|jdk	r�t
|j|�|_n|S(s
        Returns a copy of the MaskedArray cast to given newtype.

        Returns
        -------
        output : MaskedArray
            A copy of self cast to input newtype.
            The returned record shape matches self.shape.

        Examples
        --------
        >>> x = np.ma.array([[1,2,3.1],[4,5,6],[7,8,9]], mask=[0] + [1,0]*4)
        >>> print x
        [[1.0 -- 3.1]
         [-- 5.0 --]
         [7.0 -- 9.0]]
        >>> print x.astype(int32)
        [[1 -- 3]
         [-- 5 --]
         [7 -- 9]]

        N(R�R�RtastypeRRRAR�R�R$RaR�R�R�(R'R^RyR�tn((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�Js!
.cCs.tj|t�}tj||�}|j}t|dt�s�t|tj�r�||}t	|�j
�r�t|d|�}q�|Sq*|tk	r*||r*t
Sn�|jt|��}|j|�t|t�r|jdk	r�|j||_nt|_n|tk	r*|||_t|_n|S(s`x.__getitem__(y) <==> x[y]

        Return the item described by i, as a masked array.

        R?R!N(R�RR�R$R8RR�R�RR?RR�R�RjRRARR�R�R"R�R�(R'R�RtdoutR$R!((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�rs*
	


cCs(|tkrtd��ntj|tj|d��}tj|d�}t|t�r�tj|||�|tkr�t	|j
|j�|_}nt
|�||<dStj|d�}t|jp�d
�}|tkrJ|tkrt	|j
|�}|_n|r'ttg|�||<n
t||<|jsFt|_ndS|}t|dt�}|r�|tkr�ttg|�}n|tkr�tj|||�|tk	r$t	|j
|�}|_tj|||�q$n=|jsA|js|j�tj|d�}ntj|||�tj|||�n�t|d�r�|jtkr�|tj|�}tj|||�n�|r�d}	t|	��nt|||dt�}
|j|}|jdkr�t j!||d	|
�n|
tkr|}ntj|||�|
||<dS(s�x.__setitem__(i, y) <==> x[i]=y

        Set item described by index. If value is masked, masks those
        locations.

        s Cannot alter the masked element.R�R$NR�s.Flexible 'hard' masks are not yet supported...R,iR�(("RjRR�Rt__getattribute__R�RR�R�RhR�R�R$RJR�R�R�R"R�RR�R8R�tunshare_maskR�RR)RctNotImplementedErrorRiRR�R�R@(R'R�RxRR$t_dtypetnbfieldstdvaltmvalRtmindxtdindx((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��sf
			

	
cCs|jt||��S(s�x.__getslice__(i, j) <==> x[i:j]

        Return the slice described by (i, j).  The use of negative
        indices is not supported.

        (R�tslice(R'R�tj((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt__getslice__�scCs|jt||�|�dS(s�x.__setslice__(i, j, value) <==> x[i:j]=value

    Set the slice (i,j) of a to value. If value is masked, mask
    those locations.

        N(R�R�(R'R�R�Rx((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt__setslice__�scCs�tj|d�}tj|d�}|tkr9t}n|tkrq|tkrUdSt|j|�}|_n|jdkr�|j
r�||O}q�||_n'|j}t
j|dt�}|js|jjdkrt
jt|j�gt|��d|�}q�|j|�}nnyt
j|d|d|�}WnLtk
r�t
jg|D]}t|gt|��^qZd|�}nX|j
r�x1|jD]}||c||O<q�Wn	||_|jr�|j|_ndS(sSet the mask.

        R�R$NR,R�(R�R�RjR"R�RhR�R$R�R�R�R�R�R�RRR?R�R�R�R�R�R�(R'R!R,tidtypetcurrent_maskR�RFR�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�s>		
		%
2
			cCs|jS(s"Return the current mask.

        (R$(R'((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt	_get_mask9stfgettfsettdoctMaskcCsJtj|d�jt�}|jjdkr1|Stjt|�dd�S(se
    Return the mask of the records.
    A record is masked when all the fields are masked.

        R$RTi����N(	R�R�RR�R�R�R�RRE(R'R$((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt_get_recordmaskCscCstd��dS(s`Return the mask of the records.
    A record is masked when all the fields are masked.

        s*Coming soon: setting the mask per records!N(R�(R'((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt_set_recordmaskOscCs
t|_|S(s�
        Force the mask to hard.

        Whether the mask of a masked array is hard or soft is determined by
        its `hardmask` property. `harden_mask` sets `hardmask` to True.

        See Also
        --------
        hardmask

        (R"R�(R'((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRNXs	cCs
t|_|S(s�
        Force the mask to soft.

        Whether the mask of a masked array is hard or soft is determined by
        its `hardmask` property. `soften_mask` sets `hardmask` to False.

        See Also
        --------
        hardmask

        (RR�(R'((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�gs	cCs|jS(N(R�(R'((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt<lambda>vssHardness of the maskcCs+|jr'|jj�|_t|_n|S(sS
        Copy the mask and set the sharedmask flag to False.

        Whether the mask is shared between masked arrays can be seen from
        the `sharedmask` property. `unshare_mask` ensures the mask is not shared.
        A copy of the mask is only made if it was shared.

        See Also
        --------
        sharedmask

        (R�R$R,R(R'((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�zs
	cCs|jS(N(R�(R'((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��ss%Share status of the mask (read-only).cCs/|j}|jr+|j�r+t|_n|S(s�
        Reduce a mask to nomask when possible.

        Parameters
        ----------
        None

        Returns
        -------
        None

        Examples
        --------
        >>> x = np.ma.array([[1,2 ], [3, 4]], mask=[0]*4)
        >>> x.mask
        array([[False, False],
               [False, False]], dtype=bool)
        >>> x.shrink_mask()
        >>> x.mask
        False

        (R$R?RR�(R'RF((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pytshrink_mask�s	cCs|jS(N(R�(R'((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��ss)Class of the underlying data (read-only).cCstj||j�S(sUReturn the current data, as a view of the original
        underlying data.

        (R�RR�(R'((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt	_get_data�scCs
t|�S(sReturn a flat iterator.(R�(R'((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt	_get_flat�scCs|j�}||(dS(s)Set a flattened version of self to value.N(R�(R'Rxty((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt	_set_flat�ssFlat version of the array.cCs2|jdkr'td|j�|_n|jdS(s�
        Return the filling value of the masked array.

        Returns
        -------
        fill_value : scalar
            The filling value.

        Examples
        --------
        >>> for dt in [np.int32, np.int64, np.float64, np.complex128]:
        ...     np.ma.array([0, 1], dtype=dt).get_fill_value()
        ...
        999999
        999999
        1e+20
        (1e+20+0j)

        >>> x = np.ma.array([0, 1.], fill_value=-np.inf)
        >>> x.get_fill_value()
        -inf

        N((R�R�R�R�(R'((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�scCsAt||j�}|j}|dkr3||_n
||d<dS(s�
        Set the filling value of the masked array.

        Parameters
        ----------
        value : scalar, optional
            The new filling value. Default is None, in which case a default
            based on the data type is used.

        See Also
        --------
        ma.set_fill_value : Equivalent function.

        Examples
        --------
        >>> x = np.ma.array([0, 1.], fill_value=-np.inf)
        >>> x.fill_value
        -inf
        >>> x.set_fill_value(np.pi)
        >>> x.fill_value
        3.1415926535897931

        Reset to default:

        >>> x.set_fill_value()
        >>> x.fill_value
        1e+20

        N((R�R�R�R�(R'RxRSR�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��s
	sFilling value.cCso|j}|tkr|jS|dkr4|j}nt||j�}|tkr_tj	|�S|jj
r�|jj�}t||j|�n�|j
�s�|jS|jj�}ytj||d|�Wn�ttfk
rt|dt�}|jt�}tj|||f�}nMtk
rj|jjr=�qk|r^tj|d|j�}qk|j}nX|S(sp
        Return a copy of self, with masked values filled with a given value.

        Parameters
        ----------
        fill_value : scalar, optional
            The value to use for invalid entries (None by default).
            If None, the `fill_value` attribute of the array is used instead.

        Returns
        -------
        filled_array : ndarray
            A copy of ``self`` with invalid entries replaced by *fill_value*
            (be it the function argument or the attribute of ``self``.

        Notes
        -----
        The result is **not** a MaskedArray!

        Examples
        --------
        >>> x = np.ma.array([1,2,3,4,5], mask=[0,0,1,0,1], fill_value=-999)
        >>> x.filled()
        array([1, 2, -999, 4, -999])
        >>> type(x.filled())
        <type 'numpy.ndarray'>

        Subclassing is preserved. This means that if the data part of the masked
        array is a matrix, `filled` returns a matrix:

        >>> x = np.ma.array(np.matrix([[1, 2], [3, 4]]), mask=[[0, 1], [1, 0]])
        >>> x.filled()
        matrix([[     1, 999999],
                [999999,      4]])

        R�R�N(R$R�RR�R	R�R�RwR�R R�R,R�RR@R�RtnarrayRR�R%RsR�R(R'R	RFRRD((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRA

s6%	


cCsLtj|j�}|jtk	rH|jtjtj|j���}n|S(s�
        Return all the non-masked data as a 1-D array.

        Returns
        -------
        data : ndarray
            A new `ndarray` holding the non-masked data is returned.

        Notes
        -----
        The result is **not** a MaskedArray!

        Examples
        --------
        >>> x = np.ma.array(np.arange(5), mask=[0]*2 + [1]*3)
        >>> x.compressed()
        array([0, 1])
        >>> type(x.compressed())
        <type 'numpy.ndarray'>

        (R�R�RR$R�R(R�Rc(R'R ((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR)U
s'cCs�|j|j}}tj|dtdt�}|j|d|d|�jt|��}|j|�|t	k	r�|j|d|�|_n|S(sI
        Return `a` where condition is ``True``.

        If condition is a `MaskedArray`, missing values are considered
        as ``False``.

        Parameters
        ----------
        condition : var
            Boolean 1-d array selecting which entries to return. If len(condition)
            is less than the size of a along the axis, then output is truncated
            to length of condition array.
        axis : {None, int}, optional
            Axis along which the operation must be performed.
        out : {None, ndarray}, optional
            Alternative output array in which to place the result. It must have
            the same shape as the expected output but the type will be cast if
            necessary.

        Returns
        -------
        result : MaskedArray
            A :class:`MaskedArray` object.

        Notes
        -----
        Please note the difference with :meth:`compressed` !
        The output of :meth:`compress` has a mask, the output of
        :meth:`compressed` does not.

        Examples
        --------
        >>> x = np.ma.array([[1,2,3],[4,5,6],[7,8,9]], mask=[0] + [1,0]*4)
        >>> print x
        [[1 -- 3]
         [-- 5 --]
         [7 -- 9]]
        >>> x.compress([1, 0, 1])
        masked_array(data = [1 3],
              mask = [False False],
              fill_value=999999)

        >>> x.compress([1, 0, 1], axis=1)
        masked_array(data =
         [[1 3]
         [-- --]
         [7 9]],
              mask =
         [[False False]
         [ True  True]
         [False False]],
              fill_value=999999)

        R,RRTR�(
RR$R�RRR(RRRAR�(R'RtRTR�RR$t_new((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR(q
s8*
cCs�tj�rpt}|tkr(t|�S|j}|tkrI|j}q�|jdkr|jj	r�|j
tt|j�f�}|j
�r�tj|jj�dt�}tj||d|�tt|��St|j�Sq|r�t|�St|j�Sn|jj	}|dkr9|jjd�}|||<q�t|jd�}|jj|�}t|||�n|j|j�}t|�S(s String representation.

        R�R�R�(N(RvR�RjR�R$R�RR�R�R�RRaR�RR�RttolistRR@R�R�R�R\R�RAR	(R'R�RFtrestrR�trdtype((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRH�
s6
	

cCs�t|j�}t|j�jd�d}td|ddt|�dt|�dt|j�dt|j�d	t|j	��}|j	j
r�|d
kr�td|Std|S|d
kr�td
|Std|S(s(Literal string representation.

        t(iR�tnlent R R!R6R�iR�R�R�R�(R�R�treprRtsplitRR�R$R	R�R�t_print_templates(R'R�R�t
parameters((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��
s!c	Cs�|tkrtSt|dt�}|tkr�tj|jd�|�}y%|jt|��}|j|_Wq�t	k
r�|SXn&t|d�}tj|jd�|�jt|��}|jtkr�||_n�t
|j|�}|jjr�|j
dkrd}nd}y+|jtt|j�f�j|�}Wq�tk
r�tjg|D]/}g|jjD]}||j�^qq^q^d|�}q�Xn||_|S(s+Check whether other equals self elementwiseR$iiRTN(RjR8R�R�t__eq__RARRR$RRiR�R�R�R�RR�RRR�(	R'tothertomasktchecktodataR!RTR�R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��
s4
*	+
	I	c	Cs�|tkrtSt|dt�}|tkr�tj|jd�|�}y%|jt|��}|j|_Wq�t	k
r�|SXn&t|d�}tj|jd�|�jt|��}|jtkr�||_n�t
|j|�}|jjr�|j
dkrd}nd}y+|jtt|j�f�j|�}Wq�tk
r�tjg|D]/}g|jjD]}||j�^qq^q^d|�}q�Xn||_|S(s2Check whether other doesn't equal self elementwiseR$iiRTN(RjR8R�R�t__ne__RARRR$RRiR�R�R�R�RR�RRR�(	R'R�R�R�R�R!RTR�R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR
s4
*	+
	I	cCs
t||�S(s1Add other to self, and return a new masked array.(R(R'R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt__add__.scCs
t||�S(s1Add other to self, and return a new masked array.(R(R'R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt__radd__2scCs
t||�S(s6Subtract other to self, and return a new masked array.(R�(R'R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt__sub__6scCs
t||�S(s6Subtract other to self, and return a new masked array.(R�(R'R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt__rsub__:scCs
t||�S(s6Multiply other by self, and return a new masked array.(R�(R'R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt__mul__>scCs
t||�S(s6Multiply other by self, and return a new masked array.(R�(R'R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt__rmul__BscCs
t||�S(s6Divide other into self, and return a new masked array.(R6(R'R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt__div__FscCs
t||�S(s6Divide other into self, and return a new masked array.(R�(R'R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt__truediv__JscCs
t||�S(s6Divide other into self, and return a new masked array.(R�(R'R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt__rtruediv__NscCs
t||�S(s6Divide other into self, and return a new masked array.(RC(R'R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt__floordiv__RscCs
t||�S(s6Divide other into self, and return a new masked array.(RC(R'R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt
__rfloordiv__VscCs
t||�S(s>Raise self to the power other, masking the potential NaNs/Infs(R�(R'R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt__pow__ZscCs
t||�S(s>Raise self to the power other, masking the potential NaNs/Infs(R�(R'R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt__rpow__^scCs�t|�}|jtkr`|tk	r~|j�r~t|j|j�|_|j|7_q~n|tk	r~|j|7_ntj|j	t
j|jdt|���|S(sAdd other to self in-place.i(
RJR$R�RRhR�R�R�t__iadd__RR�R�RI(R'R�RF((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRbs+cCs�t|�}|jtkr`|tk	r~|j�r~t|j|j�|_|j|7_q~n|tk	r~|j|7_ntj|j	t
j|jdt|���|S(s"Subtract other from self in-place.i(
RJR$R�RRhR�R�R�t__isub__RR�R�RI(R'R�RF((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRos+cCs�t|�}|jtkr`|tk	r~|j�r~t|j|j�|_|j|7_q~n|tk	r~|j|7_ntj|j	t
j|jdt|���|S(s Multiply self by other in-place.i(
RJR$R�RRhR�R�R�t__imul__RR�R�RI(R'R�RF((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR{s+cCs�t|�}t�j|j|�}t|�}t||�}|j�rvttj	\}}tj
|||�}n|j|O_tj
|jtj
|jd|��|S(sDivide self by other in-place.i(RIR.R+RRJRiRR:R�R6R�R$R�t__idiv__(R'R�t
other_datatdom_maskt
other_masktnew_maskR
R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�s%cCs�t|�}t�j|j|�}t|�}t||�}|j�rvttj	\}}tj
|||�}n|j|O_tj
|jtj
|jd|��|S(s$Floor divide self by other in-place.i(RIR.R+RRJRiRR:R�RCR�R$R�t
__ifloordiv__(R'R�RRRRR
R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�s%cCs�t|�}t�j|j|�}t|�}t||�}|j�rvttj	\}}tj
|||�}n|j|O_tj
|jtj
|jd|��|S(s#True divide self by other in-place.i(RIR.R+RRJRiRR:R�R�R�R$R�t__itruediv__(R'R�RRRRR
R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�s%cCst|�}t|�}tj�}z?tjdddd�tj|jtj|j	d|��Wdtj|�Xtj
tj|j��}|j�r�|j	t
k	r�|j	|O_	n	||_	tj|j|jd|�nt||�}t|j	|�|_	|S(s(Raise self to the power other, in place.R6R<R%iNR�(RIRJR�R=R>R�t__ipow__RR�R$RcR#RR�R@R	Ri(R'R�RRt
err_statusR%R((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�s )	cCsK|jdkrtd��n|jr;tjd�tjSt|j��S(sConvert to float.is7Only length-1 arrays can be converted to Python scalarss,Warning: converting a masked element to nan.(	R�R�R$twarningstwarnR�tnanR�R�(R'((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt	__float__�s	
cCsF|jdkrtd��n|jr6td��nt|j��S(sConvert to int.is7Only length-1 arrays can be converted to Python scalarss.Cannot convert masked element to a Python int.(R�R�R$RR�R�(R'((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt__int__�s
	cCs/|jjjt|��}|j|j�|S(s�
        Return the imaginary part of the masked array.

        The returned array is a view on the imaginary part of the `MaskedArray`
        whose `get_imag` method is called.

        Parameters
        ----------
        None

        Returns
        -------
        result : MaskedArray
            The imaginary part of the masked array.

        See Also
        --------
        get_real, real, imag

        Examples
        --------
        >>> x = np.ma.array([1+1.j, -2j, 3.45+1.6j], mask=[False, True, False])
        >>> x.get_imag()
        masked_array(data = [1.0 -- 1.6],
                     mask = [False  True False],
               fill_value = 1e+20)

        (RtimagRRR�R$(R'R((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pytget_imag�ssImaginary part.cCs/|jjjt|��}|j|j�|S(s�
        Return the real part of the masked array.

        The returned array is a view on the real part of the `MaskedArray`
        whose `get_real` method is called.

        Parameters
        ----------
        None

        Returns
        -------
        result : MaskedArray
            The real part of the masked array.

        See Also
        --------
        get_imag, real, imag

        Examples
        --------
        >>> x = np.ma.array([1+1.j, -2j, 3.45+1.6j], mask=[False, True, False])
        >>> x.get_real()
        masked_array(data = [1.0 -- 3.45],
                     mask = [False  True False],
               fill_value = 1e+20)

        (RtrealRRR�R$(R'R((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pytget_real�ss	Real partc	Cs�|j}|j}t|�}|tkr�|dkr:dS|dkrN|dS|dkra|jS||}t|�}||=tj|�|Sntj||�}|j	t
�j|�}|dkr�||St||�SdS(s�
        Count the non-masked elements of the array along the given axis.

        Parameters
        ----------
        axis : int, optional
            Axis along which to count the non-masked elements. If `axis` is
            `None`, all non-masked elements are counted.

        Returns
        -------
        result : int or ndarray
            If `axis` is `None`, an integer count is returned. When `axis` is
            not `None`, an array with shape determined by the lengths of the
            remaining axes, is returned.

        See Also
        --------
        count_masked : Count masked elements in array or along a given axis.

        Examples
        --------
        >>> import numpy.ma as ma
        >>> a = ma.arange(6).reshape((2, 3))
        >>> a[1, :] = ma.masked
        >>> a
        masked_array(data =
         [[0 1 2]
         [-- -- --]],
                     mask =
         [[False False False]
         [ True  True  True]],
               fill_value = 999999)
        >>> a.count()
        3

        When the `axis` keyword is specified an array of appropriate size is
        returned.

        >>> a.count(axis=0)
        array([1, 1, 1])
        >>> a.count(axis=1)
        array([3, 0])

        iiN(
R$R�R�R�R�R�R�R�R�R�R�R�R�(	R'RTRFR�tlsR�RVtn1tn2((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR/#s&.		
tflattencCsntj|j�jt|��}|j|�|jtk	ratj|j�j|j	�|_n	t|_|S(s�
        Returns a 1D version of self, as a view.

        Returns
        -------
        MaskedArray
            Output view is of shape ``(self.size,)`` (or
            ``(np.ma.product(self.shape),)``).

        Examples
        --------
        >>> x = np.ma.array([[1,2,3],[4,5,6],[7,8,9]], mask=[0] + [1,0]*4)
        >>> print x
        [[1 -- 3]
         [-- 5 --]
         [7 -- 9]]
        >>> print x.ravel()
        [1 -- 3 -- 5 -- 7 -- 9]

        (
R�R�RRRRAR$R�R�R�(R'R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�is!
$	R�cOs~|jd|jdd��|jj||�jt|��}|j|�|j}|tk	rz|j||�|_n|S(s�
        Give a new shape to the array without changing its data.

        Returns a masked array containing the same data, but with a new shape.
        The result is a view on the original array; if this is not possible, a
        ValueError is raised.

        Parameters
        ----------
        shape : int or tuple of ints
            The new shape should be compatible with the original shape. If an
            integer is supplied, then the result will be a 1-D array of that
            length.
        order : {'C', 'F'}, optional
            Determines whether the array data should be viewed as in C
            (row-major) or FORTRAN (column-major) order.

        Returns
        -------
        reshaped_array : array
            A new view on the array.

        See Also
        --------
        reshape : Equivalent function in the masked array module.
        numpy.ndarray.reshape : Equivalent method on ndarray object.
        numpy.reshape : Equivalent function in the NumPy module.

        Notes
        -----
        The reshaping operation cannot guarantee that a copy will not be made,
        to modify the shape in place, use ``a.shape = s``

        Examples
        --------
        >>> x = np.ma.array([[1,2],[3,4]], mask=[1,0,0,1])
        >>> print x
        [[-- 2]
         [3 --]]
        >>> x = x.reshape((4,1))
        >>> print x
        [[--]
         [2]
         [3]
         [--]]

        tordertC(	R�R�RR�RRRAR$R�(R'R�RCRR!((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��s0$
	cCsd}t|��dS(sv
        .. warning::

            This method does nothing, except raise a ValueError exception. A
            masked array does not own its data and therefore cannot safely be
            resized in place. Use the `numpy.ma.resize` function instead.

        This method is difficult to implement safely and may be deprecated in
        future releases of NumPy.

        soA masked array does not own its data and therefore cannot be resized.
Use the numpy.ma.resize function instead.N(R(R'RctrefcheckR'R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��straisecCs*|j}|jr�|jtk	r�|j|}t|dt�}t|dtdt�}|j|j�||}||}n|jj	||d|�|tkr�t
|�}nh|j�}t
|�tkr�|j	|td|�n|j	||jd|�t|dtdt�}||_dS(s
        Set storage-indexed locations to corresponding values.

        Sets self._data.flat[n] = values[n] for each n in indices.
        If `values` is shorter than `indices` then it will repeat.
        If `values` has some masked values, the initial mask is updated
        in consequence, else the corresponding values are unmasked.

        Parameters
        ----------
        indices : 1-D array_like
            Target indices, interpreted as integers.
        values : array_like
            Values to place in self._data copy at target indices.
        mode : {'raise', 'wrap', 'clip'}, optional
            Specifies how out-of-bounds indices will behave.
            'raise' : raise an error.
            'wrap' : wrap around.
            'clip' : clip to the range.

        Notes
        -----
        `values` can be a scalar or length 1 array.

        Examples
        --------
        >>> x = np.ma.array([[1,2,3],[4,5,6],[7,8,9]], mask=[0] + [1,0]*4)
        >>> print x
        [[1 -- 3]
         [-- 5 --]
         [7 -- 9]]
        >>> x.put([0,4,8],[10,20,30])
        >>> print x
        [[10 -- 3]
         [-- 20 --]
         [7 -- 30]]

        >>> x.put(4,999)
        >>> print x
        [[10 -- 3]
         [-- 999 --]
         [7 -- 30]]

        R,RtmodeRbN(
R$R�R�R�RR"R�R�RR�RJR,Rf(R'RRtvaluesR+RFR!((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��s"-	
cCs>|jtkr%|jjtt�fS|jj|jjjfS(s�
        Return the addresses of the data and mask areas.

        Parameters
        ----------
        None

        Examples
        --------
        >>> x = np.ma.array([1, 2, 3], mask=[0, 1, 1])
        >>> x.ids()
        (166670640, 166659832)

        If the array has no mask, the address of `nomask` is returned. This address
        is typically not close to the data in memory:

        >>> x = np.ma.array([1, 2, 3])
        >>> x.ids()
        (166691080, 3083169284L)

        (R$R�tctypesR tid(R'((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRQscCs|jdS(s�
        Return a boolean indicating whether the data is contiguous.

        Parameters
        ----------
        None

        Examples
        --------
        >>> x = np.ma.array([1, 2, 3])
        >>> x.iscontiguous()
        True

        `iscontiguous` returns one of the flags of the masked array:

        >>> x.flags
          C_CONTIGUOUS : True
          F_CONTIGUOUS : True
          OWNDATA : False
          WRITEABLE : True
          ALIGNED : True
          UPDATEIFCOPY : False

        t
CONTIGUOUS(tflags(R'((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pytiscontiguous9scCs�t|j|�}|dkro|jt�jd|�jt|��}|jra|j	|�n
|rkt
S|S|jt�jd|d|�t|t�r�|js�|r�|j	|�q�n|S(s�
    Check if all of the elements of `a` are true.

    Performs a :func:`logical_and` over the given axis and returns the result.
    Masked values are considered as True during computation.
    For convenience, the output array is masked where ALL the values along the
    current axis are masked: if the output would have been a scalar and that
    all the values are masked, then the output is `masked`.

    Parameters
    ----------
    axis : {None, integer}
        Axis to perform the operation over.
        If None, perform over flattened array.
    out : {None, array}, optional
        Array into which the result can be placed. Its type is preserved
        and it must be of the right shape to hold the output.

    See Also
    --------
    all : equivalent function

    Examples
    --------
    >>> np.ma.array([1,2,3]).all()
    True
    >>> a = np.ma.array([1,2,3], mask=True)
    >>> (a.all() is np.ma.masked)
    True

        RTR�N(
RrR$R�RAR"RRRR?R�RjR�R(R'RTR�R!RD((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRUs *	cCs�t|j|�}|dkrt|jt�jd|�jt|��}|jra|j	|�n|rpt
}n|S|jt�jd|d|�t|t�r�|js�|r�|j	|�q�n|S(s�
        Check if any of the elements of `a` are true.

        Performs a logical_or over the given axis and returns the result.
        Masked values are considered as False during computation.

        Parameters
        ----------
        axis : {None, integer}
            Axis to perform the operation over.
            If None, perform over flattened array and return a scalar.
        out : {None, array}, optional
            Array into which the result can be placed. Its type is preserved
            and it must be of the right shape to hold the output.

        See Also
        --------
        any : equivalent function

        RTR�N(
RrR$R�RARRRRR?R�RjR�R(R'RTR�R!RD((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�s*		cCst|jd�dt�j�S(s�

        Return the indices of unmasked elements that are not zero.

        Returns a tuple of arrays, one for each dimension, containing the
        indices of the non-zero elements in that dimension. The corresponding
        non-zero values can be obtained with::

            a[a.nonzero()]

        To group the indices by element, rather than dimension, use
        instead::

            np.transpose(a.nonzero())

        The result of this is always a 2d array, with a row for each non-zero
        element.

        Parameters
        ----------
        None

        Returns
        -------
        tuple_of_arrays : tuple
            Indices of elements that are non-zero.

        See Also
        --------
        numpy.nonzero :
            Function operating on ndarrays.
        flatnonzero :
            Return indices that are non-zero in the flattened version of the input
            array.
        ndarray.nonzero :
            Equivalent ndarray method.
        count_nonzero :
            Counts the number of non-zero elements in the input array.

        Examples
        --------
        >>> import numpy.ma as ma
        >>> x = ma.array(np.eye(3))
        >>> x
        masked_array(data =
         [[ 1.  0.  0.]
         [ 0.  1.  0.]
         [ 0.  0.  1.]],
              mask =
         False,
              fill_value=1e+20)
        >>> x.nonzero()
        (array([0, 1, 2]), array([0, 1, 2]))

        Masked elements are ignored.

        >>> x[1, 1] = ma.masked
        >>> x
        masked_array(data =
         [[1.0 0.0 0.0]
         [0.0 -- 0.0]
         [0.0 0.0 1.0]],
              mask =
         [[False False False]
         [False  True False]
         [False False False]],
              fill_value=1e+20)
        >>> x.nonzero()
        (array([0, 2]), array([0, 2]))

        Indices can also be grouped by element.

        >>> np.transpose(x.nonzero())
        array([[0, 0],
               [2, 2]])

        A common use for ``nonzero`` is to find the indices of an array, where
        a condition is True.  Given an array `a`, the condition `a` > 3 is a
        boolean array and since False is interpreted as 0, ma.nonzero(a > 3)
        yields the indices of the `a` where the condition is true.

        >>> a = ma.array([[1,2,3],[4,5,6],[7,8,9]])
        >>> a > 3
        masked_array(data =
         [[False False False]
         [ True  True  True]
         [ True  True  True]],
              mask =
         False,
              fill_value=999999)
        >>> ma.nonzero(a > 3)
        (array([1, 1, 1, 2, 2, 2]), array([0, 1, 2, 0, 1, 2]))

        The ``nonzero`` method of the condition array can also be called.

        >>> (a > 3).nonzero()
        (array([1, 1, 1, 2, 2, 2]), array([0, 1, 2, 0, 1, 2]))

        iR,(R�RARR�(R'((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��scic		Cs�|j}|tkrOtt|�jd|d|d|d|�}|j|�S|jd|d|d|�}|j|�jd�jddd|�SdS(s8
        (this docstring should be overwritten)
        toffsettaxis1taxis2R�iRTN(
R$R�tsuperRR�R�R4RAR�R�(	R'R2R3R4R�R�RFRR�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�s	
c	Cstj|d�}t||�}|dkr�|jd�j|d|�}t|dd�}|r�|jt|��}|j	|�n|r�t
}n|S|jd�j|d|d|�}t|t�rt|dt
�}|t
krt|j�}|_n||_n|S(s�
        Return the sum of the array elements over the given axis.
        Masked elements are set to 0 internally.

        Parameters
        ----------
        axis : {None, -1, int}, optional
            Axis along which the sum is computed. The default
            (`axis` = None) is to compute over the flattened array.
        dtype : {None, dtype}, optional
            Determines the type of the returned array and of the accumulator
            where the elements are summed. If dtype has the value None and
            the type of a is an integer type of precision less than the default
            platform integer, then the default platform integer precision is
            used.  Otherwise, the dtype is the same as that of a.
        out :  {None, ndarray}, optional
            Alternative output array in which to place the result. It must
            have the same shape and buffer length as the expected output
            but the type will be cast if necessary.

        Returns
        -------
        sum_along_axis : MaskedArray or scalar
            An array with the same shape as self, with the specified
            axis removed.   If self is a 0-d array, or if `axis` is None, a scalar
            is returned.  If an output array is specified, a reference to
            `out` is returned.

        Examples
        --------
        >>> x = np.ma.array([[1,2,3],[4,5,6],[7,8,9]], mask=[0] + [1,0]*4)
        >>> print x
        [[1 -- 3]
         [-- 5 --]
         [7 -- 9]]
        >>> print x.sum()
        25
        >>> print x.sum(axis=1)
        [4 5 16]
        >>> print x.sum(axis=0)
        [8 5 12]
        >>> print type(x.sum(axis=0, dtype=np.int64)[0])
        <type 'numpy.int64'>

        R$iR�R?R�N(R�R�RrR�RAR�R8RRR�RjR�RR�RhR�R$R�(	R'RTR�R�R$RfRtrndimtoutmask((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�s$.	$cCs�|jd�jd|d|d|�}|dk	rYt|t�rU|j|j�n|S|jt|��}|j|j	�|S(sg
        Return the cumulative sum of the elements along the given axis.
        The cumulative sum is calculated over the flattened array by
        default, otherwise over the specified axis.

        Masked values are set to 0 internally during the computation.
        However, their position is saved, and the result will be masked at
        the same locations.

        Parameters
        ----------
        axis : {None, -1, int}, optional
            Axis along which the sum is computed. The default (`axis` = None) is to
            compute over the flattened array. `axis` may be negative, in which case
            it counts from the   last to the first axis.
        dtype : {None, dtype}, optional
            Type of the returned array and of the accumulator in which the
            elements are summed.  If `dtype` is not specified, it defaults
            to the dtype of `a`, unless `a` has an integer dtype with a
            precision less than that of the default platform integer.  In
            that case, the default platform integer is used.
        out : ndarray, optional
            Alternative output array in which to place the result. It must
            have the same shape and buffer length as the expected output
            but the type will be cast if necessary.

        Returns
        -------
        cumsum : ndarray.
            A new array holding the result is returned unless ``out`` is
            specified, in which case a reference to ``out`` is returned.

        Notes
        -----
        The mask is lost if `out` is not a valid :class:`MaskedArray` !

        Arithmetic is modular when using integer types, and no error is
        raised on overflow.

        Examples
        --------
        >>> marr = np.ma.array(np.arange(10), mask=[0,0,0,1,1,1,0,0,0,0])
        >>> print marr.cumsum()
        [0 1 3 -- -- -- 9 16 24 33]

        iRTR�R�N(
RAR1R�R�RR�R!RRR$(R'RTR�R�R((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR1as/'c	Cstj|d�}t||�}|dkr�|jd�j|d|�}t|dd�}|r�|jt|��}|j	|�n|r�t
}n|S|jd�j|d|d|�}t|t�rt|dt
�}|t
krt|j�}|_n||_n|S(s�
        Return the product of the array elements over the given axis.
        Masked elements are set to 1 internally for computation.

        Parameters
        ----------
        axis : {None, int}, optional
            Axis over which the product is taken. If None is used, then the
            product is over all the array elements.
        dtype : {None, dtype}, optional
            Determines the type of the returned array and of the accumulator
            where the elements are multiplied. If ``dtype`` has the value ``None``
            and the type of a is an integer type of precision less than the default
            platform integer, then the default platform integer precision is
            used.  Otherwise, the dtype is the same as that of a.
        out : {None, array}, optional
            Alternative output array in which to place the result. It must have
            the same shape as the expected output but the type will be cast if
            necessary.

        Returns
        -------
        product_along_axis : {array, scalar}, see dtype parameter above.
            Returns an array whose shape is the same as a with the specified
            axis removed. Returns a 0d array when a is 1d or axis=None.
            Returns a reference to the specified output array if specified.

        See Also
        --------
        prod : equivalent function

        Notes
        -----
        Arithmetic is modular when using integer types, and no error is raised
        on overflow.

        Examples
        --------
        >>> np.prod([1.,2.])
        2.0
        >>> np.prod([1.,2.], dtype=np.int32)
        2
        >>> np.prod([[1.,2.],[3.,4.]])
        24.0
        >>> np.prod([[1.,2.],[3.,4.]], axis=1)
        array([  2.,  12.])

        R$iR�R?iR�N(R�R�RrR�RAR�R8RRR�RjR�RR�RhR�R$R�(	R'RTR�R�R$RfRR6R7((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��s$1	$cCs�|jd�jd|d|d|�}|dk	rYt|t�rU|j|j�n|S|jt|��}|j|j�|S(ss
        Return the cumulative product of the elements along the given axis.
        The cumulative product is taken over the flattened array by
        default, otherwise over the specified axis.

        Masked values are set to 1 internally during the computation.
        However, their position is saved, and the result will be masked at
        the same locations.

        Parameters
        ----------
        axis : {None, -1, int}, optional
            Axis along which the product is computed. The default
            (`axis` = None) is to compute over the flattened array.
        dtype : {None, dtype}, optional
            Determines the type of the returned array and of the accumulator
            where the elements are multiplied. If ``dtype`` has the value ``None``
            and the type of ``a`` is an integer type of precision less than the
            default platform integer, then the default platform integer precision
            is used.  Otherwise, the dtype is the same as that of ``a``.
        out : ndarray, optional
            Alternative output array in which to place the result. It must
            have the same shape and buffer length as the expected output
            but the type will be cast if necessary.

        Returns
        -------
        cumprod : ndarray
            A new array holding the result is returned unless out is specified,
            in which case a reference to out is returned.

        Notes
        -----
        The mask is lost if `out` is not a valid MaskedArray !

        Arithmetic is modular when using integer types, and no error is
        raised on overflow.

        iRTR�R�N(	RAR0R�R�RR�R$RR(R'RTR�R�R((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR0�s('cCs
|jtkr3tt|�jd|d|�}n\|jd|d|�}|jd|�}|jdkr�|dkr�t}n|d|}|dk	r||_
t|t�rt|dt�}|tkr�t
|j�}|_nt|dt�|_
n|S|S(s�
        Returns the average of the array elements.

        Masked entries are ignored.
        The average is taken over the flattened array by default, otherwise over
        the specified axis. Refer to `numpy.mean` for the full documentation.

        Parameters
        ----------
        a : array_like
            Array containing numbers whose mean is desired. If `a` is not an
            array, a conversion is attempted.
        axis : int, optional
            Axis along which the means are computed. The default is to compute
            the mean of the flattened array.
        dtype : dtype, optional
            Type to use in computing the mean. For integer inputs, the default
            is float64; for floating point, inputs it is the same as the input
            dtype.
        out : ndarray, optional
            Alternative output array in which to place the result. It must have
            the same shape as the expected output but the type will be cast if
            necessary.

        Returns
        -------
        mean : ndarray, see dtype parameter above
            If `out=None`, returns a new array containing the mean values,
            otherwise a reference to the output array is returned.

        See Also
        --------
        numpy.ma.mean : Equivalent function.
        numpy.mean : Equivalent function on non-masked arrays.
        numpy.ma.average: Weighted average.

        Examples
        --------
        >>> a = np.ma.array([1,2,3], mask=[False, False, True])
        >>> a
        masked_array(data = [1 2 --],
                     mask = [False False  True],
               fill_value = 999999)
        >>> a.mean()
        1.5

        RTR�ig�?R$(N(R$R�R5RR}R�R/R�RjR�R�R�R8Rh(R'RTR�R�RtdsumtcntR7((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR}s 0$		cCs5|j||�}|s ||S|t||�SdS(s�
        Compute the anomalies (deviations from the arithmetic mean)
        along the given axis.

        Returns an array of anomalies, with the same shape as the input and
        where the arithmetic mean is computed along the given axis.

        Parameters
        ----------
        axis : int, optional
            Axis over which the anomalies are taken.
            The default is to use the mean of the flattened array as reference.
        dtype : dtype, optional
            Type to use in computing the variance. For arrays of integer type
             the default is float32; for arrays of float types it is the same as
             the array type.

        See Also
        --------
        mean : Compute the mean of the array.

        Examples
        --------
        >>> a = np.ma.array([1,2,3])
        >>> a.anom()
        masked_array(data = [-1.  0.  1.],
                     mask = False,
               fill_value = 1e+20)

        N(R}R=(R'RTR�RF((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRWsc		Cs�|jtkr4|jjd|d|d|d|�S|jd|�|}|jd|d|�}t|�r�tj|�d}n
||9}t	|j
|�|�jt|��}|j
r�t|jj|�|dk�|_|j|�n}t|dt�rot}|d
k	rot|t�r5|jt�n3|jjdkr\d	}t|��ntj|_|Sn|d
k	r�||_t|t�r�|j|j�n|S|S(R�RTR�R�tddofiiR$tbius>Masked data information would be lost in one or more location.N( R$R�RR�R/RR�R)RR6R�RRR?RiRRAR8RRjR�R�RR�R"R�R�RR�RR�R!(	R'RTR�R�R:R9tdanomtdvarR�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�|s6%
'	$	c	Cso|jd|d|d|d|�}|tk	rkt|�}|dk	rktj|dd|dd�|Sn|S(	R�RTR�R�R:g�?RMRNN(R�RjR�R�R�R�(R'RTR�R�R:R=((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��s$cCsy|jjd|d|�jt|��}|j|_|j|�|dkrS|St|t�ru|j	|j�n|S(s�
        Return an array rounded a to the given number of decimals.

        Refer to `numpy.around` for full documentation.

        See Also
        --------
        numpy.around : equivalent function

        tdecimalsR�N(
RR�RRR$RAR�R�RR�(R'R>R�R((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��s*
t	quicksortcCsO|dkrt|�}n|j|�jt�}|jd|d|d|�S(s6
        Return an ndarray of indices that sort the array along the
        specified axis.  Masked values are filled beforehand to
        `fill_value`.

        Parameters
        ----------
        axis : int, optional
            Axis along which to sort.  The default is -1 (last axis).
            If None, the flattened array is used.
        fill_value : var, optional
            Value used to fill the array before sorting.
            The default is the `fill_value` attribute of the input array.
        kind : {'quicksort', 'mergesort', 'heapsort'}, optional
            Sorting algorithm.
        order : list, optional
            When `a` is an array with fields defined, this argument specifies
            which fields to compare first, second, etc.  Not all fields need be
            specified.

        Returns
        -------
        index_array : ndarray, int
            Array of indices that sort `a` along the specified axis.
            In other words, ``a[index_array]`` yields a sorted `a`.

        See Also
        --------
        sort : Describes sorting algorithms used.
        lexsort : Indirect stable sort with multiple keys.
        ndarray.sort : Inplace sort.

        Notes
        -----
        See `sort` for notes on the different sorting algorithms.

        Examples
        --------
        >>> a = np.ma.array([3,2,1], mask=[False, False, True])
        >>> a
        masked_array(data = [3 2 --],
                     mask = [False False  True],
               fill_value = 999999)
        >>> a.argsort()
        array([1, 0, 2])

        RTR�R'N(R�R2RARR�R(R'RTR�R'R	RD((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�s0cCsF|dkrt|�}n|j|�jt�}|j|d|�S(s�
        Return array of indices to the minimum values along the given axis.

        Parameters
        ----------
        axis : {None, integer}
            If None, the index is into the flattened array, otherwise along
            the specified axis
        fill_value : {var}, optional
            Value used to fill in the masked values.  If None, the output of
            minimum_fill_value(self._data) is used instead.
        out : {None, array}, optional
            Array into which the result can be placed. Its type is preserved
            and it must be of the right shape to hold the output.

        Returns
        -------
        {ndarray, scalar}
            If multi-dimension input, returns a new ndarray of indices to the
            minimum values along the given axis.  Otherwise, returns a scalar
            of index to the minimum values along the given axis.

        Examples
        --------
        >>> x = np.ma.array(arange(4), mask=[1,1,0,0])
        >>> x.shape = (2,2)
        >>> print x
        [[-- --]
         [2 3]]
        >>> print x.argmin(axis=0, fill_value=-1)
        [0 0]
        >>> print x.argmin(axis=0, fill_value=9)
        [1 1]

        R�N(R�R�RARR�R(R'RTR	R�RD((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�s$cCsI|dkrt|j�}n|j|�jt�}|j|d|�S(s�
        Returns array of indices of the maximum values along the given axis.
        Masked values are treated as if they had the value fill_value.

        Parameters
        ----------
        axis : {None, integer}
            If None, the index is into the flattened array, otherwise along
            the specified axis
        fill_value : {var}, optional
            Value used to fill in the masked values.  If None, the output of
            maximum_fill_value(self._data) is used instead.
        out : {None, array}, optional
            Array into which the result can be placed. Its type is preserved
            and it must be of the right shape to hold the output.

        Returns
        -------
        index_array : {integer_array}

        Examples
        --------
        >>> a = np.arange(6).reshape(2,3)
        >>> a.argmax()
        5
        >>> a.argmax(0)
        array([1, 1, 1])
        >>> a.argmax(1)
        array([2, 2])

        R�N(R�R|RRARR�R(R'RTR	R�RD((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR)s i����cCs�|jtkr1tj|d|d|d|�n�|tkrA|S|dkrq|rbt|�}qwt|�}n|}tj	|j
�}|j|�jd|d|d|�||<|j
�}|j|j}	|j|j}
|
|j_|	|j_dS(s<
    Sort the array, in-place

    Parameters
    ----------
    a : array_like
        Array to be sorted.
    axis : int, optional
        Axis along which to sort. If None, the array is flattened before
        sorting. The default is -1, which sorts along the last axis.
    kind : {'quicksort', 'mergesort', 'heapsort'}, optional
        Sorting algorithm. Default is 'quicksort'.
    order : list, optional
        When `a` is a structured array, this argument specifies which fields
        to compare first, second, and so on.  This list does not need to
        include all of the fields.
    endwith : {True, False}, optional
        Whether missing values (if any) should be forced in the upper indices
        (at the end of the array) (True) or lower indices (at the beginning).
    fill_value : {var}, optional
        Value used internally for the masked values.
        If ``fill_value`` is not None, it supersedes ``endwith``.

    Returns
    -------
    sorted_array : ndarray
        Array of the same type and shape as `a`.

    See Also
    --------
    ndarray.sort : Method to sort an array in-place.
    argsort : Indirect sort.
    lexsort : Indirect stable sort on multiple keys.
    searchsorted : Find elements in a sorted array.

    Notes
    -----
    See ``sort`` for notes on the different sorting algorithms.

    Examples
    --------
    >>> a = ma.array([1, 2, 5, 4, 3],mask=[0, 1, 0, 1, 0])
    >>> # Default
    >>> a.sort()
    >>> print a
    [1 3 5 -- --]

    >>> a = ma.array([1, 2, 5, 4, 3],mask=[0, 1, 0, 1, 0])
    >>> # Put missing values in the front
    >>> a.sort(endwith=False)
    >>> print a
    [-- -- 1 3 5]

    >>> a = ma.array([1, 2, 5, 4, 3],mask=[0, 1, 0, 1, 0])
    >>> # fill_value takes over endwith
    >>> a.sort(endwith=False, fill_value=3)
    >>> print a
    [1 -- -- 3 5]

        RTR�R'N(R$R�R�R�RjR�R�R|R�RRR�RARR�R�R(R'RTR�R'tendwithR	tfillertidxtidx_lttmp_maskttmp_data((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�Os$>"
c	Cs�tj|d�}t||�}|dkr<t|�}n|dkr�|j|�jd|d|�jt|��}|j	r�|j
|�|j	r�tj||j
d|�q�n|r�t}n|S|j|�jd|d|�}t|t�r<t|dt�}|tkr0t|j�}|_n||_n@|jjdkrcd}t|��ntj|tjd|�|S(s
    Return the minimum along a given axis.

    Parameters
    ----------
    axis : {None, int}, optional
        Axis along which to operate.  By default, ``axis`` is None and the
        flattened input is used.
    out : array_like, optional
        Alternative output array in which to place the result.  Must be of
        the same shape and buffer length as the expected output.
    fill_value : {var}, optional
        Value used to fill in the masked values.
        If None, use the output of `minimum_fill_value`.

    Returns
    -------
    amin : array_like
        New array holding the result.
        If ``out`` was specified, ``out`` is returned.

    See Also
    --------
    minimum_fill_value
        Returns the minimum filling value for a given datatype.

        R$RTR�R�R;s>Masked data information would be lost in one or more location.N(R�R�RrR�R�RAR~RRR?R�R�R@R	RjR�RR8R�RhR�R$R�R�R�RR(	R'RTR�R	R$RfRR7R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR~�s00	
		!cCs*|dkrt|�Stj||�SdS(s�
        Return the array minimum along the specified axis.

        Parameters
        ----------
        axis : int, optional
            The axis along which to find the minima. Default is None, in which case
            the minimum value in the whole array is returned.

        Returns
        -------
        min : scalar or MaskedArray
            If `axis` is None, the result is a scalar. Otherwise, if `axis` is
            given and the array is at least 2-D, the result is a masked array with
            dimension one smaller than the array on which `mini` is called.

        Examples
        --------
        >>> x = np.ma.array(np.arange(6), mask=[0 ,1, 0, 0, 0 ,1]).reshape(3, 2)
        >>> print x
        [[0 --]
         [2 3]
         [4 --]]
        >>> x.mini()
        0
        >>> x.mini(axis=0)
        masked_array(data = [0 3],
                     mask = [False False],
               fill_value = 999999)
        >>> print x.mini(axis=1)
        [0 2 4]

        N(R�RR�(R'RT((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pytmini�s"
c	Cs�tj|d�}t||�}|dkr<t|�}n|dkr�|j|�jd|d|�jt|��}|j	r�|j
|�|j	r�tj||j
d|�q�n|r�t}n|S|j|�jd|d|�}t|t�r<t|dt�}|tkr0t|j�}|_n||_n@|jjdkrcd}t|��ntj|tjd|�|S(si
        Return the maximum along a given axis.

        Parameters
        ----------
        axis : {None, int}, optional
            Axis along which to operate.  By default, ``axis`` is None and the
            flattened input is used.
        out : array_like, optional
            Alternative output array in which to place the result.  Must
            be of the same shape and buffer length as the expected output.
        fill_value : {var}, optional
            Value used to fill in the masked values.
            If None, use the output of maximum_fill_value().

        Returns
        -------
        amax : array_like
            New array holding the result.
            If ``out`` was specified, ``out`` is returned.

        See Also
        --------
        maximum_fill_value
            Returns the maximum filling value for a given datatype.

        R$RTR�R�R;s>Masked data information would be lost in one or more location.N(R�R�RrR�R|RARzRRR?R�R�R@R	RjR�RR8R�RhR�R$R�R�R�RR(	R'RTR�R	R$RfRR7R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRzs00	
		!cCs�|dkrD|jd|d|�}||jd|d|�8}|S|jd|d|d|�|_|jd|d|�}tj||d|dd�|S(s3
        Return (maximum - minimum) along the the given dimension
        (i.e. peak-to-peak value).

        Parameters
        ----------
        axis : {None, int}, optional
            Axis along which to find the peaks.  If None (default) the
            flattened array is used.
        out : {None, array_like}, optional
            Alternative output array in which to place the result. It must
            have the same shape and buffer length as the expected output
            but the type will be cast if necessary.
        fill_value : {var}, optional
            Value used to fill in the masked values.

        Returns
        -------
        ptp : ndarray.
            A new array holding the result, unless ``out`` was
            specified, in which case a reference to ``out`` is returned.

        RTR	R�RMRNN(R�RzR~R�R�R�(R'RTR�R	Rt	min_value((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�Cs!c
	Cs|j|j}}t|�}t|dt�}|tk	rO|jd�}n|dkr�|j|d|d|�j|�}n"t	j||d|d|d|�t
|t�r�|tkr�|}	n%|j|d|d|�}	|	|O}	|j|	�n|S(s	
        R$iRTR+R�N(
RR$RR8R�RAR�R�RR�R�RR�(
R'RRRTR�R+RR$RtmaskindicesR7((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�ds'"	
R,R4R�cCs
|j�S(N(R�(R'((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��sR�R&R�R�cCs|j}|tkr"|jj�S|dk	rA|j|�j�S|jj}|r�|jjg|D]}|t	f^qc�}x |D]}d||||<q�W|j�S|tkr�dgS|j
}tj|jj
�dt	�}d||j
�<||_
|j�S(sP
        Return the data portion of the masked array as a hierarchical Python list.

        Data items are converted to the nearest compatible Python type.
        Masked values are converted to `fill_value`. If `fill_value` is None,
        the corresponding entries in the output list will be ``None``.

        Parameters
        ----------
        fill_value : scalar, optional
            The value to use for invalid entries. Default is None.

        Returns
        -------
        result : list
            The Python list representation of the masked array.

        Examples
        --------
        >>> x = np.ma.array([[1,2,3], [4,5,6], [7,8,9]], mask=[0] + [1,0]*4)
        >>> x.tolist()
        [[1, None, 3], [None, 5, None], [7, None, 9]]
        >>> x.tolist(-999)
        [[1, -999, 3], [-999, 5, -999], [7, -999, 9]]

        R�N(R$R�RR�R�RAR�R�R�RR�R�RR�(R'R	R$R�R
RR�R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��s$	
+

		R(cCs|j|�jd|�S(sS
        Return the array data as a string containing the raw bytes in the array.

        The array is filled with a fill value before the string conversion.

        Parameters
        ----------
        fill_value : scalar, optional
            Value used to fill in the masked values. Deafult is None, in which
            case `MaskedArray.fill_value` is used.
        order : {'C','F','A'}, optional
            Order of the data item in the copy. Default is 'C'.

            - 'C'   -- C order (row major).
            - 'F'   -- Fortran order (column major).
            - 'A'   -- Any, current order of array.
            - None  -- Same as 'A'.

        See Also
        --------
        ndarray.tostring
        tolist, tofile

        Notes
        -----
        As for `ndarray.tostring`, information about the shape, dtype, etc.,
        but also about `fill_value`, will be lost.

        Examples
        --------
        >>> x = np.ma.array(np.array([[1, 2], [3, 4]]), mask=[[0, 1], [1, 0]])
        >>> x.tostring()
        '\x01\x00\x00\x00?B\x0f\x00?B\x0f\x00\x04\x00\x00\x00'

        R'(RAttostring(R'R	R'((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRI�s$R�s%scCstd��dS(s�
        Save a masked array to a file in binary format.

        .. warning::
          This function is not implemented yet.

        Raises
        ------
        NotImplementedError
            When `tofile` is called.

        sNot implemented yet, sorry...N(R�(R'tfidtseptformat((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyttofile�s
cCs�|j}|j}|dkr3t|j|�}n|jj}tjd|jdd|fd|fg�}|j|d<|j|d<|S(sy
        Transforms a masked array into a flexible-type array.

        The flexible type array that is returned will have two fields:

        * the ``_data`` field stores the ``_data`` part of the array.
        * the ``_mask`` field stores the ``_mask`` part of the array.

        Parameters
        ----------
        None

        Returns
        -------
        record : ndarray
            A new flexible-type `ndarray` with two fields: the first element
            containing a value, the second element containing the corresponding
            mask boolean. The returned record shape matches self.shape.

        Notes
        -----
        A side-effect of transforming a masked array into a flexible `ndarray` is
        that meta information (``fill_value``, ...) will be lost.

        Examples
        --------
        >>> x = np.ma.array([[1,2,3],[4,5,6],[7,8,9]], mask=[0] + [1,0]*4)
        >>> print x
        [[1 -- 3]
         [-- 5 --]
         [7 -- 9]]
        >>> print x.toflex()
        [[(1, False) (2, True) (3, False)]
         [(4, True) (5, False) (6, True)]
         [(7, False) (8, True) (9, False)]]

        R�R�RR$N(R�R$R�RhR�R�R�R(R'tddtypeR$R�trecord((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyttoflexs'		

cCsYd|jj}d|j|j|jj|jj|�t|�j|�|jf}|S(sWReturn the internal state of the masked array, for pickling
        purposes.

        tCFi(R0tfncR�R�RRIRKR�(R'tcftstate((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt__getstate__?s	c	Csf|\}}}}}}}tj|||||f�|jj|t|�||f�||_dS(skRestore the internal state of the masked array, for
        pickling 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.

        N(R�t__setstate__R$RgR	(	R'RTR
tshpttyptisftrawtmsktflv((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRVQs"cCs%t|j|jddf|j�fS(s6Return a 3-tuple for pickling a MaskedArray.

        iR�(i(t_mareconstructt	__class__R�RU(R'((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt
__reduce__bscCs�ddlm}tjt|�|dt�}|dkrCi}n||t|�<x3|jj	�D]"\}}|||�|j|<qcW|S(Ni����(tdeepcopyR,(
R,R`RR�RR"R�R.R�t	iteritems(R'tmemoR`tcopiedtktv((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt__deepcopy__js	N(�R�R�R�t__array_priority__R�t_defaultmaskRt_defaulthardmaskR�R�R�R"R�RAR�R�RR�R�R�R�R�R�t	_set_maskR�tpropertyR!R�R�t
recordmaskRNR�thardmaskR�t
sharedmaskR�t	baseclassR�RR R�R�R�RR�R	RAR)R(RHR�R�RRRRRRRRRR	R
RRR
RRRRRRRRRR RR"R!R/R�R&R�R�R�R�R�RQR1RRR�R�R�R1R�R�R0R}RR�R�R�R�RRRR�R~RFRzR�R�R,R4R�tTR�R&R�R�RIRMRPt	torecordsRURVR_Rf(((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR
s
-	{		1 	(	/	L			
7															'	H	C	&		!	!														
							
	
	 	 D		8D		/$	f
D9F2C%'	6*&	T;(<!L&	4			cCsLtj|||�}tjt|t|��}|j||d|d|�S(sbInternal function that builds a new MaskedArray from the
    information stored in a pickle.

    R!R�(R�R�Rg(RGRot	baseshapetbasetypeRR$((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR]uscBszeZdZeddd�Zd�Zede�Zd�Z	d�Z
d�Zd�Zd�Z
dd	�Zd
�ZRS(sN
    Fake a 'void' object to use for masked array with structured dtypes.
    cCs�|p|j}tdd|�}||d<|j|�}|tk	r�t|tj�rd||_q�ytj|�|_Wq�tk
r�t	|�}tj
|d|�d|_q�Xn|dk	r�||_n|S(NR�((((
R�R�RR�R�R�RR$R�RgRR�R	(R'R R!R�R	RR�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��s

#cCs|jt�dS(N((RR�(R'((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��sR�cCs.|j}|tk	r#||r#tS|j|S(sGet the index...(R$R�RjR(R'R�RF((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��s	cCs0||j|<|j|ct|dt�O<dS(NR$(RR$R8R(R'R�Rx((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��s
cCs�|j}|tkr"|jj�St|�}t|�sG|jj�S|jj�}t}|j�sqd}nt	|�}gt
||�D](\}}t	|�|ft|�^q�}ddj|�S(NsN/As(%s)s, (
R$R�RRHR�RR�RvR�R�R�R�tjoin(R'RFR�tpR
t_m((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRH�s	

	>cCs�|j}|tkr"|jj�St|�}t|�sG|jj�St}|j�so|j|j	�j�St
|�}gt|jj�|�D](\}}t
|�|ft
|�^q�}ddj|�S(Ns(%s)s, (R$R�RR�R�RRvR�RAR	R�R�R�R�Rt(R'RFRuR
RvR�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��s	

Gccso|j|j}}|tkr8xI|D]}|Vq&Wn3x0t||�D]\}}|rbtVqH|VqHWdS(sDefines an iterator for mvoidN(RR$R�R�Rj(R'RR$RDRF((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRm�s
cCst|�j|�dS(s�
        Return a copy with masked fields filled with a given value.

        Parameters
        ----------
        fill_value : scalar, optional
            The value to use for invalid entries (None by default).
            If None, the `fill_value` attribute is used instead.

        Returns
        -------
        filled_void:
            A `np.void` object

        See Also
        --------
        MaskedArray.filled

    ((RRA(R'R	((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRA�scCs�|j}|tkr"|jj�Sg}xLt|j|j�D]5\}}|r`|jd�q>|j|j��q>Wt|�S(s�
    Transforms the mvoid object into a tuple.

    Masked fields are replaced by None.

    Returns
    -------
    returned_tuple
        Tuple of fields
        N(	R$R�RR�R�R�R�R�R�(R'R$RRDRF((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��s	
"N(R�R�R�R�R�R�R�RkRR�R�RHR�RmRAR�(((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��s						
cCs
t|t�S(s�
    Test whether input is an instance of MaskedArray.

    This function returns True if `x` is an instance of MaskedArray
    and returns False otherwise.  Any object is accepted as input.

    Parameters
    ----------
    x : object
        Object to test.

    Returns
    -------
    result : bool
        True if `x` is a MaskedArray.

    See Also
    --------
    isMA : Alias to isMaskedArray.
    isarray : Alias to isMaskedArray.

    Examples
    --------
    >>> import numpy.ma as ma
    >>> a = np.eye(3, 3)
    >>> a
    array([[ 1.,  0.,  0.],
           [ 0.,  1.,  0.],
           [ 0.,  0.,  1.]])
    >>> m = ma.masked_values(a, 0)
    >>> m
    masked_array(data =
     [[1.0 -- --]
     [-- 1.0 --]
     [-- -- 1.0]],
          mask =
     [[False  True  True]
     [ True False  True]
     [ True  True False]],
          fill_value=0.0)
    >>> ma.isMaskedArray(a)
    False
    >>> ma.isMaskedArray(m)
    True
    >>> ma.isMaskedArray([0, 1, 2])
    False

    (R�R(R*((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRV	s1RcBsseZejd�ZZeje�ZZe	Z
d�Zd�Zd�Z
d�Zd�Zd�Zd�ZRS(gcCs|jj|�S(N(RR(R'((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�GscCsdS(N((R'R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�JscCs|S(N((R'R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�MscCs
ttj�S(N(R�RvR�(R'((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRHPscCsdS(NRj((R'((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�SscCst|jgdtdtg�S(NR�R!(RkRR�R"(R'((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR&VscCs
|jdfS(s.Override of MaskedArray's __reduce__.
        ((R^(R'((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR_Ys(R�R�R�RRR R"R$R!R�R�R�R�R�RHR�R&R_(((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRAs						cCs@t|d|d|d|d|	d|d|d|d|
d	|�	S(
s.array(data, dtype=None, copy=False, order=False, mask=nomask,
             fill_value=None, keep_mask=True, hard_mask=False, shrink=True,
             subok=True, ndmin=0)

    Acts as shortcut to MaskedArray, with options in a different order
    for convenience.  And backwards compatibility...

    R!R�R,RR�R�R	R�Rb(R(R R�R,R'R!R	R�R�RbRR�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRes
!cCs0t|�}|tkrtS|j�r,tStS(s�
    Determine whether input has masked values.

    Accepts any object as input, but always returns False unless the
    input is a MaskedArray containing masked values.

    Parameters
    ----------
    x : array_like
        Array to check for masked values.

    Returns
    -------
    result : bool
        True if `x` is a MaskedArray with masked values, False otherwise.

    Examples
    --------
    >>> import numpy.ma as ma
    >>> x = ma.masked_equal([0, 1, 0, 2, 3], 0)
    >>> x
    masked_array(data = [-- 1 -- 2 3],
          mask = [ True False  True False False],
          fill_value=999999)
    >>> ma.is_masked(x)
    True
    >>> x = ma.masked_equal([0, 1, 0, 2, 3], 42)
    >>> x
    masked_array(data = [0 1 0 2 3],
          mask = False,
          fill_value=999999)
    >>> ma.is_masked(x)
    False

    Always returns False if `x` isn't a MaskedArray.

    >>> x = [False, True, False]
    >>> ma.is_masked(x)
    False
    >>> x = 'a string'
    >>> ma.is_masked(x)
    False

    (RJR�RRR"(R*RF((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRXws-t_extrema_operationcBs/eZdZdd�Zdd�Zd�ZRS(s�
    Generic class for maximum/minimum functions.

    .. note::
      This is the base class for `_maximum_operation` and
      `_minimum_operation`.

    cCs5|dkr|j|�St|j||�||�S(sExecutes the call behavior.N(R�R�R�tcompare(R'R
R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR+�s
cCst|dtdt�}t|�}|dk	r@i|d6}n-i}|j�}|tk	rm|j�}n|tkr�|jj||�}n{|j	|j
|��jt|��}|jj||�}t
jj||�}t|d�r�||_n|rt}n|S(s#Reduce target along the given axis.R,RRTR$N(R�RR"RJR�R�R�tufuncR�RAtfill_value_funcRRR)RbR�R$Rj(R'RSRTRFtkargsRV((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��s$'	cCs�t|�}t|�}|tkr9|tkr9t}n*t|�}t|�}tj||�}|jjt|�t|��}t|t�s�|j	t�}n||_
|S(s<Return the function applied to the outer product of a and b.(RJR�RKRdR�RyRAR�RRR$(R'R
R�RQRRRFR((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��s	!	N(R�R�R�R�R+R�R�(((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRw�st_minimum_operationcBseZdZd�ZRS(sObject to calculate minimacCs+tj|_t|_t|_t|_dS(sVminimum(a, b) or minimum(a)
In one argument case, returns the scalar minimum.
        N(	R)RRyR
tafuncR[RxR�Rz(R'((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR(�s		(R�R�R�R((((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR|�st_maximum_operationcBseZdZd�ZRS(sObject to calculate maximacCs+tj|_t|_t|_t|_dS(s`maximum(a, b) or maximum(a)
           In one argument case returns the scalar maximum.
        N(	R)R{RyRR}RLRxR|Rz(R'((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR(�s		(R�R�R�R((((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR~�scCs]y |jd|d|d|�SWn6ttfk
rXt|�jd|d|d|�SXdS(NRTR	R�(R~RR�R (R�RTR�R	((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR~�s cCs]y |jd|d|d|�SWn6ttfk
rXt|�jd|d|d|�SXdS(NRTR	R�(RzRR�R (R�RTR�R	((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRzs cCsZy|j|d|d|�SWn6ttfk
rUt|�jd|d|d|�SXdS(s+a.ptp(axis=None) =  a.max(axis)-a.min(axis)R�R	RTN(R�RR�R (R�RTR�R	((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�st_frommethodcBs)eZdZd�Zd�Zd�ZRS(s�
    Define functions from existing MaskedArray methods.

    Parameters
    ----------
    methodname : str
        Name of the method to transform.

    cCs||_|j�|_dS(N(R�R�R�(R'R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR((s	cCsmtt|jd�p'tt|jd�}|jt|�}|dk	rid|t|dd�f}|SdS(s<Return the doc of the function (from the doc of the method).s	    %s
%sR�N(R8RR�R�R�R�(R'tmetht	signatureR�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�,scOs�|j}t||d�}|dk	r4|||�Stt|d�}|dk	rh|t|�||�Stt|�}||||�S(N(R�R8R�RR�(R'R
RBR�tmethod_nametmethod((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR+5s	
(R�R�R�R(R�R+(((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRs				R�R*cCs+t|�}|j|d|d|d|�S(s
    RTR�R+(RkR�(R
RRRTR�R+((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�^scCs�|dk	rtd��nt|�}t|�}t||�}t|�}t|�}t|t�rxt|�}nt}tj	�}	zDtj
dddd�tj||tj
||��j|�}
Wdtj
|	�X|
j|�tjtj|
jt���}|tk	r>|
js&tStj||�|
_n|j�r�|
jsWtS|
jtkrr||
_n|
j|
j|<n|
S(s>
    Returns element-wise base array raised to power from second array.

    This is the masked array version of `numpy.power`. For details see
    `numpy.power`.

    See Also
    --------
    numpy.power

    Notes
    -----
    The *out* argument to `numpy.power` is not supported, `third` has to be
    None.

    s3-argument power not supported.R6R<R%N(R�RRJRiRIR�RRR�R=R>R�R)R�RRARcR#R�R�R?RjRdR$RR	R(R
R�tthirdRQRRRFtfatfbRsRRR%((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�fs8.
!		R?cCse|dkrt|�}nt||�}|dkrL|jd|d|�S|j|d|d|�S(s)Function version of the eponymous method.R�R'N(R�R2RAR(R
RTR�R'R	RD((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�scCs:|dkrt|�}nt||�}|jd|�S(s)Function version of the eponymous method.RTN(R�R2RAR(R
RTR	RD((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�scCsO|dkr0t|�}y|}Wq0q0Xnt||�}|jd|�S(s)Function version of the eponymous method.RTN(R�R2RAR(R
RTR	RD((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�scCs�t|dtdt�}|dkr9|j�}d}n|dkri|rZt|�}qot|�}n|}tj|j�j	�}t
||�jd|d|d|�||<||S(s)Function version of the eponymous method.R,RiRTR�R'N(R�R"R�R&R�R|R�RRR�R�RAR(R
RTR�R'R@R	RAR�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��s	+cCs-t|�tkrtj|�S|j�SdS(s
    Return all the non-masked data as a 1-D array.

    This function is equivalent to calling the "compressed" method of a
    `MaskedArray`, see `MaskedArray.compressed` for details.

    See Also
    --------
    MaskedArray.compressed
        Equivalent method.

    N(RJR�R�R R)(R*((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR)�s

cCs�tjg|D]}t|�^q
|�}t|�}|j|�}x(|D]}t|�tk	rMPqMqMW|Stjg|D]}t|�^q~|�}|jj	r�|j
�r�t|_n|j|j
�|_|S(sK
    Concatenate a sequence of arrays along the given axis.

    Parameters
    ----------
    arrays : sequence of array_like
        The arrays must have the same shape, except in the dimension
        corresponding to `axis` (the first, by default).
    axis : int, optional
        The axis along which the arrays will be joined. Default is 0.

    Returns
    -------
    result : MaskedArray
        The concatenated array with any masked entries preserved.

    See Also
    --------
    numpy.concatenate : Equivalent function in the top-level NumPy module.

    Examples
    --------
    >>> import numpy.ma as ma
    >>> a = ma.arange(3)
    >>> a[1] = ma.masked
    >>> b = ma.arange(2, 5)
    >>> a
    masked_array(data = [0 -- 2],
                 mask = [False  True False],
           fill_value = 999999)
    >>> b
    masked_array(data = [2 3 4],
                 mask = False,
           fill_value = 999999)
    >>> ma.concatenate([a, b])
    masked_array(data = [0 -- 2 2 3 4],
                 mask = [False  True False False False False],
           fill_value = 999999)

    (R�R*RIRRRJR�RKR�RRR$R�R�(RRTR
RDRR R*tdm((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR*�s)+
+cCs5t|t�r|j|�St|dt�j|�S(NR,(R�RR/RkR(R
RT((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR/-s
cCsLtj||�jt�}t|�tk	rHtj|j|�|_n|S(s
    Extract a diagonal or construct a diagonal array.

    This function is the equivalent of `numpy.diag` that takes masked
    values into account, see `numpy.diag` for details.

    See Also
    --------
    numpy.diag : Equivalent function for ndarrays.

    (R�R3RRRJR�R$(ReRdRy((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR34scCsat||�}t|t�r]|j}|j�}||_|jtk	r]||j_q]n|S(s�
    Expand the shape of an array.

    Expands the shape of the array by including a new axis before the one
    specified by the `axis` parameter. This function behaves the same as
    `numpy.expand_dims` but preserves masked elements.

    See Also
    --------
    numpy.expand_dims : Equivalent function in top-level NumPy module.

    Examples
    --------
    >>> import numpy.ma as ma
    >>> x = ma.array([1, 2, 4])
    >>> x[1] = ma.masked
    >>> x
    masked_array(data = [1 -- 4],
                 mask = [False  True False],
           fill_value = 999999)
    >>> np.expand_dims(x, axis=0)
    array([[1, 2, 4]])
    >>> ma.expand_dims(x, axis=0)
    masked_array(data =
     [[1 -- 4]],
                 mask =
     [[False  True False]],
           fill_value = 999999)

    The same result can be achieved using slicing syntax with `np.newaxis`.

    >>> x[np.newaxis, :]
    masked_array(data =
     [[1 -- 4]],
                 mask =
     [[False  True False]],
           fill_value = 999999)

    (t
n_expand_dimsR�RR�RR$R�(R*RTRt	new_shape((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR=Fs(		cCsit|�}|tkr:tjt|�|�}t|�Stjt|d�|�}t|d|�SdS(s�
    Shift the bits of an integer to the left.

    This is the masked array version of `numpy.left_shift`, for details
    see that function.

    See Also
    --------
    numpy.left_shift

    iR!N(RJR�R)RZRARk(R
R�RFRD((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRZxs
cCsit|�}|tkr:tjt|�|�}t|�Stjt|d�|�}t|d|�SdS(s�
    Shift the bits of an integer to the right.

    This is the masked array version of `numpy.right_shift`, for details
    see that function.

    See Also
    --------
    numpy.right_shift

    iR!N(RJR�R)R�RARk(R
R�RFRD((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��s
cCsQy|j||d|�SWn0tk
rLt|dt�j||d|�SXdS(s�
    Set storage-indexed locations to corresponding values.

    This function is equivalent to `MaskedArray.put`, see that method
    for details.

    See Also
    --------
    MaskedArray.put

    R+R,N(R�RR�R(R
RRR,R+((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��s

cCs8t|t�s!|jt�}nt|�t|�}}t|�tkr�|tk	rt|_t|j	|j
�|_tj
|j|d|�qn�|jr�|tk	r|jj�}tj
||d|�|j|O_qn4|tkrt|�}ntj
|j|d|�tj
|j|d|�dS(sQ
    Changes elements of an array based on conditional and input values.

    This is the masked array version of `numpy.putmask`, for details see
    `numpy.putmask`.

    See Also
    --------
    numpy.putmask

    Notes
    -----
    Using a masked array as `values` will **not** transform a `ndarray` into
    a `MaskedArray`.

    R�N(R�RRRIRJR�R"R�RhR�R�R$R�R@R�R,R!RKR(R
R!R,tvaldatatvalmaskRF((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��s$		cCsHy|j|�SWn0tk
rCt|dt�j|�jt�SXdS(s�
    Permute the dimensions of an array.

    This function is exactly equivalent to `numpy.transpose`.

    See Also
    --------
    numpy.transpose : Equivalent function in top-level NumPy module.

    Examples
    --------
    >>> import numpy.ma as ma
    >>> x = ma.arange(4).reshape((2,2))
    >>> x[1, 1] = ma.masked
    >>>> x
    masked_array(data =
     [[0 1]
     [2 --]],
                 mask =
     [[False False]
     [False  True]],
           fill_value = 999999)
    >>> ma.transpose(x)
    masked_array(data =
     [[0 2]
     [1 --]],
                 mask =
     [[False False]
     [False  True]],
           fill_value = 999999)

    R,N(R�RR�RRR(R
taxes((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��s"
R(cCsZy|j|d|�SWn<tk
rUt|dt�j|d|�}|jt�SXdS(s�
    Returns an array containing the same data with a new shape.

    Refer to `MaskedArray.reshape` for full documentation.

    See Also
    --------
    MaskedArray.reshape : equivalent function

    R'R,N(R�RR�RRR(R
R�R't_tmp((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�s

!cCsgt|�}|tk	r-tj||�}ntj||�jt|��}|jrc||_n|S(s4
    Return a new masked array with the specified size and shape.

    This is the masked equivalent of the `numpy.resize` function. The new
    array is filled with repeated copies of `x` (in the order that the
    data are stored in memory). If `x` is masked, the new array will be
    masked, and the new mask will be a repetition of the old one.

    See Also
    --------
    numpy.resize : Equivalent function in the top level NumPy module.

    Examples
    --------
    >>> import numpy.ma as ma
    >>> a = ma.array([[1, 2] ,[3, 4]])
    >>> a[0, 1] = ma.masked
    >>> a
    masked_array(data =
     [[1 --]
     [3 4]],
                 mask =
     [[False  True]
     [False False]],
           fill_value = 999999)
    >>> np.resize(a, (3, 3))
    array([[1, 2, 3],
           [4, 1, 2],
           [3, 4, 1]])
    >>> ma.resize(a, (3, 3))
    masked_array(data =
     [[1 -- 3]
     [4 1 --]
     [3 4 1]],
                 mask =
     [[False  True False]
     [False False  True]
     [False False False]],
           fill_value = 999999)

    A MaskedArray is always returned, regardless of the input type.

    >>> a = np.array([[1, 2] ,[3, 4]])
    >>> ma.resize(a, (3, 3))
    masked_array(data =
     [[1 2 3]
     [4 1 2]
     [3 4 1]],
                 mask =
     False,
           fill_value = 999999)

    (RJR�R�R�RRR?R$(R*R�RFR((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�s7!	cCstjt|��S(s*maskedarray version of the numpy function.(R�R�RI(R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�SscCstjt|��S(s*maskedarray version of the numpy function.(R�R�RI(R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�XscCstjt|�|�S(s*maskedarray version of the numpy function.(R�R�RI(R�RT((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�]scCs�|dkr+|dkr+t|d�j�S|dksC|dkrRtd��nt|d�jt�}tj|�}t|�}t|�}|t	kr�|j
}n6|t	kr�|j
}ntj|j
|j
gg�}tj|j
d|�jt�}|j}	tj|	|j|�d|�tj|	|j|�d|�tj|j
dt�}
|_tj|
t|�d|�tj|
t|�d|�|
t|�O}
|
j�s�t|_n|S(s�
    Return a masked array with elements from x or y, depending on condition.

    Returns a masked array, shaped like condition, where the elements
    are from `x` when `condition` is True, and from `y` otherwise.
    If neither `x` nor `y` are given, the function returns a tuple of
    indices where `condition` is True (the result of
    ``condition.nonzero()``).

    Parameters
    ----------
    condition : array_like, bool
        The condition to meet. For each True element, yield the corresponding
        element from `x`, otherwise from `y`.
    x, y : array_like, optional
        Values from which to choose. `x` and `y` need to have the same shape
        as condition, or be broadcast-able to that shape.

    Returns
    -------
    out : MaskedArray or tuple of ndarrays
        The resulting masked array if `x` and `y` were given, otherwise
        the result of ``condition.nonzero()``.

    See Also
    --------
    numpy.where : Equivalent function in the top-level NumPy module.

    Examples
    --------
    >>> x = np.ma.array(np.arange(9.).reshape(3, 3), mask=[[0, 1, 0],
    ...                                                    [1, 0, 1],
    ...                                                    [0, 1, 0]])
    >>> print x
    [[0.0 -- 2.0]
     [-- 4.0 --]
     [6.0 -- 8.0]]
    >>> np.ma.where(x > 5)    # return the indices where x > 5
    (array([2, 2]), array([0, 2]))

    >>> print np.ma.where(x > 5, x, -3.1416)
    [[-3.1416 -- -3.1416]
     [-- -3.1416 --]
     [6.0 -- 8.0]]

    is/Either both or neither x and y should be given.R�R�N(R�RAR�RR�RR�RcRIRjR�tfind_common_typeR9R�RRRR@R�R$RJRKRR�(RtR*R�tfctnotfctxvtyvR�RDRR$((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�fs0/!	cCsd�}d�}t|d�}g|D]}||�^q(}g|D]}||�^qG}	tj||d|�}
tt|
t|��dddt�}
tj||	d|d|�jt�}|dk	r�t
|t�r�|j|
�n|S|j|
�|S(	s6
    Use an index array to construct a new array from a set of choices.

    Given an array of integers and a set of n choice arrays, this method
    will create a new array that merges each of the choice arrays.  Where a
    value in `a` is i, the new array will have the value that choices[i]
    contains in the same place.

    Parameters
    ----------
    a : ndarray of ints
        This array must contain integers in ``[0, n-1]``, where n is the
        number of choices.
    choices : sequence of arrays
        Choice arrays. The index array and all of the choices should be
        broadcastable to the same shape.
    out : array, optional
        If provided, the result will be inserted into this array. It should
        be of the appropriate shape and `dtype`.
    mode : {'raise', 'wrap', 'clip'}, optional
        Specifies how out-of-bounds indices will behave.

        * 'raise' : raise an error
        * 'wrap' : wrap around
        * 'clip' : clip to the range

    Returns
    -------
    merged_array : array

    See Also
    --------
    choose : equivalent function

    Examples
    --------
    >>> choice = np.array([[1,1,1], [2,2,2], [3,3,3]])
    >>> a = np.array([2, 1, 0])
    >>> np.ma.choose(a, choice)
    masked_array(data = [3 2 1],
          mask = False,
          fill_value=999999)

    cSs|tkrtSt|�S(s,Returns the filled array, or True if masked.(RjR"RA(R*((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pytfmask�scSs|tkrtSt|�S(s:Returns the mask, True if ``masked``, False if ``nomask``.(RjR"RJ(R*((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pytnmask�siR+R,RbR�N(RAR�R%RfRiRJR"RRR�R�R�(RRtchoicesR�R+R�R�R�R*tmasksR t
outputmaskRD((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR%�s-		'
cCsa|dkrtj|||�Stjt|�||�t|d�rYt|�|_n|SdS(s�
    Return a copy of a, rounded to 'decimals' places.

    When 'decimals' is negative, it specifies the number of positions
    to the left of the decimal point.  The real and imaginary parts of
    complex numbers are rounded separately. Nothing is done if the
    array is not of float type and 'decimals' is greater than or equal
    to 0.

    Parameters
    ----------
    decimals : int
        Number of decimals to round to. May be negative.
    out : array_like
        Existing array to use for output.
        If not given, returns a default copy of a.

    Notes
    -----
    If out is given and does not have a mask attribute, the mask of a
    is lost!

    R$N(R�R�R�RIR�RJR$(R
R>R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��scCsyt|d�}t|d�}t|j�dkr?d|_nt|j�dkr`d|_ntj||�jt�S(s�
    Returns the inner product of a and b for arrays of floating point types.

    Like the generic NumPy equivalent the product sum is over the last dimension
    of a and b.

    Notes
    -----
    The first argument is not conjugated.

    ii(i(i(RAR�R�R�RSRR(R
R�R�R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRSss Masked values are replaced by 0.cCs�t|d�j�}t|d�j�}tj||�}t|�}t|�}|tkrv|tkrvt|�St|�}t|�}tdtjd|d|�dd�}t|d|�S(s*maskedarray version of the numpy function.iiR,R!(	RAR�R�R�RJR�RkRKRf(R
R�R�R�RDRQRRRF((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�5s
*cCs�tt|�t|��}|tkr[t|�}t|�}tj||�}|j�S|r�t|�}t|�}tj||�}t|d|dt�}|j	t
�jd�StSdS(s�
    Return True if all entries of a and b are equal, using
    fill_value as a truth value where either or both are masked.

    Parameters
    ----------
    a, b : array_like
        Input arrays to compare.
    fill_value : bool, optional
        Whether masked values in a or b are considered equal (True) or not
        (False).

    Returns
    -------
    y : bool
        Returns True if the two arrays are equal within the given
        tolerance, False otherwise. If either array contains NaN,
        then False is returned.

    See Also
    --------
    all, any
    numpy.ma.allclose

    Examples
    --------
    >>> a = ma.array([1e10, 1e-7, 42.0], mask=[0, 0, 1])
    >>> a
    masked_array(data = [10000000000.0 1e-07 --],
          mask = [False False  True],
          fill_value=1e+20)

    >>> b = array([1e10, 1e-7, -42.0])
    >>> b
    array([  1.00000000e+10,   1.00000000e-07,  -4.20000000e+01])
    >>> ma.allequal(a, b, fill_value=False)
    False
    >>> ma.allequal(a, b)
    True

    R!R,N(RiRJR�RIR)R;RRRRAR"R�(R
R�R	RFR*R�RDR�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR
Fs*
c
Csot|dt�}t|dt�}tt|�t|��}tjt|dtd|��jt�}tj|ttj|�t�k�s�tStj|�s�tt	j
t	j||�||t	j|��|�}	tj|	�Stjt||||k|��stS||}||}tt	j
t	j||�||t	j|��|�}	tj|	�S(s-
    Returns True if two arrays are element-wise equal within a tolerance.

    This function is equivalent to `allclose` except that masked values
    are treated as equal (default) or unequal, depending on the `masked_equal`
    argument.

    Parameters
    ----------
    a, b : array_like
        Input arrays to compare.
    masked_equal : bool, optional
        Whether masked values in `a` and `b` are considered equal (True) or not
        (False). They are considered equal by default.
    rtol : float, optional
        Relative tolerance. The relative difference is equal to ``rtol * b``.
        Default is 1e-5.
    atol : float, optional
        Absolute tolerance. The absolute difference is equal to `atol`.
        Default is 1e-8.

    Returns
    -------
    y : bool
        Returns True if the two arrays are equal within the given
        tolerance, False otherwise. If either array contains NaN, then
        False is returned.

    See Also
    --------
    all, any
    numpy.allclose : the non-masked `allclose`.

    Notes
    -----
    If the following equation is element-wise True, then `allclose` returns
    True::

      absolute(`a` - `b`) <= (`atol` + `rtol` * absolute(`b`))

    Return True if all elements of `a` and `b` are equal subject to
    given tolerances.

    Examples
    --------
    >>> a = ma.array([1e10, 1e-7, 42.0], mask=[0, 0, 1])
    >>> a
    masked_array(data = [10000000000.0 1e-07 --],
                 mask = [False False  True],
           fill_value = 1e+20)
    >>> b = ma.array([1e10, 1e-8, -42.0], mask=[0, 0, 1])
    >>> ma.allclose(a, b)
    False

    >>> a = ma.array([1e10, 1e-8, 42.0], mask=[0, 0, 1])
    >>> b = ma.array([1.00001e10, 1e-9, -42.0], mask=[0, 0, 1])
    >>> ma.allclose(a, b)
    True
    >>> ma.allclose(a, b, masked_equal=False)
    False

    Masked values are not compared directly.

    >>> a = ma.array([1e10, 1e-8, 42.0], mask=[0, 0, 1])
    >>> b = ma.array([1.00001e10, 1e-9, 42.0], mask=[0, 0, 1])
    >>> ma.allclose(a, b)
    True
    >>> ma.allclose(a, b, masked_equal=False)
    False

    R,R!(RkRRiRJR�tisinfRARRR)R\R(
R
R�RlR~RR*R�RFtxinfRD((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR	s&H*'	
&	c
Cs"t|d|dtdtdt�S(s

    Convert the input to a masked array of the given data-type.

    No copy is performed if the input is already an `ndarray`. If `a` is
    a subclass of `MaskedArray`, a base class `MaskedArray` is returned.

    Parameters
    ----------
    a : array_like
        Input data, in any form that can be converted to a masked array. This
        includes lists, lists of tuples, tuples, tuples of tuples, tuples
        of lists, ndarrays and masked arrays.
    dtype : dtype, optional
        By default, the data-type is inferred from the input data.
    order : {'C', 'F'}, optional
        Whether to use row-major ('C') or column-major ('FORTRAN') memory
        representation.  Default is 'C'.

    Returns
    -------
    out : MaskedArray
        Masked array interpretation of `a`.

    See Also
    --------
    asanyarray : Similar to `asarray`, but conserves subclasses.

    Examples
    --------
    >>> x = np.arange(10.).reshape(2, 5)
    >>> x
    array([[ 0.,  1.,  2.,  3.,  4.],
           [ 5.,  6.,  7.,  8.,  9.]])
    >>> np.ma.asarray(x)
    masked_array(data =
     [[ 0.  1.  2.  3.  4.]
     [ 5.  6.  7.  8.  9.]],
                 mask =
     False,
           fill_value = 1e+20)
    >>> type(np.ma.asarray(x))
    <class 'numpy.ma.core.MaskedArray'>

    R�R,R�R(RkRR"(R
R�R'((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR�s-c
Cs"t|d|dtdtdt�S(s�
    Convert the input to a masked array, conserving subclasses.

    If `a` is a subclass of `MaskedArray`, its class is conserved.
    No copy is performed if the input is already an `ndarray`.

    Parameters
    ----------
    a : array_like
        Input data, in any form that can be converted to an array.
    dtype : dtype, optional
        By default, the data-type is inferred from the input data.
    order : {'C', 'F'}, optional
        Whether to use row-major ('C') or column-major ('FORTRAN') memory
        representation.  Default is 'C'.

    Returns
    -------
    out : MaskedArray
        MaskedArray interpretation of `a`.

    See Also
    --------
    asarray : Similar to `asanyarray`, but does not conserve subclass.

    Examples
    --------
    >>> x = np.arange(10.).reshape(2, 5)
    >>> x
    array([[ 0.,  1.,  2.,  3.,  4.],
           [ 5.,  6.,  7.,  8.,  9.]])
    >>> np.ma.asanyarray(x)
    masked_array(data =
     [[ 0.  1.  2.  3.  4.]
     [ 5.  6.  7.  8.  9.]],
                 mask =
     False,
           fill_value = 1e+20)
    >>> type(np.ma.asanyarray(x))
    <class 'numpy.ma.core.MaskedArray'>

    R�R,R�R(RkRR"(R
R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR 
s+cCs1t|d�s!t|d�}ntj||�S(s
    Pickle a masked array to a file.

    This is a wrapper around ``cPickle.dump``.

    Parameters
    ----------
    a : MaskedArray
        The array to be pickled.
    F : str or file-like object
        The file to pickle `a` to. If a string, the full path to the file.

    treadlinetw(R�topentcPickleR7(R
tF((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR7>scCs
tj|�S(s
    Return a string corresponding to the pickling of a masked array.

    This is a wrapper around ``cPickle.dumps``.

    Parameters
    ----------
    a : MaskedArray
        The array for which the string representation of the pickle is
        returned.

    (R�R8(R
((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR8Ps
cCs.t|d�s!t|d�}ntj|�S(sz
    Wrapper around ``cPickle.load`` which accepts either a file-like object
    or a filename.

    Parameters
    ----------
    F : str or file
        The file or file name to load.

    See Also
    --------
    dump : Pickle an array

    Notes
    -----
    This is different from `numpy.load`, which does not use cPickle but loads
    the NumPy binary .npy format.

    R�R�(R�R�R�R](R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR]_scCs
tj|�S(s
    Load a pickle from the current string.

    The result of ``cPickle.loads(strg)`` is returned.

    Parameters
    ----------
    strg : str
        The string to load.

    See Also
    --------
    dumps : Return a string corresponding to the pickling of a masked array.

    (R�R^(tstrg((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR^wsR�cCstd��dS(NsNot yet implemented. Sorry(R�(tfileR�R/RK((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pytfromfile�scCst|dd|d�S(s�
    Build a masked array from a suitable flexible-type array.

    The input array has to have a data-type with ``_data`` and ``_mask``
    fields. This type of array is output by `MaskedArray.toflex`.

    Parameters
    ----------
    fxarray : ndarray
        The structured input array, containing ``_data`` and ``_mask``
        fields. If present, other fields are discarded.

    Returns
    -------
    result : MaskedArray
        The constructed masked array.

    See Also
    --------
    MaskedArray.toflex : Build a flexible-type array from a masked array.

    Examples
    --------
    >>> x = np.ma.array(np.arange(9).reshape(3, 3), mask=[0] + [1, 0] * 4)
    >>> rec = x.toflex()
    >>> rec
    array([[(0, False), (1, True), (2, False)],
           [(3, True), (4, False), (5, True)],
           [(6, False), (7, True), (8, False)]],
          dtype=[('_data', '<i4'), ('_mask', '|b1')])
    >>> x2 = np.ma.fromflex(rec)
    >>> x2
    masked_array(data =
     [[0 -- 2]
     [-- 4 --]
     [6 -- 8]],
                 mask =
     [[False  True False]
     [ True False  True]
     [False  True False]],
           fill_value = 999999)

    Extra fields can be present in the structured array but are discarded:

    >>> dt = [('_data', '<i4'), ('_mask', '|b1'), ('field3', '<f4')]
    >>> rec2 = np.zeros((2, 2), dtype=dt)
    >>> rec2
    array([[(0, False, 0.0), (0, False, 0.0)],
           [(0, False, 0.0), (0, False, 0.0)]],
          dtype=[('_data', '<i4'), ('_mask', '|b1'), ('field3', '<f4')])
    >>> y = np.ma.fromflex(rec2)
    >>> y
    masked_array(data =
     [[0 0]
     [0 0]],
                 mask =
     [[False False]
     [False False]],
           fill_value = 999999)

    RR!R$(Rk(tfxarray((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyRG�s>t_convert2macBs2eZdZdZdd�Zd�Zd�ZRS(s�
    Convert functions from numpy to numpy.ma.

    Parameters
    ----------
        _methodname : string
            Name of the method to transform.

    cCs4tt|�|_|j�|_|p*i|_dS(N(R8R�t_funcR�R�t_extras(R'R�R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR(�scCsZt|jdd�}t|j�}|rV|rId|jj|f}n||}n|S(s<Return the doc of the function (from the doc of the method).R�s%s%s
N(R8R�R�R�R�(R'R�R�((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��s
cOs�|j}t|�j|�}x!|D]}|j|�||<q%W|jj|||�jt�}d|kr�|jdd�|_
nd|kr�t|jdt��|_
n|S(NR	RmR�(R�tsettintersectionR�R�R+RRR�R�R	RaRR�(R'R
RBR�R�t
common_paramsRuR((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR+�s	
!N(R�R�R�R�R(R�R+(((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyR��s
		R�R	Rm(R�t
__author__t
__docformat__t__all__R�tnumpyR�R�RR
R�RRR�tnumpy.core.umathtcoreR)tnumpy.lib.function_baseRtnumpy.core.numerictypestnumerictypesR�tnumpy.compatR�R�R=R�Rtsystversion_infot	functoolsR�RR�R�R�t	ExceptionRRR"t
datetime64R�t_minvalsR�R�tfloat32tfloat64Rdtinft_maxvalsR�R�R�R2R�R�R|R�R�R�R�RR'R�RARRItget_dataRDR9R:R&R,R.R2R4R5RIRZR<R+R�R-R�RRR�R.R�RRR>R�RBR$R�RRcR�R_R`RaRRRRRR�R�RR;R�R\RMR[RLRbRRdR�ReR!R"R#ROR6R�RCR�R@R�R\RgRJtget_maskRKRWRRfRhRiR?RrRyRmRnRqRrRsRlRoRuRtRxRpR�RvR�RR�R�RERR�R�RR]R�RVRYRURRjRwRkRXRwR|R~R~RzR�RRRRRR(R0R1R,R4RNRQR{R}RR�R�R�R�R�R�R�R�R�R�R�R�R�R�RRRR�R)R*R/R3RZR�R�R�R�R�R�R�R�R�R�R%R�RSRTR�R�R
R	RR R7R8R]R^R�R�RGR�RR&R5R9R:RFRHRPRRR�t	ones_likeR�R�t
zeros_like(((s3/usr/lib64/python2.7/site-packages/numpy/ma/core.pyt<module>s�										(				
	6	6 	@		?	?	
		.	@		!.	3>R�N											#	<	7	C^1@	9	t#((=Q. 				6Fg�����������r	�	2
		87%		E
	>	2			&'	A		MJ		
9_/1					B+!		!!	!		!