diff --git a/src/anemoi/inference/commands/retrieve.py b/src/anemoi/inference/commands/retrieve.py index 86b8542..93b1427 100644 --- a/src/anemoi/inference/commands/retrieve.py +++ b/src/anemoi/inference/commands/retrieve.py @@ -13,6 +13,7 @@ from earthkit.data.utils.dates import to_datetime from ..config import load_config +from ..inputs.grib import GribInput from ..inputs.mars import postproc from ..runners.default import DefaultRunner from . import Command @@ -28,7 +29,7 @@ def add_arguments(self, command_parser): command_parser.add_argument("config", type=str, help="Path to checkpoint") command_parser.add_argument("--defaults", action="append", help="Sources of default values.") command_parser.add_argument("--date", type=str, help="Date") - command_parser.add_argument("--output", type=str, help="Output file") + command_parser.add_argument("--output", type=str, default="/dev/stdout", help="Output file") command_parser.add_argument("--staging-dates", type=str, help="Path to a file with staging dates") command_parser.add_argument("--extra", action="append", help="Additional request values. Can be repeated") command_parser.add_argument("overrides", nargs="*", help="Overrides.") @@ -47,6 +48,10 @@ def run(self, args): extra = postproc(grid, area) + input = runner.create_input() + if isinstance(input, GribInput): + extra["target"] = input.path + for r in args.extra or []: k, v = r.split("=") extra[k] = v