-
Notifications
You must be signed in to change notification settings - Fork 18
Add Cardington recipes #2128
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
base: main
Are you sure you want to change the base?
Add Cardington recipes #2128
Changes from all commits
9242b0b
18c51ff
54462e2
aaeab54
a5ddc0f
bef83ea
7874d2c
ed10559
737416a
5252560
04d8c65
eab9104
aa81619
92e6e6c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,63 @@ | ||||||
| category: Time series of latent heat flux at Cardington single point | ||||||
| title: "Time series of $PLOT_VARNAME at lat_pt:52.10438, lon_pt:-0.42286 specific to Cardington gridpoint." | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Suggesting: a) given current approach is a different recipe per variable type, be explicit on the variable name in recipe title. If we end up with more generic recipe template for all/many Cardington obs types, then suggest that time to introduce a $PLOT_VARNAME input. Otherwise sense these recipes require user to track lots of flavours of 'VARNAME'. b) aim for shorter title as will improve plot readability / dimensions etc. Alternative suggested. Implement similar changes across proposed recipes.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similarly, remove $PLOT_VARNAME from the description line below. Alternative strategy would be to consolidate more of these recipes into generic Cardington time series recipe, but under impression that is not desirable (e.g. due to need for variable-specific processing). |
||||||
| description: "Plots a time series of $PLOT_VARNAME at a selected Cardington gridpoint." | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here worth highlighting in the description that interpolation of gridded model data to observation location is based on nearest neighbour. |
||||||
|
|
||||||
| steps: | ||||||
| - operator: read.read_cubes | ||||||
| file_paths: $INPUT_PATHS | ||||||
| model_names: | ||||||
| - Cardington 30min | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Not wholly wedded to this, but for e.g. external publication, keeping legend titles as simple as possible may have value, and not obvious what "Cardington" is in plot label here. Cardington as location is highlighted in the simpler plot title. Consider implementing this approach across recipes. |
||||||
| - $MODEL_NAME | ||||||
| constraint: ['$VARNAME', '$UM_VARNAME'] | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Strongly suggest we need to keep "VARNAME" as consistent with general CSET use of "VARNAME" (typically standard_names, model output etc), and also that we should remove explicit referneces to 'UM' here. Therefore instead, introduce
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would need to make equivalent alternations further down in recipe where currently |
||||||
|
|
||||||
| - operator: filters.filter_multiple_cubes | ||||||
|
|
||||||
| Cardington: | ||||||
| operator: constraints.combine_constraints | ||||||
| varname_constraint: | ||||||
| operator: constraints.generate_var_constraint | ||||||
| varname: $VARNAME | ||||||
| cell_methods_constraint: | ||||||
| operator: constraints.generate_cell_methods_constraint | ||||||
| cell_methods: [] | ||||||
| varname: $VARNAME | ||||||
| height_constraint: | ||||||
| operator: constraints.generate_attribute_constraint | ||||||
| attribute: 'height' | ||||||
| value: $HEIGHT | ||||||
|
|
||||||
| $MODEL_NAME: | ||||||
| operator: constraints.combine_constraints | ||||||
| varname_constraint: | ||||||
| operator: constraints.generate_var_constraint | ||||||
| varname: $UM_VARNAME | ||||||
| cell_methods_constraint: | ||||||
| operator: constraints.generate_cell_methods_constraint | ||||||
| cell_methods: [] | ||||||
| varname: $UM_VARNAME | ||||||
| pressure_level_constraint: | ||||||
| operator: constraints.generate_level_constraint | ||||||
| levels: [ ] | ||||||
| coordinate: "pressure" | ||||||
| stash_constraint: | ||||||
| operator: constraints.generate_attribute_constraint | ||||||
| attribute: STASH | ||||||
|
|
||||||
| - operator: fluxes.latent_heat_units | ||||||
|
|
||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider adding in call to filter fill_values (see example comment below) here for consistency with SH flux recipe. |
||||||
| - operator: misc.remove_attribute | ||||||
| attribute: [ 'time_coverage_end', 'time_coverage_start', 'valid_min', 'valid_max', 'date', 'date_created' ] | ||||||
|
|
||||||
| - operator: regrid.regrid_to_single_point | ||||||
| lat_pt: 52.10438 | ||||||
| lon_pt: -0.42286 | ||||||
| latlon_in_type: "realworld" | ||||||
| method: "Nearest" | ||||||
| boundary_margin: 0 | ||||||
|
|
||||||
| # Make a single NetCDF with all the data inside it. | ||||||
| - operator: write.write_cube_to_nc | ||||||
| overwrite: True | ||||||
|
|
||||||
| # Plot the data. | ||||||
| - operator: plot.plot_line_series | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| category: Time series of sensible heat flux at Cardington single point | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See detailed comments in latent_heat recipe for style/naming changes, to be applied consistently in relevant places to this recipe also. |
||
| title: "Time series of $PLOT_VARNAME at lat_pt:52.10438, lon_pt:-0.42286 specific to Cardington gridpoint." | ||
| description: "Plots a time series of $PLOT_VARNAME at a selected Cardington gridpoint." | ||
| steps: | ||
| - operator: read.read_cubes | ||
| file_paths: $INPUT_PATHS | ||
| model_names: | ||
| - Cardington 30min | ||
| - $MODEL_NAME | ||
|
|
||
| - operator: misc.mask_fill_values | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After some trial/error, I was able to utilise existing CSET operator functionality to avoid introducing specific new code here as follows: This makes recipe slightly longer, but re-uses existing code. The logic is somewhat 'simple' as here just saying to preserve everything where data < 1e10 rather than setting specific values to NaN based on tolerances etc. Would that approach be sufficient for most recipes (with some knowledge of 'gotcha' numbers). My sense is the mask_fill_values is neat code, and maybe useful capability, but looking for simple implementation and avoiding too much new code where possible. |
||
|
|
||
| - operator: fluxes.sensible_heat_flux_from_covariance | ||
| HEIGHT: $HEIGHT | ||
| CARDINGTON_VARNAMES: $WT_VARNAMES | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would want to see worked example This could be another example where if recipe is aiming to be bespoke to specific variable, coding known required varnames within recipe could be preferable to requiring users to be familiar with details of input needed. |
||
|
|
||
| - operator: filters.filter_multiple_cubes | ||
| Cardington: | ||
| operator: constraints.generate_var_constraint | ||
| varname: surface_upward_sensible_heat_flux | ||
|
|
||
| $MODEL_NAME: | ||
| operator: constraints.generate_var_constraint | ||
| varname: surface_upward_sensible_heat_flux | ||
|
|
||
| - operator: misc.remove_attribute | ||
| attribute: | ||
| - time_coverage_end | ||
| - time_coverage_start | ||
| - valid_min | ||
| - valid_max | ||
| - date | ||
| - date_created | ||
|
|
||
| - operator: regrid.regrid_to_single_point | ||
| lat_pt: 52.10438 | ||
| lon_pt: -0.42286 | ||
| latlon_in_type: "realworld" | ||
| method: "Nearest" | ||
| boundary_margin: 0 | ||
|
|
||
| - operator: write.write_cube_to_nc | ||
| overwrite: True | ||
|
|
||
| - operator: plot.plot_line_series | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| category: Time series of pressure at Cardington single point | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See detailed comments in previous recipes for areas to address on general approach, to be reflected in updates to this recipe also. |
||
| title: "Time series of $PLOT_VARNAME at lat_pt:52.10438, lon_pt:-0.42286 specific to Cardington gridpoint." | ||
| description: "Plots a time series of $PLOT_VARNAME at a selected Cardington gridpoint." | ||
|
|
||
| steps: | ||
| - operator: read.read_cubes | ||
| file_paths: $INPUT_PATHS | ||
| model_names: | ||
| - Cardington 05min | ||
| - Cardington 30min | ||
| - $MODEL_NAME | ||
| constraint: ['$VARNAME', '$UM_VARNAME'] | ||
|
|
||
| - operator: filters.filter_multiple_cubes | ||
|
|
||
| Cardington: | ||
| operator: constraints.combine_constraints | ||
| varname_constraint: | ||
| operator: constraints.generate_var_constraint | ||
| varname: $VARNAME | ||
| cell_methods_constraint: | ||
| operator: constraints.generate_cell_methods_constraint | ||
| cell_methods: [] | ||
| varname: $VARNAME | ||
|
|
||
|
|
||
| $MODEL_NAME: | ||
| operator: constraints.combine_constraints | ||
| varname_constraint: | ||
| operator: constraints.generate_var_constraint | ||
| varname: $UM_VARNAME | ||
| cell_methods_constraint: | ||
| operator: constraints.generate_cell_methods_constraint | ||
| cell_methods: [] | ||
| varname: $UM_VARNAME | ||
| pressure_level_constraint: | ||
| operator: constraints.generate_level_constraint | ||
| levels: [] | ||
| coordinate: "pressure" | ||
| stash_constraint: | ||
| operator: constraints.generate_attribute_constraint | ||
| attribute: STASH | ||
|
|
||
| - operator: misc.remove_attribute | ||
| attribute: [ 'time_coverage_end', 'time_coverage_start', 'valid_min', 'valid_max', 'date', 'date_created' ] | ||
|
|
||
| - operator: misc.convert_units | ||
| units: 'hPa' | ||
|
|
||
| - operator: regrid.regrid_to_single_point | ||
| lat_pt: 52.10438 | ||
| lon_pt: -0.42286 | ||
| latlon_in_type: "realworld" | ||
| method: "Nearest" | ||
| boundary_margin: 0 | ||
|
|
||
| - operator: misc.mask_fill_values | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See comment in sensible_heat recipe on proposal to adopt existing apply_mask and generate_mask to satisfy this requirement. Reminder of comment to then apply consistently across Cardington recipes. |
||
|
|
||
| # Make a single NetCDF with all the data inside it. | ||
| - operator: write.write_cube_to_nc | ||
| overwrite: True | ||
|
|
||
| # Plot the data. | ||
| - operator: plot.plot_line_series | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| category: Time series of surface temperature at Cardington single point | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See other comments for general style suggestions/requirements to be adopted consistently in this recipe. |
||
| title: "Time series of $PLOT_VARNAME at lat_pt:52.10438, lon_pt:-0.42286 specific to Cardington gridpoint." | ||
| description: "Plots a time series of $PLOT_VARNAME at a selected Cardington gridpoint." | ||
| steps: | ||
| # ------------------------------------------------------------ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would remove, or simplify the docstrings from recipe file itself. As above, avoid explicit reference to "UM" for example. Suggest the call to read.read_cubes does not require specific docstrings in final version, so would remove. |
||
| # 1. Read data | ||
| # IMPORTANT: | ||
| # - Constrain the UM *at read time* so Iris only ever loads | ||
| # a single surface_temperature cube. | ||
| # ------------------------------------------------------------ | ||
|
|
||
| - operator: read.read_cubes | ||
| file_paths: $INPUT_PATHS | ||
| model_names: | ||
| - Cardington 05min | ||
| - Cardington 30min | ||
| - $MODEL_NAME | ||
| constraint: ['$VARNAME', '$UM_VARNAME'] | ||
|
|
||
| constraints: | ||
| $MODEL_NAME: | ||
| operator: constraints.combine_constraints | ||
| stash_constraint: | ||
| operator: constraints.generate_attribute_constraint | ||
| attribute: STASH | ||
| values: | ||
| - $UM_VARNAME | ||
| cell_methods_constraint: | ||
| operator: constraints.generate_cell_methods_constraint | ||
| cell_methods: [ 'maximum' ] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this recipe be updated to reference Tmax therefore? Are there intended to be equivalents for Tmin, Tmean etc? Could the required cell_method potentially be user-defined variable $CELL_METHOD if appetite/requirement to cover all options? |
||
| coord: 'time' | ||
| interval: '1 hour' | ||
| preprocessors: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Preprocessors is new to me. Is it useful to adopt similar preprocessor step in previous recipes to remove unwanted attributes also? This would seem to be neater approach than a 'random' call to these operators lower down in recipe. Aim to adopt consistent approach where possible across the recipe set. Alternatively, why are scalar_coords removed in this recipe, but seemingly not in other recipes? Is this still needed? |
||
| - operator: misc.remove_scalar_coords | ||
| coords: | ||
| - forecast_reference_time | ||
| - realization | ||
|
|
||
| # IMPORTANT: Global temperature-only prune. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this still valid/required if constrain by varname now done in read.read_cubes step? |
||
| # filter_multiple_cubes must have exactly ONE key here, | ||
| # otherwise non-temperature cubes will survive and break convert_units. | ||
| - operator: filters.filter_multiple_cubes | ||
| temperature: | ||
| operator: constraints.generate_var_constraint | ||
| varname: $VARNAME | ||
|
|
||
| - operator: misc.remove_attribute | ||
| attribute: | ||
| - time_coverage_end | ||
| - time_coverage_start | ||
| - valid_min | ||
| - valid_max | ||
| - date | ||
| - date_created | ||
|
|
||
| - operator: misc.convert_units | ||
| units: 'Celsius' | ||
|
|
||
| - operator: regrid.regrid_to_single_point | ||
| lat_pt: 52.10438 | ||
| lon_pt: -0.42286 | ||
| latlon_in_type: "realworld" | ||
| method: "Nearest" | ||
| boundary_margin: 0 | ||
|
|
||
| - operator: misc.mask_fill_values | ||
|
|
||
| - operator: write.write_cube_to_nc | ||
| overwrite: True | ||
|
|
||
| - operator: plot.plot_line_series | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| category: Time series of visibility at Cardington single point | ||
| title: "Time series of $PLOTNAME at lat_pt:52.10438, lon_pt:-0.42286 specific to Cardington gridpoint." | ||
| description: "Plots a time series of $PLOTNAME at a selected Cardington gridpoint." | ||
|
|
||
| steps: | ||
| - operator: read.read_cubes | ||
| file_paths: $INPUT_PATHS | ||
| model_names: | ||
| - $CARDINGTON_05_LABEL | ||
| - $CARDINGTON_30_LABEL | ||
| - $MODEL_NAME | ||
|
|
||
| - operator: filters.filter_multiple_cubes | ||
| Cardington: | ||
| operator: constraints.generate_var_constraint | ||
| varname: $VARNAME | ||
|
|
||
| $MODEL_NAME: | ||
| operator: constraints.combine_constraints | ||
| varname_constraint: | ||
| operator: constraints.generate_var_constraint | ||
| varname: $UM_VARNAME | ||
| pressure_level_constraint: | ||
| operator: constraints.generate_level_constraint | ||
| levels: [] | ||
| coordinate: "pressure" | ||
| stash_constraint: | ||
| operator: constraints.generate_attribute_constraint | ||
| attribute: STASH | ||
|
|
||
| - operator: misc.remove_attribute | ||
| attribute: | ||
| - time_coverage_end | ||
| - time_coverage_start | ||
| - valid_min | ||
| - valid_max | ||
| - date | ||
| - date_created | ||
|
|
||
| - operator: misc.convert_visibility_to_km | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. check if this required, or if That function includes test of varnames for "visibility" and then converts units to km. |
||
|
|
||
| - operator: regrid.regrid_to_single_point | ||
| lat_pt: 52.10438 | ||
| lon_pt: -0.42286 | ||
| latlon_in_type: "realworld" | ||
| method: "Nearest" | ||
| boundary_margin: 0 | ||
|
|
||
| - operator: write.write_cube_to_nc | ||
| overwrite: True | ||
|
|
||
| - operator: plot.plot_line_series | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest category should be something relatively general that lots of outputs might sit in (e.g. generic_spatial_plots outputs all have category "Surface Spatial Plot".
The main aim of category is to offer some organisation/cataloguing of output plots.
Suggest you have same
categorywording for all Cardington time series recipes.