diff --git a/src/CSET/recipes/surface_fields/cardington/cardington_latent_heat_single_point_time_series.yaml b/src/CSET/recipes/surface_fields/cardington/cardington_latent_heat_single_point_time_series.yaml new file mode 100644 index 000000000..6733f3a79 --- /dev/null +++ b/src/CSET/recipes/surface_fields/cardington/cardington_latent_heat_single_point_time_series.yaml @@ -0,0 +1,62 @@ +category: Time series of latent heat flux 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_30_LABEL + - $MODEL_NAME + + - 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: misc.latent_heat_units + + - 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 diff --git a/src/CSET/recipes/surface_fields/cardington/cardington_sensible_heat_single_point_time_series.yaml b/src/CSET/recipes/surface_fields/cardington/cardington_sensible_heat_single_point_time_series.yaml new file mode 100644 index 000000000..1988626ad --- /dev/null +++ b/src/CSET/recipes/surface_fields/cardington/cardington_sensible_heat_single_point_time_series.yaml @@ -0,0 +1,45 @@ +category: Time series of sensible heat flux 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_30_LABEL + - $MODEL_NAME + + - operator: misc.mask_fill_values + + - operator: misc.sensible_heat_units + HEIGHT: $HEIGHT + CARDINGTON_VARNAMES: $WT_VARNAMES + + - 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 diff --git a/src/CSET/recipes/surface_fields/cardington/cardington_surface_pressure_time_series.yaml b/src/CSET/recipes/surface_fields/cardington/cardington_surface_pressure_time_series.yaml new file mode 100644 index 000000000..1c264f283 --- /dev/null +++ b/src/CSET/recipes/surface_fields/cardington/cardington_surface_pressure_time_series.yaml @@ -0,0 +1,63 @@ +category: Time series of pressure 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.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 + + # 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 diff --git a/src/CSET/recipes/surface_fields/cardington/cardington_surface_temperature_time_series.yaml b/src/CSET/recipes/surface_fields/cardington/cardington_surface_temperature_time_series.yaml new file mode 100644 index 000000000..53fb0e4ca --- /dev/null +++ b/src/CSET/recipes/surface_fields/cardington/cardington_surface_temperature_time_series.yaml @@ -0,0 +1,69 @@ +category: Time series of surface temperature at Cardington single point +title: "Time series of $VARNAME at lat_pt:52.10438, lon_pt:-0.42286 specific to Cardington gridpoint." +description: "Plots a time series of $VARNAME at a selected Cardington gridpoint." +steps: + # ------------------------------------------------------------ + # 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_05_LABEL + - $CARDINGTON_30_LABEL + - $MODEL_NAME + 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' ] + coord: 'time' + interval: '1 hour' + preprocessors: + - operator: misc.remove_scalar_coords + coords: + - forecast_reference_time + - realization + +# IMPORTANT: Global temperature-only prune. +# 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 diff --git a/src/CSET/recipes/surface_fields/cardington/cardington_air_temperature_single_point_time_series.yaml b/src/CSET/recipes/surface_fields/cardington/cardington_temperature_single_point_time_series.yaml similarity index 55% rename from src/CSET/recipes/surface_fields/cardington/cardington_air_temperature_single_point_time_series.yaml rename to src/CSET/recipes/surface_fields/cardington/cardington_temperature_single_point_time_series.yaml index 0657f9b2b..073ae4242 100644 --- a/src/CSET/recipes/surface_fields/cardington/cardington_air_temperature_single_point_time_series.yaml +++ b/src/CSET/recipes/surface_fields/cardington/cardington_temperature_single_point_time_series.yaml @@ -1,40 +1,53 @@ category: Time series of air temperature at Cardington single point -title: Time series of 'air_temperature' at lat_pt:52.10438, lon_pt:-0.42286 specific to Cardington gridpoint. -description: Plots a time series of the air temperature at a selected Cardington gridpoint. +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','$MODEL_NAME'] - constraint: + model_names: + - $CARDINGTON_05_LABEL + - $CARDINGTON_30_LABEL + - $MODEL_NAME + + - operator: filters.filter_multiple_cubes + + Cardington: operator: constraints.combine_constraints varname_constraint: operator: constraints.generate_var_constraint - varname: 'air_temperature' + varname: $VARNAME cell_methods_constraint: operator: constraints.generate_cell_methods_constraint cell_methods: [] - varname: 'air_temperature' + 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" - - - operator: misc.remove_attribute - attribute: ['time_coverage_end', 'time_coverage_start', 'valid_min', 'valid_max', 'date', 'date_created'] - - - operator: filters.filter_multiple_cubes - cardington: + stash_constraint: operator: constraints.generate_attribute_constraint - attribute: 'height' - value: 2.0 - model: - operator: constraints.generate_attribute_constraint - # This currently only works for UM. Maybe we need another operator to make this nicer? 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: 'Celsius' + units: 'celsius' - operator: regrid.regrid_to_single_point lat_pt: 52.10438 @@ -43,6 +56,8 @@ steps: method: "Nearest" boundary_margin: 0 + - operator: misc.mask_fill_values + # Make a single NetCDF with all the data inside it. - operator: write.write_cube_to_nc overwrite: True diff --git a/src/CSET/recipes/surface_fields/cardington/cardington_visibility_single_point_time_series.yaml b/src/CSET/recipes/surface_fields/cardington/cardington_visibility_single_point_time_series.yaml new file mode 100644 index 000000000..bc39d0074 --- /dev/null +++ b/src/CSET/recipes/surface_fields/cardington/cardington_visibility_single_point_time_series.yaml @@ -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 + + - 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 diff --git a/src/CSET/recipes/surface_fields/cardington/cardington_relative_humidity_single_point_time_series.yaml b/src/CSET/recipes/surface_fields/cardington/cardington_wind_gust_single_point_time_series.yaml similarity index 52% rename from src/CSET/recipes/surface_fields/cardington/cardington_relative_humidity_single_point_time_series.yaml rename to src/CSET/recipes/surface_fields/cardington/cardington_wind_gust_single_point_time_series.yaml index dd0c47ead..44f0d4df7 100644 --- a/src/CSET/recipes/surface_fields/cardington/cardington_relative_humidity_single_point_time_series.yaml +++ b/src/CSET/recipes/surface_fields/cardington/cardington_wind_gust_single_point_time_series.yaml @@ -1,38 +1,43 @@ -category: Time series of relative humidity at Cardington single point -title: Time series of 'relative humidity' at lat_pt:52.10438, lon_pt:-0.42286 specific to Cardington gridpoint. -description: Plots a time series of the relative humidity at a selected Cardington gridpoint. +category: Time series of variables 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','$MODEL_NAME'] - constraint: + model_names: + - $CARDINGTON_05_LABEL + - $CARDINGTON_30_LABEL + - $MODEL_NAME + + - operator: filters.filter_multiple_cubes + + Cardington: operator: constraints.combine_constraints varname_constraint: operator: constraints.generate_var_constraint - varname: 'relative_humidity' + varname: $VARNAME cell_methods_constraint: operator: constraints.generate_cell_methods_constraint cell_methods: [] - varname: 'relative_humidity' - pressure_level_constraint: - operator: constraints.generate_level_constraint - levels: [] - coordinate: "pressure" - - - operator: misc.remove_attribute - attribute: ['time_coverage_end', 'time_coverage_start', 'valid_min', 'valid_max', 'date', 'date_created'] - - - operator: filters.filter_multiple_cubes - cardington: + varname: $VARNAME + height_constraint: operator: constraints.generate_attribute_constraint attribute: 'height' - value: 1.2 - model: + value: $HEIGHT + + $MODEL_NAME: + operator: constraints.combine_constraints + varname_constraint: + operator: constraints.generate_var_constraint + varname: $UM_VARNAME + stash_constraint: operator: constraints.generate_attribute_constraint - # This currently only works for UM. Maybe we need another operator to make this nicer? attribute: STASH + - 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 @@ -40,6 +45,8 @@ steps: method: "Nearest" boundary_margin: 0 + - operator: misc.mask_fill_values + # Make a single NetCDF with all the data inside it. - operator: write.write_cube_to_nc overwrite: True diff --git a/src/CSET/recipes/surface_fields/cardington/cardington_wind_single_point_time_series.yaml b/src/CSET/recipes/surface_fields/cardington/cardington_wind_single_point_time_series.yaml new file mode 100644 index 000000000..9086b3255 --- /dev/null +++ b/src/CSET/recipes/surface_fields/cardington/cardington_wind_single_point_time_series.yaml @@ -0,0 +1,92 @@ +category: Time series of variables at Cardington single point +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_05_LABEL + - $CARDINGTON_30_LABEL + - $MODEL_NAME + + - operator: misc.combine_cubes_into_cubelist + first: + operator: misc.rename_cube + name: $PLOT_VARNAME + cubes: + operator: filters.filter_multiple_cubes + constraints: + operator: constraints.combine_constraints + varname_constraint: + operator: constraints.generate_var_constraint + varname: $VARNAME + height_constraint: + operator: constraints.generate_attribute_constraint + attribute: height + value: $HEIGHT + + second: + # --- UM: calculate vector wind from both components --- + operator: wind.calculate_vector_wind + cubes: + operator: filters.filter_multiple_cubes + u_constraint: + operator: constraints.combine_constraints + varname_constraint: + operator: constraints.generate_var_constraint + varname: $UM_U_VARNAME + cell_methods_constraint: + operator: constraints.generate_cell_methods_constraint + cell_methods: [] + varname: $UM_U_VARNAME + pressure_level_constraint: + operator: constraints.generate_level_constraint + levels: [] + coordinate: "pressure" + stash_constraint: + operator: constraints.generate_attribute_constraint + attribute: STASH + + v_constraint: + operator: constraints.combine_constraints + varname_constraint: + operator: constraints.generate_var_constraint + varname: $UM_V_VARNAME + cell_methods_constraint: + operator: constraints.generate_cell_methods_constraint + cell_methods: [] + varname: $UM_V_VARNAME + pressure_level_constraint: + operator: constraints.generate_level_constraint + levels: [] + coordinate: "pressure" + stash_constraint: + operator: constraints.generate_attribute_constraint + attribute: STASH + +# PLOT_VARNAME is used to constrain to either speed or direction + - operator: filters.filter_multiple_cubes + to_plot: + operator: constraints.generate_var_constraint + varname: $PLOT_VARNAME + + - 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 + + # RE‑MASK fill values AFTER vector wind + regrid + - operator: misc.mask_fill_values + + # 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