Skip to content

Commit cb254ac

Browse files
authored
Merge pull request #211 from gaelforget/examples_update
Examples update
2 parents 860fa4a + 8ef465c commit cb254ac

File tree

11 files changed

+2043
-83
lines changed

11 files changed

+2043
-83
lines changed

docs/make.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ makedocs(;
2929
authors="gaelforget <gforget@mit.edu>",
3030
)
3131

32-
lst=("basics.jl","geography.jl","vectors.jl","JuliaGeoDev/MeshArrays_to_Polygons.jl","JuliaGeoDev/GeometryOps_exploration.jl")
33-
pth=("tutorials","tutorials","tutorials","dev","dev")
32+
lst=("basics.jl","geography.jl","vectors.jl",
33+
"dev/MeshArrays_to_Polygons.jl","dev/GeometryOps_exploration.jl")
34+
pth=("tutorials","tutorials","tutorials",
35+
"dev","dev")
3436

3537
for ii in 1:length(lst)
3638
i=lst[ii]

docs/src/dev.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
## [JuliaGeo](@id id_JuliaGeo)
55

6-
[The Polygons notebook](MeshArrays_to_Polygons.html) ([code link](https://raw.githubusercontent.com/JuliaClimate/MeshArrays.jl/master/examples/JuliaGeoDev/MeshArrays_to_Polygons.jl)) illustrates how grids in `MeshArrays.jl` can be represented as sets of Polygons (2D) or LineStrings (3D) using [GeoInterface.jl](https://github.com/JuliaGeo/GeoInterface.jl).
6+
[The Polygons notebook](MeshArrays_to_Polygons.html) ([code link](https://raw.githubusercontent.com/JuliaClimate/MeshArrays.jl/master/examples/dev/MeshArrays_to_Polygons.jl)) illustrates how grids in `MeshArrays.jl` can be represented as sets of Polygons (2D) or LineStrings (3D) using [GeoInterface.jl](https://github.com/JuliaGeo/GeoInterface.jl).
77

8-
[The GeometryOps notebook](GeometryOps_exploration.html) ([code link](https://raw.githubusercontent.com/JuliaClimate/MeshArrays.jl/master/examples/JuliaGeoDev/GeometryOps_exploration.jl)) has a few more tests with [GeometryOps.jl](https://github.com/JuliaGeo/GeometryOps.jl).
8+
[The GeometryOps notebook](GeometryOps_exploration.html) ([code link](https://raw.githubusercontent.com/JuliaClimate/MeshArrays.jl/master/examples/dev/GeometryOps_exploration.jl)) has a few more tests with [GeometryOps.jl](https://github.com/JuliaGeo/GeometryOps.jl).
99

examples/basics.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -493,9 +493,9 @@ weakdeps = ["SparseArrays"]
493493
ChainRulesCoreSparseArraysExt = "SparseArrays"
494494
495495
[[deps.ChunkCodecCore]]
496-
git-tree-sha1 = "51f4c10ee01bda57371e977931de39ee0f0cdb3e"
496+
git-tree-sha1 = "1a3ad7e16a321667698a19e77362b35a1e94c544"
497497
uuid = "0b6fb165-00bc-4d37-ab8b-79f91016dbe1"
498-
version = "1.0.0"
498+
version = "1.0.1"
499499
500500
[[deps.ChunkCodecLibZlib]]
501501
deps = ["ChunkCodecCore", "Zlib_jll"]
@@ -1085,9 +1085,9 @@ version = "0.1.6"
10851085
10861086
[[deps.JpegTurbo_jll]]
10871087
deps = ["Artifacts", "JLLWrappers", "Libdl"]
1088-
git-tree-sha1 = "4255f0032eafd6451d707a51d5f0248b8a165e4d"
1088+
git-tree-sha1 = "b6893345fd6658c8e475d40155789f4860ac3b21"
10891089
uuid = "aacddb02-875f-59d6-b918-886e6ef4fbf8"
1090-
version = "3.1.3+0"
1090+
version = "3.1.4+0"
10911091
10921092
[[deps.JuliaSyntaxHighlighting]]
10931093
deps = ["StyledStrings"]
@@ -1275,9 +1275,9 @@ version = "0.6.7"
12751275
12761276
[[deps.MeshArrays]]
12771277
deps = ["CatViews", "Dates", "Distributed", "GeoInterface", "Glob", "LazyArtifacts", "NearestNeighbors", "Pkg", "Printf", "SharedArrays", "SparseArrays", "Statistics", "Unitful"]
1278-
git-tree-sha1 = "6b256a7d5c13337f304b79b30aa351e2142759cd"
1278+
git-tree-sha1 = "d333bc6aa00ba7be0636af73698d85b306ff49f4"
12791279
uuid = "cb8c808f-1acf-59a3-9d2b-6e38d009f683"
1280-
version = "0.5.1"
1280+
version = "0.5.2"
12811281
12821282
[deps.MeshArrays.extensions]
12831283
MeshArraysDataDepsExt = ["DataDeps"]
@@ -1324,10 +1324,10 @@ uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3"
13241324
version = "1.1.3"
13251325
13261326
[[deps.NearestNeighbors]]
1327-
deps = ["Distances", "StaticArrays"]
1328-
git-tree-sha1 = "5a47e9b249869754ac274953fbe9b7232856eb20"
1327+
deps = ["AbstractTrees", "Distances", "StaticArrays"]
1328+
git-tree-sha1 = "2949f294f82b5ad7192fd544a988a1e785438ee2"
13291329
uuid = "b8a86587-4115-5ab1-83bc-aa920d37bbce"
1330-
version = "0.4.25"
1330+
version = "0.4.26"
13311331
13321332
[[deps.Netpbm]]
13331333
deps = ["FileIO", "ImageCore", "ImageMetadata"]

examples/JuliaGeoDev/GeometryOps_exploration.jl renamed to examples/dev/GeometryOps_exploration.jl

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -501,9 +501,9 @@ version = "1.11.0"
501501
502502
[[deps.DelaunayTriangulation]]
503503
deps = ["AdaptivePredicates", "EnumX", "ExactPredicates", "Random"]
504-
git-tree-sha1 = "783b21581a051ac91a3921ee37e26a23ed7f57a6"
504+
git-tree-sha1 = "c55f5a9fd67bdbc8e089b5a3111fe4292986a8e8"
505505
uuid = "927a84f5-c5f4-47a5-9785-b46e178433df"
506-
version = "1.6.5"
506+
version = "1.6.6"
507507
508508
[[deps.Distributed]]
509509
deps = ["Random", "Serialization", "Sockets"]
@@ -742,9 +742,9 @@ weakdeps = ["GeoInterface"]
742742
743743
[[deps.GeometryOps]]
744744
deps = ["AbstractTrees", "AdaptivePredicates", "CoordinateTransformations", "DataAPI", "DelaunayTriangulation", "ExactPredicates", "Extents", "GeoFormatTypes", "GeoInterface", "GeometryOpsCore", "LinearAlgebra", "Random", "SortTileRecursiveTree", "StaticArrays", "Statistics", "Tables"]
745-
git-tree-sha1 = "9fa16be9c28d9c01bf2b5d73f7768d482c12b118"
745+
git-tree-sha1 = "3e8bfdb7b924c0346ce15a1d11a6938d490a76a3"
746746
uuid = "3251bfac-6a57-4b6d-aa61-ac1fef2975ab"
747-
version = "0.1.31"
747+
version = "0.1.32"
748748
749749
[deps.GeometryOps.extensions]
750750
GeometryOpsDataFramesExt = "DataFrames"
@@ -762,9 +762,9 @@ version = "0.1.31"
762762
763763
[[deps.GeometryOpsCore]]
764764
deps = ["DataAPI", "GeoInterface", "StableTasks", "Tables"]
765-
git-tree-sha1 = "69fc98947b06f8ac4279cf5bf8810373fe042be4"
765+
git-tree-sha1 = "55ca4091a2808f7918eb857fe35844107b728c5d"
766766
uuid = "05efe853-fabf-41c8-927e-7063c8b9f013"
767-
version = "0.1.7"
767+
version = "0.1.8"
768768
769769
[[deps.GettextRuntime_jll]]
770770
deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Libiconv_jll"]
@@ -998,9 +998,9 @@ version = "0.1.6"
998998
999999
[[deps.JpegTurbo_jll]]
10001000
deps = ["Artifacts", "JLLWrappers", "Libdl"]
1001-
git-tree-sha1 = "4255f0032eafd6451d707a51d5f0248b8a165e4d"
1001+
git-tree-sha1 = "b6893345fd6658c8e475d40155789f4860ac3b21"
10021002
uuid = "aacddb02-875f-59d6-b918-886e6ef4fbf8"
1003-
version = "3.1.3+0"
1003+
version = "3.1.4+0"
10041004
10051005
[[deps.JuliaSyntaxHighlighting]]
10061006
deps = ["StyledStrings"]
@@ -1172,9 +1172,9 @@ uuid = "20f20a25-4f0e-4fdf-b5d1-57303727442b"
11721172
version = "0.9.5"
11731173
11741174
[[deps.MappedArrays]]
1175-
git-tree-sha1 = "2dab0221fe2b0f2cb6754eaa743cc266339f527e"
1175+
git-tree-sha1 = "0ee4497a4e80dbd29c058fcee6493f5219556f40"
11761176
uuid = "dbb5928d-eab1-5f90-85c2-b9b0edb7c900"
1177-
version = "0.4.2"
1177+
version = "0.4.3"
11781178
11791179
[[deps.Markdown]]
11801180
deps = ["Base64", "JuliaSyntaxHighlighting", "StyledStrings"]
@@ -1771,15 +1771,16 @@ version = "0.4.1"
17711771
17721772
[[deps.Unitful]]
17731773
deps = ["Dates", "LinearAlgebra", "Random"]
1774-
git-tree-sha1 = "9046387d65115030265736cd264d0b4eae3881f9"
1774+
git-tree-sha1 = "c25751629f5baaa27fef307f96536db62e1d754e"
17751775
uuid = "1986cc42-f94f-5a68-af5c-568840ba703d"
1776-
version = "1.26.0"
1776+
version = "1.27.0"
17771777
17781778
[deps.Unitful.extensions]
17791779
ConstructionBaseUnitfulExt = "ConstructionBase"
17801780
ForwardDiffExt = "ForwardDiff"
17811781
InverseFunctionsUnitfulExt = "InverseFunctions"
17821782
LatexifyExt = ["Latexify", "LaTeXStrings"]
1783+
NaNMathExt = "NaNMath"
17831784
PrintfExt = "Printf"
17841785
17851786
[deps.Unitful.weakdeps]
@@ -1788,6 +1789,7 @@ version = "1.26.0"
17881789
InverseFunctions = "3587e190-3f89-42d0-90ee-14403ec27112"
17891790
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
17901791
Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
1792+
NaNMath = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3"
17911793
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
17921794
17931795
[[deps.WebP]]
@@ -1892,9 +1894,9 @@ version = "2.0.4+0"
18921894
18931895
[[deps.libpng_jll]]
18941896
deps = ["Artifacts", "JLLWrappers", "Libdl", "Zlib_jll"]
1895-
git-tree-sha1 = "5cb3c5d039f880c0b3075803c8bf45cb95ae1e91"
1897+
git-tree-sha1 = "de8ab4f01cb2d8b41702bab9eaad9e8b7d352f73"
18961898
uuid = "b53b4c65-9356-5827-b1ea-8c7a1a84506f"
1897-
version = "1.6.51+0"
1899+
version = "1.6.53+0"
18981900
18991901
[[deps.libsixel_jll]]
19001902
deps = ["Artifacts", "JLLWrappers", "JpegTurbo_jll", "Libdl", "libpng_jll"]

examples/JuliaGeoDev/MeshArrays_to_Polygons.jl renamed to examples/dev/MeshArrays_to_Polygons.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,14 +206,12 @@ PLUTO_PROJECT_TOML_CONTENTS = """
206206
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
207207
GeometryOps = "3251bfac-6a57-4b6d-aa61-ac1fef2975ab"
208208
MITgcm = "dce5fa8e-68ce-4431-a242-9469c69627a0"
209-
MeshArrays = "cb8c808f-1acf-59a3-9d2b-6e38d009f683"
210209
PlutoUI = "7f904dfe-b85e-4ff6-b463-dae2292396a8"
211210
212211
[compat]
213212
CairoMakie = "~0.15.7"
214213
GeometryOps = "~0.1.31"
215214
MITgcm = "~0.5.12"
216-
MeshArrays = "~0.4.0"
217215
PlutoUI = "~0.7.75"
218216
"""
219217

@@ -223,7 +221,7 @@ PLUTO_MANIFEST_TOML_CONTENTS = """
223221
224222
julia_version = "1.12.1"
225223
manifest_format = "2.0"
226-
project_hash = "621754fcf1125ccf170eaad89bd3ffdfdd380afd"
224+
project_hash = "98fcc991a2150e4e795d97b4f0693eb5fd12b3ac"
227225
228226
[[deps.AbstractFFTs]]
229227
deps = ["LinearAlgebra"]

examples/dev_NEMO/NEMO_MeridionalTransports.jl renamed to examples/dev/NEMO_MeridionalTransports.jl

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@ begin
192192
MOHT_SW=1e-15*Float64.(mean(ds["ORAS5"][:,1:12],dims=2))[:];
193193

194194
fig=Figure(); ax=Axis(fig[1,1], xlabel="latitude", ylabel="PW")
195-
lines!(-89.0:89.0,MOHT_GF,label="GF")
195+
lines!(-89.0:89.0,MT_heat,label="GF from u,v,T")
196+
lines!(-89.0:89.0,MOHT_GF,label="GF from uT,vT")
196197
lines!(lon_SW,MOHT_SW,label="SW")
197198
axislegend()
198199
fig_MHT_ref=current_figure()
@@ -386,9 +387,9 @@ weakdeps = ["SparseArrays"]
386387
ChainRulesCoreSparseArraysExt = "SparseArrays"
387388
388389
[[deps.ChunkCodecCore]]
389-
git-tree-sha1 = "51f4c10ee01bda57371e977931de39ee0f0cdb3e"
390+
git-tree-sha1 = "1a3ad7e16a321667698a19e77362b35a1e94c544"
390391
uuid = "0b6fb165-00bc-4d37-ab8b-79f91016dbe1"
391-
version = "1.0.0"
392+
version = "1.0.1"
392393
393394
[[deps.ChunkCodecLibZlib]]
394395
deps = ["ChunkCodecCore", "Zlib_jll"]
@@ -1002,9 +1003,9 @@ version = "0.1.6"
10021003
10031004
[[deps.JpegTurbo_jll]]
10041005
deps = ["Artifacts", "JLLWrappers", "Libdl"]
1005-
git-tree-sha1 = "4255f0032eafd6451d707a51d5f0248b8a165e4d"
1006+
git-tree-sha1 = "b6893345fd6658c8e475d40155789f4860ac3b21"
10061007
uuid = "aacddb02-875f-59d6-b918-886e6ef4fbf8"
1007-
version = "3.1.3+0"
1008+
version = "3.1.4+0"
10081009
10091010
[[deps.JuliaSyntaxHighlighting]]
10101011
deps = ["StyledStrings"]
@@ -1225,9 +1226,9 @@ version = "0.6.7"
12251226
12261227
[[deps.MeshArrays]]
12271228
deps = ["CatViews", "Dates", "Distributed", "GeoInterface", "Glob", "LazyArtifacts", "NearestNeighbors", "Pkg", "Printf", "SharedArrays", "SparseArrays", "Statistics", "Unitful"]
1228-
git-tree-sha1 = "6b256a7d5c13337f304b79b30aa351e2142759cd"
1229+
git-tree-sha1 = "d333bc6aa00ba7be0636af73698d85b306ff49f4"
12291230
uuid = "cb8c808f-1acf-59a3-9d2b-6e38d009f683"
1230-
version = "0.5.1"
1231+
version = "0.5.2"
12311232
12321233
[deps.MeshArrays.extensions]
12331234
MeshArraysDataDepsExt = ["DataDeps"]
@@ -1292,10 +1293,10 @@ uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3"
12921293
version = "1.1.3"
12931294
12941295
[[deps.NearestNeighbors]]
1295-
deps = ["Distances", "StaticArrays"]
1296-
git-tree-sha1 = "5a47e9b249869754ac274953fbe9b7232856eb20"
1296+
deps = ["AbstractTrees", "Distances", "StaticArrays"]
1297+
git-tree-sha1 = "2949f294f82b5ad7192fd544a988a1e785438ee2"
12971298
uuid = "b8a86587-4115-5ab1-83bc-aa920d37bbce"
1298-
version = "0.4.25"
1299+
version = "0.4.26"
12991300
13001301
[[deps.NetCDF_jll]]
13011302
deps = ["Artifacts", "Blosc_jll", "Bzip2_jll", "HDF5_jll", "JLLWrappers", "LazyArtifacts", "LibCURL_jll", "Libdl", "MPICH_jll", "MPIPreferences", "MPItrampoline_jll", "MicrosoftMPI_jll", "OpenMPI_jll", "TOML", "XML2_jll", "Zlib_jll", "Zstd_jll", "libaec_jll", "libzip_jll"]
Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,17 @@ PlutoUI.TableOfContents()
6464
# ╔═╡ 71612f73-1051-4e97-a308-21a407d32642
6565
md"""## Load Grids"""
6666

67+
# ╔═╡ 4f164c56-3a0f-4c81-b017-505d8b734e0f
68+
function set_OISST_grid()
69+
γ = MeshArrays.GridSpec_default(ID=:OISST,tile=(180,180))
70+
# Γ_OISST=GridLoad(ID=:OISST,γ)
71+
Γ_OISST=MeshArrays.GridLoad_default(γ)
72+
# heatmap(Γ_OISST.XC)
73+
end
74+
75+
# ╔═╡ 6d54a652-484a-4886-978f-7435e2818287
76+
Γ_OISST=set_OISST_grid();
77+
6778
# ╔═╡ 32d493af-0e5f-44ef-8c4a-e6c38f22c38a
6879
begin
6980
Γ_LL360 = GridLoad(ID=:onedegree)
@@ -142,16 +153,21 @@ This uses the new `MeshArrays.neighbor_locations` method to provide arrays of lo
142153
143154
### `neighbor_locations` in `:wh` format"""
144155

156+
# ╔═╡ 9b407b06-cacd-44ba-8612-6aa942d4c057
157+
@bind gr2 Select([:CS32,:OISST])
158+
145159
# ╔═╡ 002a877c-fdae-4937-b786-eaa58163082a
146-
locs_wh=MeshArrays.neighbor_locations(Γ_CS32,format=:wh)
160+
locs_wh=(gr2==:CS32 ? MeshArrays.neighbor_locations(Γ_CS32,format=:wh)
161+
: MeshArrays.neighbor_locations(Γ_OISST,format=:wh)
162+
)
147163

148164
# ╔═╡ fe278b93-3643-47e3-b38a-6f7402ba7e46
149165
@bind ff Select(1:length(locs_wh.MA))
150166

151167
# ╔═╡ b4d43587-e358-4feb-a4fc-98f5e5b23247
152168
begin
153169
fig=Figure(size=(300,300)); ax=Axis(fig[1,1])
154-
heatmap!([x[3] for x in locs_wh.MA.f[ff]],colorrange=(1,6))
170+
heatmap!([x[3] for x in locs_wh.MA.f[ff]],colorrange=(1,length(locs_wh.MA)))
155171
fig
156172
end
157173

@@ -203,7 +219,6 @@ PlutoUI = "7f904dfe-b85e-4ff6-b463-dae2292396a8"
203219
204220
[compat]
205221
CairoMakie = "~0.15.8"
206-
MeshArrays = "~0.5.1"
207222
PlutoUI = "~0.7.76"
208223
"""
209224

@@ -213,7 +228,7 @@ PLUTO_MANIFEST_TOML_CONTENTS = """
213228
214229
julia_version = "1.12.1"
215230
manifest_format = "2.0"
216-
project_hash = "2ba776f762950a75975eb5aa688bbbd8dacbdda7"
231+
project_hash = "82fd984eb91a1771f46441a1db146d67a7b4f7b9"
217232
218233
[[deps.AbstractFFTs]]
219234
deps = ["LinearAlgebra"]
@@ -920,9 +935,9 @@ version = "0.1.6"
920935
921936
[[deps.JpegTurbo_jll]]
922937
deps = ["Artifacts", "JLLWrappers", "Libdl"]
923-
git-tree-sha1 = "4255f0032eafd6451d707a51d5f0248b8a165e4d"
938+
git-tree-sha1 = "b6893345fd6658c8e475d40155789f4860ac3b21"
924939
uuid = "aacddb02-875f-59d6-b918-886e6ef4fbf8"
925-
version = "3.1.3+0"
940+
version = "3.1.4+0"
926941
927942
[[deps.JuliaSyntaxHighlighting]]
928943
deps = ["StyledStrings"]
@@ -1110,9 +1125,9 @@ version = "0.6.7"
11101125
11111126
[[deps.MeshArrays]]
11121127
deps = ["CatViews", "Dates", "Distributed", "GeoInterface", "Glob", "LazyArtifacts", "NearestNeighbors", "Pkg", "Printf", "SharedArrays", "SparseArrays", "Statistics", "Unitful"]
1113-
path = "/Users/gaelforget/work/code/julia_pkg/MeshArrays.jl/"
1128+
git-tree-sha1 = "d333bc6aa00ba7be0636af73698d85b306ff49f4"
11141129
uuid = "cb8c808f-1acf-59a3-9d2b-6e38d009f683"
1115-
version = "0.5.1"
1130+
version = "0.5.2"
11161131
11171132
[deps.MeshArrays.extensions]
11181133
MeshArraysDataDepsExt = ["DataDeps"]
@@ -1875,6 +1890,8 @@ version = "4.1.0+0"
18751890
# ╟─7e32b36f-2a80-4637-a8be-306e7a0efa9a
18761891
# ╟─6dc76c23-ff3a-4182-ab90-a87d5b65c768
18771892
# ╟─71612f73-1051-4e97-a308-21a407d32642
1893+
# ╠═4f164c56-3a0f-4c81-b017-505d8b734e0f
1894+
# ╠═6d54a652-484a-4886-978f-7435e2818287
18781895
# ╟─32d493af-0e5f-44ef-8c4a-e6c38f22c38a
18791896
# ╟─c1c0e7ff-7c4f-48ba-be26-94d85dc1504a
18801897
# ╟─7af41d1e-1013-49e2-823f-4aafc0a5ef49
@@ -1885,6 +1902,7 @@ version = "4.1.0+0"
18851902
# ╟─a171ef2e-f942-4552-8f27-a544cbed7dff
18861903
# ╟─e90245cc-0b2c-4877-9d18-de036eba37ce
18871904
# ╟─5b3c9b52-4d9d-47a7-a824-645173f1d49e
1905+
# ╟─9b407b06-cacd-44ba-8612-6aa942d4c057
18881906
# ╟─002a877c-fdae-4937-b786-eaa58163082a
18891907
# ╟─fe278b93-3643-47e3-b38a-6f7402ba7e46
18901908
# ╟─b4d43587-e358-4feb-a4fc-98f5e5b23247

0 commit comments

Comments
 (0)