Skip to content

Commit 1b9a9a3

Browse files
committed
Add broadcast example to docs
1 parent 24c33ba commit 1b9a9a3

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

docs/src/broadcastexample.jl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using PyramidScheme
2+
using GLMakie
3+
using DimensionalData.Dimensions
4+
5+
@dim lat YDim "Latitude"
6+
@dim lon XDim "Longitude"
7+
p1 = Pyramid("test/data/ESACCI-BIOMASS-L4-AGB-MERGED-100m-2020-fv4.0.zarr/")
8+
p2 = Pyramid("test/data/ESACCI-BIOMASS-L4-AGB-MERGED-100m-2017-fv4.0.zarr/")
9+
agbdiff = p1 .- p2
10+
#agbdiff[agbdiff.==0] .= NaN
11+
12+
f, a, p = plot(agbdiff, colormap=Reverse(:diverging_gwr_55_95_c38_n256))
13+
lift(p.converted[3]) do ras
14+
actual_crange = Makie.distinct_extrema_nan(ras)
15+
maxval = maximum(abs.(actual_crange))
16+
p.colorrange[] = (-maxval, maxval)
17+
end
18+
19+
agbrel = (abs.(agbdiff) .> 10) .* agbdiff
20+
f, a, p = plot(agbrel, colormap=Reverse(:diverging_gwr_55_95_c38_n256))
21+
lift(p.converted[3]) do ras
22+
actual_crange = Makie.distinct_extrema_nan(ras)
23+
maxval = maximum(abs.(actual_crange))
24+
p.colorrange[] = (-maxval, maxval)
25+
end

0 commit comments

Comments
 (0)