From 897ab9c3d1be79febfbd176c63d79df0445c599f Mon Sep 17 00:00:00 2001 From: gaelforget Date: Tue, 18 Jan 2022 23:29:28 -0500 Subject: [PATCH] improve example --- .../worldwide/global_ocean_circulation.jl | 415 +++++++++++------- 1 file changed, 262 insertions(+), 153 deletions(-) diff --git a/examples/worldwide/global_ocean_circulation.jl b/examples/worldwide/global_ocean_circulation.jl index 3372be18..aa40b23e 100644 --- a/examples/worldwide/global_ocean_circulation.jl +++ b/examples/worldwide/global_ocean_circulation.jl @@ -1,5 +1,5 @@ ### A Pluto.jl notebook ### -# v0.17.3 +# v0.17.5 using Markdown using InteractiveUtils @@ -7,7 +7,7 @@ using InteractiveUtils # ╔═╡ 104ce9b0-3fd1-11ec-3eff-3b029552e3d9 begin using IndividualDisplacements, OceanStateEstimation, DataFrames, Statistics, CSV - using MeshArrays, MITgcmTools, NetCDF, Plots + using MeshArrays, MITgcmTools, NetCDF, Plots, PlutoUI "done with loading packages" end @@ -25,6 +25,9 @@ which is here repeated for `ny` years. For additional documentation e.g. see : [![simulated particle movie (5m)](https://user-images.githubusercontent.com/20276764/84766999-b801ad80-af9f-11ea-922a-610ad8a257dc.png)](https://youtu.be/W5DNqJG9jt0) """ +# ╔═╡ 171fa252-7a35-4d4a-a940-60de77327cf4 +TableOfContents() + # ╔═╡ 7fec71b4-849f-4369-bec2-26bfe2e00a97 md"""## 1. Grid and Velocity Files""" @@ -82,6 +85,9 @@ md"""## 3.4 Compute summary statistics See [DataFrames.jl](https://juliadata.github.io/DataFrames.jl/latest/) documentation for detail and additinal functionalities. """ +# ╔═╡ c5ba37e9-2a68-4448-a2cb-dea1fbf08f1e +md"""## 4. Plot Individual Displacements""" + # ╔═╡ 4b887e2f-7505-4db2-8784-400a786fba10 begin function CalcIntFac(Γ) @@ -94,6 +100,9 @@ begin "Done with interpolation coefficients for map" end +# ╔═╡ de8dbb43-68bc-4fb2-b0c8-07100b8a97a0 +md"""## 5. Helper Functions""" + # ╔═╡ af74c6c8-1859-4fdf-ae2b-5af8dccdee60 """ OceanDepthLog(Γ,IntFac) @@ -380,14 +389,6 @@ begin sgdf= combine(gdf,nrow,:lat => mean) end -# ╔═╡ e1cdcac9-c3cc-4ce4-a477-452ca460a3d5 -begin - fig=plot(;xlims=(-180,180),ylims=(-90,90),legend=:none) - p!(x,y)=scatter!(fig,x,y,markersize=1.1,markerstrokewidth=0) - [p!(gdf[i].lon,gdf[i].lat) for i in rand(collect(1:length(gdf)),10)] - fig -end - # ╔═╡ 4a7ba3ff-449a-44e1-ad10-1de15a6d31cc """ globalmap(𝐼::Individuals,background::NamedTuple) @@ -415,6 +416,35 @@ begin globalmap(𝐼,DL) end +# ╔═╡ e1cdcac9-c3cc-4ce4-a477-452ca460a3d5 +begin + + function p!(fig,x,y) + xlims=(0.,360.0) + lo=deepcopy(x); lo[findall(lo.