• File: triangulation.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/tri/triangulation.pyc
  • Date Modified: 07/22/2015 11:41 PM
  • File size: 7.32 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit

]3Lc@sDddljZddljZddlZdefdYZdS(iNt
TriangulationcBseeZdZdddZedZdZdZe	dZ
edZdZRS(	s
    An unstructured triangular grid consisting of npoints points and
    ntri triangles.  The triangles can either be specified by the user
    or automatically generated using a Delaunay triangulation.

    Read-only attributes:

      *x*: array of shape (npoints).
        x-coordinates of grid points.

      *y*: array of shape (npoints).
        y-coordinates of grid points.

      *triangles*: integer array of shape (ntri,3).
        For each triangle, the indices of the three points that make
        up the triangle, ordered in an anticlockwise manner.

      *mask*: optional boolean array of shape (ntri).
        Which triangles are masked out.

      *edges*: integer array of shape (?,2).
        All edges of non-masked triangles.  Each edge is the start
        point index and end point index.  Each edge (start,end and
        end,start) appears only once.

      *neighbors*: integer array of shape (ntri,3).
        For each triangle, the indices of the three triangles that
        share the same edges, or -1 if there is no such neighboring
        triangle.  neighbors[i,j] is the triangle that is the neighbor
        to the edge from point index triangles[i,j] to point index
        triangles[i,(j+1)%3].
    cCsYtj|dtj|_tj|dtj|_|jj|jjksft|jjdkrutdnd|_	d|_
d|_|dkr8tj
|j|j}tj|jdtj|_|dkrtj|jdtj|_
tj|jdtj}tj|ddd|_qntj|dtj|_|jjdks{|jjddkrtdn|jjt|jkrtdn|jjd	krtd
n|dk	rLtj|dtj|_	t|j	jdks:|j	jd	|jjd	krLtdqLnd|_dS(
s
        Create a Triangulation object.

        The first two arguments must be:

        *x*, *y*: arrays of shape (npoints).
          Point coordinates.

        Optional arguments (args or keyword args):

        *triangles*: integer array of shape (ntri,3).
          For each triangle, the indices of the three points that make
          up the triangle.  If the points are ordered in a clockwise
          manner, they are converted to anticlockwise.

          If not specified, matplotlib.delaunay is used to create a
          Delaunay triangulation of the points.

        *mask*: optional boolean array of shape (ntri).
          Which triangles are masked out.
        tdtypeis'x and y must be equal-length 1-D arraystaxisiistriangles must be a (?,3) arrays&triangles max element is out of boundsis&triangles min element is out of boundss3mask array must have same length as triangles arrayN(tnptasarraytfloat64txtytshapetlent
ValueErrortNonetmaskt_edgest
_neighborstdelaunayRttriangle_nodestint32t	trianglestedge_dbttriangle_neighborstrolltndimtmaxtmintboolt_cpp_triangulation(tselfRRRRtdtt	neighbors((sO/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/tri/triangulation.pyt__init__&s60			!( cCs.|jdkr'|jj|_n|jS(N(R
Rtget_cpp_triangulationt	get_edges(R((sO/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/tri/triangulation.pytedgescscCsL|jdkrEtj|j|j|j|j|j|j	|_n|jS(sc
        Return the underlying C++ Triangulation object, creating it
        if necessary.
        N(
RRt_triRRRRRR
R(R((sO/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/tri/triangulation.pyRis
cCs7|jdk	r,|jjd|jddS|jSdS(sC
        Return an array of triangles that are not masked.
        iRiN(RRRtcompress(R((sO/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/tri/triangulation.pytget_masked_trianglestsc	Oslt|dtr*|d}|d}n5|d}|d}|d}t}|jdd}t}|dkrt|dkr|d}t}n|dk	rytj|dtj	}Wqt
k
rd}qXn|dk	r|jdks
|jddkrd}n|dk	r8|r8|d}t}n|jdd}t}|dkr|rt|dkr|d}t}n|dk	rytj|dtj
}Wqt
k
rd}qXn|dk	r|jdkrd}n|dk	r+|dk	r+t||jdkr+d}n|dk	rJ|rJ|d}nt||||}|||fS(	s
        Return a Triangulation object from the args and kwargs, and
        the remaining args and kwargs with the consumed values removed.

        There are two alternatives: either the first argument is a
        Triangulation object, in which case it is returned, or the args
        and kwargs are sufficient to create a new Triangulation to
        return.  In the latter case, see Triangulation.__init__ for
        the possible args and kwargs.
        iiiRRiRN(t
isinstanceRtTruetpopRtFalseR	RRRR
RRR(	targstkwargst
triangulationRRtignore_remaining_argsRt	from_argsR((sO/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/tri/triangulation.pytget_from_args_and_kwargs}sT





	

	
	%
	

		
cCs.|jdkr'|jj|_n|jS(N(RRt_get_cpp_triangulationt
get_neighbors(R((sO/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/tri/triangulation.pyRscCs|dkrd|_nbtj|dtj|_t|jjdksk|jjd|jjdkrztdn|j	dk	r|j	j
|jnd|_d|_dS(sp
        Set or clear the mask array.  This is either None, or a boolean
        array of shape (ntri).
        Riis3mask array must have same length as triangles arrayN(
RRRRRR	RRR
Rtset_maskR
R(RR((sO/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/tri/triangulation.pyR1s 	N(
t__name__t
__module__t__doc__RRtpropertyR!RR$tstaticmethodR.RR1(((sO/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/tri/triangulation.pyRs =			D(tmatplotlib.delaunayRtmatplotlib._triR"tnumpyRtobjectR(((sO/opt/alt/python27/lib64/python2.7/site-packages/matplotlib/tri/triangulation.pyt<module>s