diff --git a/docs/source/reference/gallery/examples/spatial/plot_surface_spatial_global.py b/docs/source/reference/gallery/examples/spatial/plot_surface_spatial_global.py new file mode 100644 index 000000000..6d3ba3a33 --- /dev/null +++ b/docs/source/reference/gallery/examples/spatial/plot_surface_spatial_global.py @@ -0,0 +1,56 @@ +""" +Global spatial plot +=================== + +Generate spatial map of a 2D field (global data example). + +.. admonition:: References + + General functionality is provided using :doc:`CSET recipe ` ``generic_surface_spatial_plot_sequence.yaml`` + + The following CSET operators are used: + + * :py:mod:`CSET.operators.read.read_cubes` + * :py:mod:`CSET.operators.plot.spatial_pcolormesh_plot` or :py:mod:`CSET.operators.plot.spatial_contour_plot`. + +Using *cset bake* on the command line +------------------------------------- + +* Access recipe file using ``cset cookbook``. +* Set required recipe inputs on command line. + +Example to generate full-domain spatial maps of ``temperature_at_screen_level`` for all output times:: + + cset cookbook generic_surface_spatial_plot_sequence.yaml + cset -v bake -i "/path/to/input/data" -o "./output_path" \\ + -r generic_surface_spatial_plot_sequence.yaml \\ + --VARNAME="temperature_at_screen_level" \\ + --MODEL_NAME="my_model_label" \\ + --METHOD="SEQ" \\ + --SUBAREA_TYPE='None' --SUBAREA_EXTENT='None' --SUBAREA_NAME='' + +Configuring the *cset_workflow* +------------------------------- + +* Update workflow configuration settings via ``rose edit`` GUI or in ``rose-suite.conf`` file. +* Complete ``General setup options`` and ``Cycling and Model options`` details - see :doc:`/usage/workflow-configure`. +* Set required configuration options on ``Diagnostics / Surface (2D) fields`` panel:: + + SURFACE_FIELDS = ["temperature_at_screen_level", ...] + SPATIAL_SURFACE_FIELD = True + +Example python code +------------------- +""" + +from CSET import sample_data_path +from CSET.operators import plot, read + +# Set path to input data +filename = sample_data_path("air_temperature_global.nc") + +# Read selected variable(s) of interest +cube = read.read_cube(filename, ["temperature_at_screen_level"]) + +# Plot single time using spatial_pcolormesh_plot +plot.spatial_pcolormesh_plot(cube) diff --git a/src/CSET/sample_data/air_temperature_global.nc b/src/CSET/sample_data/air_temperature_global.nc new file mode 100644 index 000000000..c92315216 Binary files /dev/null and b/src/CSET/sample_data/air_temperature_global.nc differ