Note
Go to the end to download the full example code.
Select lat-lon subarea¶
Generate spatial map of a 2D field over selected sub-region of data.
References
General functionality is provided using CSET recipe generic_surface_spatial_plot_sequence.yaml
The following CSET operators are used:
Using cset bake on the command line¶
See Regional spatial plot or Global spatial plot for general settings.
Set
SUBAREA_TYPEtorealworldormodelrelativeandSUBAREA_EXTENTto select edge trim widths [lower_lat, upper_lat, lower_lon, upper_lon].Use
SUBAREA_NAMEto add a plot label if required, or leave blank.
Example to generate spatial maps of temperature_at_screen_level for a selected sub-area 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='realworld' --SUBAREA_EXTENT='[-40.0, 40.0, -20.0, 55.0]' \
--SUBAREA_NAME='Africa'
Configuring the cset_workflow¶
Update workflow configuration settings via
rose editGUI or inrose-suite.conffile.Complete
General setup optionsandCycling and Model optionsdetails - see Configure the workflow.Set
SELECT_SUBAREAtoTrue, chooseSUBAREA_TYPEand setSUBAREA_EXTENTandSUBAREA_NAMEon panelCycling and Model options.Set other required configuration options on
Diagnostics / Surface (2D) fieldspanel:SELECT_SUBAREA = True SPATIAL_SURFACE_FIELD = True SUBAREA_TYPE = 'realworld' SUBAREA_EXTENT = [-40.0, 40.0, -20.0, 55.0] SUBAREA_NAME = 'Africa' SURFACE_FIELDS = ["temperature_at_screen_level", ...]
Example python code¶
![air_temperature [2020-01-20 00:02:00]](../../../../_images/sphx_glr_plot_surface_global_cutout_001.png)
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"],
subarea_type="realworld",
subarea_extent=[-40.0, 40.0, -20.0, 55.0],
)
# Plot single time using spatial_contour_plot
plot.spatial_contour_plot(cube)
Total running time of the script: (0 minutes 1.225 seconds)