Skip to content

Transect rewrite#216

Draft
mx-moth wants to merge 5 commits intomainfrom
transect-rewrite
Draft

Transect rewrite#216
mx-moth wants to merge 5 commits intomainfrom
transect-rewrite

Conversation

@mx-moth
Copy link
Contributor

@mx-moth mx-moth commented Feb 25, 2026

Rewrite transects to be more flexible: allow transecting 2D variables, creating TransectArtists directly, support for more plotting types.

This change is quite backwards incompatible, but I don't think many people were using the transect functionality because of how inflexible it was.

The following plot is now possible, and comes from examples/plot-kgari-transect.py

sphx_glr_plot-kgari-transect_001

The new TransectArtist class follows the convention established with GridArtist: a matplotlib artist that can take a data array and extract the relevant data itself. This allows for easy construction, and for easy animations using the TransectArtist.set_data_array() function.

The Transect class can now transect 2D surface variables, not just 3d
volumes. The plotting functions have been moved to the module level. New
CrossSectionArtist and TransectStepArtists have been added, much like
the new Artists for surface plotting.

Tests and docs to come.
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.

1 participant