JuliaEarth / GeoStats.jl

An extensible framework for geospatial data science and geostatistical modeling fully written in Julia
https://juliaearth.github.io/GeoStatsDocs/stable/
MIT License
506 stars 61 forks source link

Add support for distributional variables #339

Closed eliascarv closed 10 months ago

eliascarv commented 10 months ago

Examples:

julia> gtb = georef((; a=[Normal(), Normal(1, 2), Normal(1, 3), Normal(2,3)]), CartesianGrid(2,2))
4×2 GeoTable over 2×2 CartesianGrid{2,Float64}
┌───────────────────────────────┬─────────────────────────────────────────┐
│               a               │                geometry                 │
│        Distributional         │               Quadrangle                │
│           [NoUnits]           │                                         │
├───────────────────────────────┼─────────────────────────────────────────┤
│ Normal{Float64}(μ=0.0, σ=1.0) │ Quadrangle((0.0, 0.0), ..., (0.0, 1.0)) │
│ Normal{Float64}(μ=1.0, σ=2.0) │ Quadrangle((1.0, 0.0), ..., (1.0, 1.0)) │
│ Normal{Float64}(μ=1.0, σ=3.0) │ Quadrangle((0.0, 1.0), ..., (0.0, 2.0)) │
│ Normal{Float64}(μ=2.0, σ=3.0) │ Quadrangle((1.0, 1.0), ..., (1.0, 2.0)) │
└───────────────────────────────┴─────────────────────────────────────────┘

julia> viewer(gtb)

julia> gtb = georef((; a=fill(Normal(0, 2), 4)), CartesianGrid(2,2))
4×2 GeoTable over 2×2 CartesianGrid{2,Float64}
┌───────────────────────────────┬─────────────────────────────────────────┐
│               a               │                geometry                 │
│        Distributional         │               Quadrangle                │
│           [NoUnits]           │                                         │
├───────────────────────────────┼─────────────────────────────────────────┤
│ Normal{Float64}(μ=0.0, σ=2.0) │ Quadrangle((0.0, 0.0), ..., (0.0, 1.0)) │
│ Normal{Float64}(μ=0.0, σ=2.0) │ Quadrangle((1.0, 0.0), ..., (1.0, 1.0)) │
│ Normal{Float64}(μ=0.0, σ=2.0) │ Quadrangle((0.0, 1.0), ..., (0.0, 2.0)) │
│ Normal{Float64}(μ=0.0, σ=2.0) │ Quadrangle((1.0, 1.0), ..., (1.0, 2.0)) │
└───────────────────────────────┴─────────────────────────────────────────┘

julia> viewer(gtb)

Plot 1:

Captura de tela de 2023-11-30 08-30-12

Plot 2:

Captura de tela de 2023-11-30 08-30-32

codecov-commenter commented 10 months ago

Codecov Report

Attention: 15 lines in your changes are missing coverage. Please review.

Comparison is base (0c916e0) 0.49% compared to head (22aad54) 0.47%.

Files Patch % Lines
ext/viewer.jl 0.00% 12 Missing :warning:
ext/colors.jl 0.00% 3 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #339 +/- ## ========================================= - Coverage 0.49% 0.47% -0.03% ========================================= Files 6 6 Lines 203 212 +9 ========================================= Hits 1 1 - Misses 202 211 +9 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.