Skip to content

Commit

Permalink
Forgot about qmd notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
ecomodeller committed Mar 25, 2024
1 parent d905579 commit aa41377
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/examples/Dfsu-2D-interpolation.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ Let's first try the approx for a single element:
* Interpolate

```{python}
dist = dist_in_meters(scatter[:,:2], dfs.element_coordinates[0,:2])
dist = dist_in_meters(scatter[:,:2], dfs.geometry.element_coordinates[0,:2])
dist
```

Expand All @@ -179,11 +179,11 @@ np.dot(scatter[:,2], w) # interpolated value in element 0
Let's do the same for all points in the mesh and plot in the end

```{python}
dati = np.zeros((1,dfs.n_elements))
dati = np.zeros((1, dfs.n_elements))
for j in range(dfs.n_elements):
dist = dist_in_meters(scatter[:,:2], dfs.element_coordinates[j,:2])
dist = dist_in_meters(scatter[:, :2], dfs.geometry.element_coordinates[j, :2])
w = get_idw_interpolant(dist, p=2)
dati[0,j] = np.dot(scatter[:,2], w)
dati[0, j] = np.dot(scatter[:, 2], w)
```

```{python}
Expand Down

0 comments on commit aa41377

Please sign in to comment.