From f50ddfe361139f5bfd076642dbbc6e7e4ef9fc67 Mon Sep 17 00:00:00 2001 From: James Frost Date: Tue, 17 Sep 2024 04:09:32 +0100 Subject: [PATCH] Bundle recipes and example data into documentation This prevents needing to rely on external hosts for these. I did need to drop the example commands to fetch the resources via curl, but they were probably confusing anyway. --- docs/source/getting-started/air_temp.nc | Bin 0 -> 29314 bytes .../air_temperature_spatial_plot.yaml | 39 ++++++++++++++++++ .../getting-started/create-first-recipe.rst | 10 ++--- docs/source/getting-started/run-recipe.rst | 17 ++------ .../getting-started/visualise-recipe.rst | 5 +-- 5 files changed, 49 insertions(+), 22 deletions(-) create mode 100644 docs/source/getting-started/air_temp.nc create mode 100644 docs/source/getting-started/air_temperature_spatial_plot.yaml diff --git a/docs/source/getting-started/air_temp.nc b/docs/source/getting-started/air_temp.nc new file mode 100644 index 0000000000000000000000000000000000000000..bcdc694f64fbf766d50942390306a74e2461267f GIT binary patch literal 29314 zcmeI54}4YCmGAdW0z$kZViZa#y~e1NVhorfB0?Y`1jK-lqNPX(+(44%-z0%jWE=(^ zWhi4QQXW-?p~^50MT$P2Whhd{;aQ3dkKyBU7}`=~7(`1gRX!FNr=9Qb?7eU9y-6gg z*w3f)$d!PRCtV#Jr_t;eb!Not{JrCbzOc#@CdYW!ZXnsv; zV^djUMQLN*{DwK@Mg>g=DWE22aAVHxl|ybH8XjRxSCp=@O7j{jqop-v_4Spt^8yX! zNE!`wO=V5x(bDR&rpl)I(el#jy4rccoiTsEtoK#QRya$tspiU91{RbzG*;Ht1~IAZ zifQoR>^n__o0iuto@HzKXJ7hdR^gPQ$wVjBpaHCeucGS|A=fTPg9;WyiN#&r|mL{8pW&lB(r;~TtCpS3(Plqi3c|&r#7rtzT(u20w z{kT7w{8-`Csbfu_G4@d?V$5;H9Qskn+^NL-f2Zb1&`qu~p-=`4lM)JrR1jUBre-KV z*F;7I?PE-y$-UC#{w@_O?4c*A1DiYK`f=7~Gp?|4EV0D+K9SzS>U|T3M@ux-WSB58 z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--git a/docs/source/getting-started/air_temperature_spatial_plot.yaml b/docs/source/getting-started/air_temperature_spatial_plot.yaml new file mode 100644 index 000000000..410682fed --- /dev/null +++ b/docs/source/getting-started/air_temperature_spatial_plot.yaml @@ -0,0 +1,39 @@ +# Name of the recipe. +title: Surface air temperature spatial plot +# Category of recipe, used to group together multiple recipes in output. +category: Quick look +# Description will be displayed alongside output. +description: | + Extended description that can go across multiple lines. It is written in + [Markdown](https://commonmark.org/help/) and can thus contain links and + _formatting_. + +# Sequence of steps to run. +steps: + # Specify the operator to run in each step. + - operator: read.read_cubes + # Specify the name of the argument, and its value. + filename_pattern: "*.nc" + + - operator: filters.filter_cubes + # Can specify extra keyword arguments as sub-maps. + constraint: + operator: constraints.combine_constraints + var_constraint: + # Can nest in another operator to use its output as an argument, + # multiple levels deep if needed. + operator: constraints.generate_var_constraint + # Input implicitly taken from the previous step, but can be overridden + # by using the appropriate keyword argument. + varname: m01s03i236 + cell_method_constraint: + operator: constraints.generate_cell_methods_constraint + # Values can be more than just strings, such as this empty list. + cell_methods: [] + + # Save a sequence of plots, one per time. + - operator: plot.spatial_pcolormesh_plot + + # Save a single cube with all the processed data. + - operator: write.write_cube_to_nc + overwrite: True diff --git a/docs/source/getting-started/create-first-recipe.rst b/docs/source/getting-started/create-first-recipe.rst index 999fdb313..406bf783d 100644 --- a/docs/source/getting-started/create-first-recipe.rst +++ b/docs/source/getting-started/create-first-recipe.rst @@ -32,7 +32,7 @@ We will now create a recipe from scratch. This recipe will plot a specific timestamp of the example air temperature data. Start by opening a new file in your favourite text editor, and save it somewhere -accessible as ``single_timestep_surface_air_temperature_spatial_plot.yaml``. +accessible as ``surface_air_temperature_spatial_plot.yaml``. Recipe Metadata --------------- @@ -179,16 +179,14 @@ After following this far your recipe should look like this: Running the Recipe ------------------ -We can run this recipe using `the same data`_ as was used for the -:doc:`run-recipe` tutorial. - -.. _the same data: https://github.com/MetOffice/CSET/raw/main/tests/test_data/air_temp.nc +We can run this recipe using the same data as was used for the +:doc:`run-recipe` tutorial: :download:`air_temp.nc` Use ``cset bake`` to run your newly created recipe. .. code-block:: bash - cset bake -i air_temp.nc -o output/ -r single_timestep_surface_air_temperature_spatial_plot.yaml + cset bake -i air_temp.nc -o output/ -r surface_air_temperature_spatial_plot.yaml You can investigate the created plot and data file in the specified ``output`` directory. diff --git a/docs/source/getting-started/run-recipe.rst b/docs/source/getting-started/run-recipe.rst index a9be49d1a..b859fc8a9 100644 --- a/docs/source/getting-started/run-recipe.rst +++ b/docs/source/getting-started/run-recipe.rst @@ -9,17 +9,11 @@ this tutorial you will use CSET to plot the mean surface air temperature of a forecast. We will create a basic spatial plot of the mean surface air temperature, using a -pre-existing recipe. You can `download the recipe file here`_. +pre-existing recipe. Download the following recipe: +:download:`air_temperature_spatial_plot.yaml` -Now you need to find some data to process. You can `download an example file -here`_, or with the following command. - -.. code-block:: bash - - # Download recipe file. - curl -LO https://gist.githubusercontent.com/jfrost-mo/6e539d5be20bfa28342bf4ff82f24dea/raw/air_temperature_spatial_plot.yaml - # Download example data. - curl -LO https://github.com/MetOffice/CSET/raw/main/tests/test_data/air_temp.nc +Now you need to find some data to process. Download the following example file: +:download:`air_temp.nc` Now we are ready to run our recipe. This is where we use the ``cset bake`` command. This takes the input data file, an output path and the recipe file. The @@ -34,6 +28,3 @@ You can look at the visualised output with ``xdg-open output/index.html``. You've now successfully run CSET with a pre-existing recipe. In the next tutorial we will see what is going on inside. - -.. _download the recipe file here: https://gist.githubusercontent.com/jfrost-mo/6e539d5be20bfa28342bf4ff82f24dea/raw/air_temperature_spatial_plot.yaml -.. _download an example file here: https://github.com/MetOffice/CSET/raw/main/tests/test_data/air_temp.nc diff --git a/docs/source/getting-started/visualise-recipe.rst b/docs/source/getting-started/visualise-recipe.rst index 6e5f0d835..fc19a266b 100644 --- a/docs/source/getting-started/visualise-recipe.rst +++ b/docs/source/getting-started/visualise-recipe.rst @@ -6,7 +6,8 @@ Visualising a recipe graphically In this tutorial we will investigate what is going on inside of a recipe, and visualise the *operators* inside. -As in the previous tutorial `download this example recipe file`_. +As in the previous tutorial we can download this example recipe file: +:download:`air_temperature_spatial_plot.yaml` We will now visualise the steps inside the recipe using the ``cset graph`` command. @@ -52,5 +53,3 @@ Afterwards the cube passes to the ``plot.spatial_contour_plot`` and You now know how to visualise a recipe, and a little about the operators it is made up of. In the next tutorial you will learn to make your own recipe. - -.. _download this example recipe file: https://gist.githubusercontent.com/jfrost-mo/6e539d5be20bfa28342bf4ff82f24dea/raw/air_temperature_spatial_plot.yaml