Skip to content

Commit

Permalink
Don't use Delaunay with fewer than 4 points
Browse files Browse the repository at this point in the history
  • Loading branch information
tnipen committed Jan 16, 2025
1 parent 96465b8 commit 5a6d517
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bris/outputs/verif.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ def __init__(
self.opoints = gridpp.Points(self.obs_lats, self.obs_lons, self.obs_altitudes)
self.opoints_tuple = np.column_stack((self.obs_lats, self.obs_lons))


if not self._is_gridded_input:
self.triangulation = self.ipoints_tuple
if not self._is_gridded_input and len(self.ipoints_tuple[0]) > 3:
# This speeds up interpolation from irregular points to observation points
# but Delaunay needs enough points for this to work
self.triangulation = Delaunay(self.ipoints_tuple)
else:
self.triangulation = None


# The intermediate will only store the final output locations
intermediate_pm = PredictMetadata(
[variable],
Expand Down

0 comments on commit 5a6d517

Please sign in to comment.