diff --git a/containers/sat/Containerfile b/containers/sat/Containerfile index 6e76b21..ff76556 100644 --- a/containers/sat/Containerfile +++ b/containers/sat/Containerfile @@ -19,4 +19,5 @@ COPY --from=install-reqs /venv /venv COPY . /app WORKDIR /app ENTRYPOINT ["/venv/bin/python3", "download_process_sat.py"] +VOLUME /mnt/disks/sat diff --git a/containers/sat/download_process_sat.py b/containers/sat/download_process_sat.py index 909b004..5d4e210 100644 --- a/containers/sat/download_process_sat.py +++ b/containers/sat/download_process_sat.py @@ -603,18 +603,12 @@ def _rewrite_zarr_times(output_name: str) -> None: default="/mnt/disks/sat", type=pathlib.Path, ) -range_group = parser.add_mutually_exclusive_group( - required=True, -) -range_group.add_argument( +parser.add_argument( "--month", "-m", help="Month to download data for (YYYY-MM)", type=str, -) -range_group.add_argument( - "--day", "-d", - help="Day to download data for (YYYY-MM-DD)", - type=str, + required=True, + default=str(dt.datetime.now(tz=dt.UTC).strftime("%Y-%m")), ) parser.add_argument( "--delete_raw", "--rm", @@ -635,19 +629,11 @@ def run(args: argparse.Namespace) -> None: sat_config = CONFIGS[args.sat] # Get start and end times for run - if args.month: - start: dt.datetime = dt.datetime.strptime(args.month, "%Y-%m") - end: dt.datetime = \ - start.replace(month=start.month + 1) if start.month < 12 \ - else start.replace(year=start.year + 1, month=1) \ - - dt.timedelta(days=1) - elif args.day: - start = dt.datetime.strptime(args.day, "%Y-%m-%d") - end = start + dt.timedelta(days=1) - else: - log.error("Invalid args.") - return - + start: dt.datetime = dt.datetime.strptime(args.month, "%Y-%m") + end: dt.datetime = \ + start.replace(month=start.month + 1) if start.month < 12 \ + else start.replace(year=start.year + 1, month=1) \ + - dt.timedelta(days=1) scan_times: list[pd.Timestamp] = pd.date_range( start=start, end=end, diff --git a/pyproject.toml b/pyproject.toml index 8e2f5cc..47e386d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,6 +45,9 @@ dependencies = [ [project.optional-dependencies] dev = [ "mypy == 1.7.1", + "types-PyYAML", + "types-pytz", + "types-requests", "ruff == 0.1.7", "unittest-xml-reporting == 3.2.0", "pytest >= 7.4.1",