Skip to content

Commit

Permalink
--levels FLAG added to compute_probabilistic_climatological_forecasts…
Browse files Browse the repository at this point in the history
…. Allows selecting designated levels from input path.

PiperOrigin-RevId: 703644807
  • Loading branch information
langmore authored and Weatherbench2 authors committed Dec 7, 2024
1 parent ce2b78e commit fba7ec3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions scripts/compute_probabilistic_climatological_forecasts.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@
2020,
help='Inclusive end year of --input_path to include.',
)
LEVELS = flags.DEFINE_list(
'levels',
None,
help=(
'Comma delimited list of pressure levels to compute spectra on. If'
' empty, compute on all levels of --input_path'
),
)
VARIABLES = flags.DEFINE_list(
'variables',
None,
Expand Down Expand Up @@ -504,6 +512,9 @@ def main(argv: abc.Sequence[str]) -> None:

if VARIABLES.value:
input_ds = input_ds[VARIABLES.value]
if LEVELS.value:
input_ds = input_ds.sel(level=[int(l) for l in LEVELS.value])

input_chunks = {k: v for k, v in input_chunks.items() if k in input_ds.dims}

_check_input_spacing_and_time_flags(input_ds)
Expand Down

0 comments on commit fba7ec3

Please sign in to comment.