Refine a field defined on the encapsulated triangulation. Parameters ---------- z : (npoints,) array-like Values of the field to refine, defined at the nodes of the encapsulated triangulation. (``n_points`` is the number of points
(self, z, triinterpolator=None, subdiv=3)
| 131 | return refi_triangulation |
| 132 | |
| 133 | def refine_field(self, z, triinterpolator=None, subdiv=3): |
| 134 | """ |
| 135 | Refine a field defined on the encapsulated triangulation. |
| 136 | |
| 137 | Parameters |
| 138 | ---------- |
| 139 | z : (npoints,) array-like |
| 140 | Values of the field to refine, defined at the nodes of the |
| 141 | encapsulated triangulation. (``n_points`` is the number of points |
| 142 | in the initial triangulation) |
| 143 | triinterpolator : `~matplotlib.tri.TriInterpolator`, optional |
| 144 | Interpolator used for field interpolation. If not specified, |
| 145 | a `~matplotlib.tri.CubicTriInterpolator` will be used. |
| 146 | subdiv : int, default: 3 |
| 147 | Recursion level for the subdivision. |
| 148 | Each triangle is divided into ``4**subdiv`` child triangles. |
| 149 | |
| 150 | Returns |
| 151 | ------- |
| 152 | refi_tri : `~matplotlib.tri.Triangulation` |
| 153 | The returned refined triangulation. |
| 154 | refi_z : 1D array of length: *refi_tri* node count. |
| 155 | The returned interpolated field (at *refi_tri* nodes). |
| 156 | """ |
| 157 | if triinterpolator is None: |
| 158 | interp = matplotlib.tri.CubicTriInterpolator( |
| 159 | self._triangulation, z) |
| 160 | else: |
| 161 | _api.check_isinstance(matplotlib.tri.TriInterpolator, |
| 162 | triinterpolator=triinterpolator) |
| 163 | interp = triinterpolator |
| 164 | |
| 165 | refi_tri, found_index = self.refine_triangulation( |
| 166 | subdiv=subdiv, return_tri_index=True) |
| 167 | refi_z = interp._interpolate_multikeys( |
| 168 | refi_tri.x, refi_tri.y, tri_index=found_index)[0] |
| 169 | return refi_tri, refi_z |
| 170 | |
| 171 | @staticmethod |
| 172 | def _refine_triangulation_once(triangulation, ancestors=None): |