Skip to content

Commit 2635df5

Browse files
committed
Replace binning with SNAP with binning in Python + QOL in run_efast
1 parent 17be303 commit 2635df5

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

run_efast.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,18 @@
3838
from creodias_finder import download, query
3939
from dateutil import rrule
4040

41+
from efast import binning
4142
import efast.efast as efast
4243
import efast.s2_processing as s2
4344
import efast.s3_processing as s3
4445

46+
SKIP_CREDENTIALS = True
47+
4548
# CDSE credentials to download Sentinel-2 and Sentinel-3 imagery
4649
def get_credentials_from_env():
4750
username = os.getenv("CDSE_USER")
4851
password = os.getenv("CDSE_PASSWORD")
49-
if username is None or password is None:
52+
if not SKIP_CREDENTIALS and (username is None or password is None):
5053
raise RuntimeError(
5154
"Please make sure that CDSE credentials are available in the environment.\n"
5255
"In order to proceed, set 'CDSE_USER' and 'CDSE_PASSWORD' accordingly."
@@ -130,7 +133,7 @@ def main(
130133
else:
131134
with open(DOWNLOAD_MARKER, "r") as fp:
132135
instrument = fp.readline()
133-
logger.info(f"No downloads performed, because {DOWNLOAD_MARKER} exists. Read instrument '{instrument}' form marker file.")
136+
logger.info(f"No downloads performed, because {DOWNLOAD_MARKER} exists. Read instrument '{instrument}' from marker file.")
134137

135138
if not S2_PRE_MARKER.exists():
136139
logger.info("Performing pre-processing on Sentinel-2 images")
@@ -239,7 +242,18 @@ def s3_preprocessing(
239242
s3_timings: list[Tuple[str, float]] = []
240243
# Sentinel-3 pre-processing
241244
with Timer(dsc="S3 binning", logger=logger, add_to=s3_timings):
242-
s3.binning_s3(
245+
# s3.binning_s3(
246+
# s3_download_dir,
247+
# s3_binning_dir,
248+
# footprint=footprint,
249+
# s3_bands=s3_bands,
250+
# instrument=instrument,
251+
# aggregator="mean",
252+
# snap_gpt_path=snap_gpt_path,
253+
# snap_memory="24G",
254+
# snap_parallelization=1,
255+
# )
256+
binning.binning_s3_py(
243257
s3_download_dir,
244258
s3_binning_dir,
245259
footprint=footprint,

0 commit comments

Comments
 (0)