Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
cbegeman committed Apr 14, 2023
1 parent 407d859 commit 487e4b2
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions docs/developers_guide/framework.md
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,46 @@ from an MPAS mesh file. Optionally, you can provide the name of an MPAS field
on cells in the mesh file that gives different weight to different cells
(`weight_field`) in the partitioning process.

(dev-visualization)=

## Visualization

Visualization is an optional, but desirable aspect of test cases. Often,
visualization is an optional step of a test case but can also be included
as part of other steps such as `initial_state` or `analysis`.

While developers can write their own visualization scripts associated with
individual test cases, the following shared visualization routines are
provided in `polaris.viz`:

{py:func}`polaris.viz.plot_horiz_field()` produces a patches-style
visualization of x-y fields across a single vertical level at a single time
step. The image file (png) is saved to the directory from which
{py:func}`polaris.viz.plot_horiz_field()` is called. The function
automatically detects whether the field specified by its variable name is
a cell-centered variable or an edge-variable and generates the patches, the
polygons characterized by the field values, accordingly.

```{image} images/baroclinic_channel_cell_patches.png
:align: center
:width: 250 px
```

```{image} images/baroclinic_channel_edge_patches.png
:align: center
:width: 250 px
```

An example function call that uses the default vertical level (top) is:

```python
plot_horiz_field(config, ds, ds_mesh, 'normalVelocity',
'final_normalVelocity.png',
t_index=t_index,
vmin=-max_velocity, vmax=max_velocity,
cmap='cmo.balance', show_patch_edges=True)
```

(dev-validation)=

## Validation
Expand Down

0 comments on commit 487e4b2

Please sign in to comment.