-
Notifications
You must be signed in to change notification settings - Fork 18
New docs gallery timeseries example #2413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ukmo-huw-lewis
merged 7 commits into
main
from
2410-add-line-series-plot-gallery-example
Aug 21, 2026
+68
−0
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8d358c0
New docs gallery timeseries example
ukmo-huw-lewis e8aeef6
Add missing operator dependency
ukmo-huw-lewis 1958d89
Fix typo
ukmo-huw-lewis afabdb3
Typo
ukmo-huw-lewis 6b8ad4a
Merge branch 'main' into 2410-add-line-series-plot-gallery-example
ukmo-huw-lewis 404e0d5
Merge branch 'main' into 2410-add-line-series-plot-gallery-example
ukmo-huw-lewis 90f90de
Response to review comments
ukmo-huw-lewis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
docs/source/reference/gallery/examples/line/GALLERY_HEADER.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Line plots | ||
| ========== |
66 changes: 66 additions & 0 deletions
66
docs/source/reference/gallery/examples/line/plot_line_timeseries.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| """ | ||
| Time series plot | ||
| ================ | ||
|
|
||
| Generate time series of region-averaged field. | ||
|
|
||
| .. admonition:: References | ||
|
|
||
| General functionality is provided using :doc:`CSET recipe </usage/operator-recipes>` ``generic_surface_domain_mean_time_series.yaml`` | ||
|
|
||
| The following CSET operators are used: | ||
|
|
||
| * :py:mod:`CSET.operators.read.read_cubes` | ||
| * :py:mod:`CSET.operators.collapse.collapse` | ||
| * :py:mod:`CSET.operators.plot.plot_line_series`. | ||
|
|
||
| Using *cset bake* on the command line | ||
| ------------------------------------- | ||
|
|
||
| * Access recipe file using ``cset cookbook``. | ||
| * Set required recipe inputs on command line. | ||
|
|
||
| Example to generate time series plot of domain averaged ``temperature_at_screen_level`` for any number of input models:: | ||
|
|
||
| cset cookbook generic_surface_domain_mean_time_series.yaml | ||
| cset -v bake -i "/path/to/input/data1" "..." "/path/to/input/dataN" \\ | ||
| -o "./output_path" \\ | ||
| -r generic_surface_domain_mean_time_series.yaml \\ | ||
| --VARNAME="temperature_at_screen_level" \\ | ||
| --MODEL_NAME="['my_model_label1' '...' 'my_model_labelN']" \\ | ||
| --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", ...] | ||
| TIMESERIES_SURFACE_FIELD = True | ||
|
|
||
| Example python code | ||
| ------------------- | ||
| """ | ||
|
|
||
| from CSET import sample_data_path | ||
| from CSET.operators import collapse, plot, read | ||
|
|
||
| # Set paths to input data | ||
| filename1 = sample_data_path("air_temperature_fcst_1.nc") | ||
| filename2 = sample_data_path("air_temperature_fcst_2.nc") | ||
|
|
||
| # Read selected variable(s) of interest for 2 models | ||
| cubes = read.read_cubes( | ||
| [filename1, filename2], | ||
| ["temperature_at_screen_level"], | ||
| model_names=["model_fcst_1", "model_fcst_2"], | ||
| ) | ||
|
|
||
| # Collapse input data over selected dimensions | ||
| collapsed_cubes = collapse.collapse(cubes, ["grid_latitude", "grid_longitude"], "MEAN") | ||
|
|
||
| # Plot domain mean time series using plot_line_series | ||
| plot.plot_line_series(collapsed_cubes) | ||
Binary file not shown.
Binary file not shown.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.