ECCO-Hackweek / EH24-Drifters

Lagrangian analysis of ECCO ocean transport estimates in Julia
BSD 3-Clause "New" or "Revised" License
0 stars 5 forks source link

should add background field and land mask in plot #2

Open gaelforget opened 2 days ago

gaelforget commented 2 days ago

https://github.com/ECCO-Hackweek/EH24-Drifters/blob/78bd420cf48e400c86be3c5c6598cb97071857f3/scripts/initial_simulations.jl#L41

For examples, see https://juliaclimate.github.io/MeshArrays.jl/dev/tutorials/geography.html

kykinne commented 1 day ago

import Pkg; Pkg.add("MeshArrays") using MeshArrays

fil=demo.download_polygons("countries.geojson") pol=MeshArrays.read_polygons(fil);

[lines!(a,l1,color = :white, linewidth = 0.5) for l1 in pol] #0-360 but countries are -180-180

Then also need to transform the particle lon positions -180 so that the grid are the same.

YuanyuanSong99 commented 1 day ago

mask_test1 Perhaps the particle Lon positions should -360

gaelforget commented 1 day ago

import Pkg; Pkg.add("MeshArrays") using MeshArrays fil=demo.download_polygons("countries.geojson") pol=MeshArrays.read_polygons(fil); [lines!(a,l1,color = :white, linewidth = 0.5) for l1 in pol] #0-360 but countries are -180-180

Nice! Couple notes :

  1. seems to need this before :
using MeshArrays, GeoJSON, CairoMakie, DataDeps
fi=Figure(); a=Axis(fi[1,1])
  1. try lon180(x)=Float64(x>180.0 ? x-360.0 : x)

  2. when you feel ready, please open a pull request to add this to the repository

YuanyuanSong99 commented 19 hours ago

I added examples_SouthAtlantic1.jl in the directory of scripts, with two ways to add land background. I recommend the second way. Here are figures by both ways. mask_test1 mask_test2

YuanyuanSong99 commented 16 hours ago

mask_test2 Now we have a plot with depth colormap of particles

YuanyuanSong99 commented 16 hours ago

We also have a map using heatmap function mask_test3_heatmap