From 1610ba90e8079d5d58fa82aa46696ea3b43b690a Mon Sep 17 00:00:00 2001 From: Scott Staniewicz Date: Mon, 15 Jul 2024 22:41:19 -0400 Subject: [PATCH] use `NBITS=16` when saving LOS files (#51) --- src/opera_utils/constants.py | 2 +- src/opera_utils/download.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/opera_utils/constants.py b/src/opera_utils/constants.py index 8ebfc15..dae186a 100644 --- a/src/opera_utils/constants.py +++ b/src/opera_utils/constants.py @@ -34,6 +34,6 @@ *DEFAULT_TIFF_OPTIONS, # Note: we're dropping mantissa bits before we do not # need prevision for LOS rasters (or incidence) - "DISCARD_LSB=6", + "NBITS=16", "PREDICTOR=2", ) diff --git a/src/opera_utils/download.py b/src/opera_utils/download.py index 419aa2a..0aec6ab 100644 --- a/src/opera_utils/download.py +++ b/src/opera_utils/download.py @@ -228,7 +228,11 @@ def _download_for_burst_ids( if product == L2Product.CSLC: logger.debug(f"Found {len(results)} total results before deduping pgeVersion") results = filter_results_by_date_and_version(results) - logger.info(f"Found {len(results)} results") + + msg = f"Found {len(results)} results" + if len(results) == 0: + raise ValueError(msg) + logger.info(msg) session = _get_auth_session() urls = _get_urls(results) asf.download_urls(