.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "reference/gallery/generated/custom/plot_surface_global_cutout.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_reference_gallery_generated_custom_plot_surface_global_cutout.py: Select lat-lon subarea ====================== Generate spatial map of a 2D field over selected sub-region of data. .. 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 ------------------------------------- * See :doc:`/reference/gallery/generated/spatial/plot_surface_spatial` or :doc:`/reference/gallery/generated/spatial/plot_surface_spatial_global` for general settings. * Set ``SUBAREA_TYPE`` to ``realworld`` or ``modelrelative`` and ``SUBAREA_EXTENT`` to select edge trim widths [lower_lat, upper_lat, lower_lon, upper_lon]. * Use ``SUBAREA_NAME`` to 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 edit`` GUI or in ``rose-suite.conf`` file. * Complete ``General setup options`` and ``Cycling and Model options`` details - see :doc:`/usage/workflow-configure`. * Set ``SELECT_SUBAREA`` to ``True``, choose ``SUBAREA_TYPE`` and set ``SUBAREA_EXTENT`` and ``SUBAREA_NAME`` on panel ``Cycling and Model options``. * Set other required configuration options on ``Diagnostics / Surface (2D) fields`` panel:: 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 ------------------- .. GENERATED FROM PYTHON SOURCE LINES 53-70 .. image-sg:: /reference/gallery/generated/custom/images/sphx_glr_plot_surface_global_cutout_001.png :alt: air_temperature [2020-01-20 00:02:00] :srcset: /reference/gallery/generated/custom/images/sphx_glr_plot_surface_global_cutout_001.png, /reference/gallery/generated/custom/images/sphx_glr_plot_surface_global_cutout_001_2_00x.png 2.00x :class: sphx-glr-single-img .. code-block:: Python 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) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.225 seconds) .. _sphx_glr_download_reference_gallery_generated_custom_plot_surface_global_cutout.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_surface_global_cutout.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_surface_global_cutout.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_surface_global_cutout.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_