File: constant.rst

package info (click to toggle)
cf-python 1.3.2+dfsg1-4
  • links: PTS, VCS
  • area: main
  • in suites: sid, stretch
  • size: 7,996 kB
  • sloc: python: 51,733; ansic: 2,736; makefile: 78; sh: 2
file content (25 lines) | stat: -rw-r--r-- 701 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
.. currentmodule:: cf

Constants of the :mod:`cf` module
=================================

.. data:: cf.masked

    The :attr:`cf.masked` constant allows data array values to be
    masked by direct assignment. This is consistent with the
    :ref:`behaviour of numpy masked arrays
    <numpy:maskedarray.generic.constructing>`.

    For example, masking every element of a field's data array could
    be done as follows:

    >>> f.subspace[...] = cf.masked

    To mask every element of a field's data array whose value is less
    than zero:
    
    >>> f.where(cf.lt(0), cf.masked, i=True)

    .. seealso:: `cf.Field.hardmask`, `cf.Field.subspace`,
                 `cf.Field.where`, `cf.lt`