Skip to content

243 add map view visualization - #244

Closed
LucySalmonSGE wants to merge 23 commits into
mainfrom
243-Add-map-view-visualization
Closed

243 add map view visualization#244
LucySalmonSGE wants to merge 23 commits into
mainfrom
243-Add-map-view-visualization

Conversation

@LucySalmonSGE

Copy link
Copy Markdown
Collaborator

CarboKitten currently provides several visualization options for model output, including topographic views and vertical profile views. However, while the platform can be inspected through vertical sections, there is currently no straightforward way to visualize model output as horizontal stratigraphic slices. This makes it difficult to examine lateral facies organization, spatial facies patterns, and how these patterns vary through the stratigraphic succession.

This PR adds a map-view visualization routine that allows users to plot model output at selected stratigraphic positions at various time steps. The new routine makes it possible to inspect 2D facies patterns, sediment distribution, and lateral organization across the platform at different stratigraphic levels.

The user can choose whether to visualize the facies being deposited at a given frame, the facies preserved in the stratigraphic column, or both, with the modelled facies shown as a translucent layer beneath the preserved record. The routine also supports optional shoreline plotting and allows emerged cells to be either masked or displayed.

map_view_file

Map-view stratigraphic visualizations are commonly available in industrial geomodelling and stratigraphic modelling software. Adding this functionality to CarboKitten makes model outputs easier to inspect, compare, and communicate, and helps make the package more comparable to applied or industry-facing modelling tools.

@LucySalmonSGE
LucySalmonSGE marked this pull request as ready for review June 29, 2026 14:56
Removed WGLMakie dependency from Project.toml

@jhidding jhidding left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Lucy,

These plots look really useful, but I do have some questions. To plot the correct values for a certain time, we need to search for the most recent sediment at a certain time. From the current code I can't see where this happens, so the code should be refactored to reveal this. If the last sedimentation event was very small, this search will give noisy results, especially when plotting facies fractions.

To rephrase this slightly: most of the code should be doing data manipulation to retrieve the input for heatmap!. This data mangling should be separated from the actual plotting code.

I would propose a more robust method. We can reuse the SedimentBuffer code. Push sediment until the target time to the sediment buffer, then pop a layer of a given thickness and use that for plotting.

Let me know if this helps!

Cheers, Johan


Example 3 shows how to plot map views directly from memory. Run it immediately after running the model.

```{.julia .task file=examples/visualization/map_view.jl}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These examples need to be split, so we get one image and then the corresponding code each. You can use entangled quotations to still put the actual script in a single file.

Script.from_file_categorical()
```

### Implementation

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation needs better motivation. As it stands now, I can't see why you made certain choices.

_colormax(d::AbstractArray) = getindex.(argmax(d; dims=1)[1, :, :], 1)

#Calculate a given facies' proportion relative to the others in a specific location.
function _facies_fraction(d::AbstractArray, facies::Integer)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the ifelse function. Then this function becomes a one-liner. I think something like ifelse.(iszero.(total), missing, ustrip.(selected ./ total)) should work.

return fraction
end

# Resolve a stratigraphic position into an index along the (write-interval

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use Entangled literate programming to put these important comments into the text.

@LucySalmonSGE

LucySalmonSGE commented Jul 14, 2026 via email

Copy link
Copy Markdown
Collaborator Author

@jhidding

Copy link
Copy Markdown
Member

The current implementation is very complex. We need to incorporate the time-based slicing (both preserved and deposited modes, as suggested using the sediment buffer interface) and then implement the visualisation separately in two PRs. This would divert from the current PR so much that it is better to close this for now.

@jhidding jhidding closed this Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add map-view visualization to visualize the platform in satellite view at chosen stratigraphic positions

2 participants