@@ -13,10 +13,16 @@ Plotting Ocean Transects
1313 :width: 500 px
1414 :align: center
1515
16- The function :py:func: `mpas_tools.ocean.viz.plot_ocean_transects() ` and the
17- associated ``plot_ocean_transects `` command-line tool can be used to plot
18- transects of various MPAS-Ocean variables. The arguments to the command-line
19- tool are:
16+ The function :py:func: `mpas_tools.ocean.viz.transect.plot_transect() ` is
17+ used to plot transects of various MPAS-Ocean variables. This function provide
18+ high-level plotting capabilities for visualizing transects of MPAS-Ocean
19+ data. It can create transect plots useful for visualizing test cases or
20+ analyzing global simulation output and comparing with observations.
21+
22+ The function :py:func: `mpas_tools.ocean.viz.transect.plot_feature_transects() `
23+ and the associated ``plot_ocean_transects `` command-line tool can be used to
24+ plot transects of various MPAS-Ocean variables. The arguments to the
25+ command-line tool are:
2026
2127.. code-block :: none
2228
@@ -38,6 +44,9 @@ tool are:
3844 -c COLORMAP, --colormap COLORMAP
3945 A colormap to use for the plots, default depends on the field name.
4046 --flip Flip the x axis for all transects
47+ --write_netcdf Whether to write a NetCDF file for the transect in addition to the image
48+ --method METHOD The type of interpolation to use in plots. Options are "flat" and "bilinear"
49+
4150
4251 See `transects <https://github.com/MPAS-Dev/geometric_features/tree/main/geometric_data/ocean/transect >`_
4352from ``geometric_features `` for a examples of what a geojson transect might
@@ -107,3 +116,61 @@ One way of customizing these visualizaitons is to make your own copy of
107116`transects.py <https://github.com/MPAS-Dev/MPAS-Tools/blob/master/conda_package/mpas_tools/ocean/viz/transects.py >`_
108117and change ``_plot_transect() `` to suite your needs, (changing figure size, dpi,
109118colorbar, etc.)
119+
120+ .. _ocean_viz_transects_interp :
121+
122+ Ocean Transect Interpolation
123+ ============================
124+
125+ The ``mpas_tools.ocean.viz.transect.vert `` module provides functions for
126+ interpolating MPAS-Ocean data onto a vertical transect. This is useful for
127+ visualizing data along a specific path through the ocean, showing the
128+ vertical structure of ocean properties. These functions allow you to create
129+ cross-sectional plots of temperature, salinity, and other variables.
130+
131+ The following functions are available:
132+
133+ The function :py:func: `mpas_tools.ocean.viz.transect.compute_transect() `
134+ builds a sequence of quads showing the transect intersecting MPAS cells.
135+ This function takes horizontal and vertical mesh information and constructs
136+ a set of quadrilaterals that represent the transect's path through the
137+ MPAS-Ocean mesh. The resulting quads can then be used for plotting or
138+ further analysis.
139+
140+ The remaining functions and those in :ref: `viz_transect_horiz ` are lower level
141+ functions that are used by ``compute_transect() `` and are not typically called
142+ directly.
143+
144+ The function
145+ :py:func: `mpas_tools.ocean.viz.transect.find_transect_levels_and_weights() `
146+ constructs a vertical coordinate for a transect and computes interpolation
147+ weights that can be used in ``interp_mpas_to_transect_nodes() `` to performed
148+ linear interpolation.
149+
150+ The function
151+ :py:func: `mpas_tools.ocean.viz.transect.interp_mpas_to_transect_cells() `
152+ interpolates an MPAS-Ocean DataArray to transect cells, keeping constant values
153+ over each MPAS-Ocean cell. This function uses the indices computed by
154+ ``find_transect_levels_and_weights() `` to map data from the MPAS-Ocean mesh
155+ onto the transect. The result is an ``xarray.DataArray `` with values
156+ sampled to transect cells.
157+
158+
159+ The function
160+ :py:func: `mpas_tools.ocean.viz.transect.interp_mpas_to_transect_nodes() `
161+ interpolates an MPAS-Ocean DataArray to transect nodes, linearly
162+ interpolating fields between the closest neighboring cells. This function
163+ uses the interpolation weights computed by
164+ ``find_transect_levels_and_weights() `` to map data from the MPAS-Ocean mesh
165+ onto the transect. The result is an ``xarray.DataArray `` with values
166+ interpolated to the transect's nodes.
167+
168+ The function
169+ :py:func: `mpas_tools.ocean.viz.transect.interp_transect_grid_to_transect_nodes() `
170+ interpolates a 2D grid of data to transect nodes, linearly interpolating
171+ fields between the closest neighboring cells. This requires that the
172+ ``z_transect `` parameter has been passed into function
173+ ``find_transect_levels_and_weights() `` (or ``compute_transect() ``) uses
174+ weights generated in ``find_transect_levels_and_weights() `` to interpolate data
175+ from the MPAS-Ocean mesh to transect nodes the transect, resulting an
176+ ``xarray.DataArray `` with values.
0 commit comments