Skip to content
Snippets Groups Projects
Commit c8690e5e authored by Pierre Tysebaert-Plagne's avatar Pierre Tysebaert-Plagne
Browse files

snow_product should be able to parse copernicus retreived archives

parent b5c911cc
No related branches found
No related tags found
2 merge requests!90Develop,!88snow_product should be able to parse copernicus retreived archives
......@@ -48,6 +48,7 @@ LIS = "LIS"
LANDSAT8_OLITIRS_XS = "LANDSAT8-OLITIRS-XS"
LANDSAT8 = "LANDSAT8"
N2A = "N2A"
FSC = "FSC"
# Build gdal option to generate maks of 1 byte using otb extended filename
# syntaxx
......
......@@ -28,7 +28,7 @@ import zipfile
from os.path import basename, dirname
from s2snow.lis_constant import SENTINEL2, LIS, LANDSAT8_OLITIRS_XS, LANDSAT8, N2A, MUSCATE_DATETIME_FORMAT, \
LIS_DATETIME_FORMAT, LANDSAT_DATETIME_FORMAT
LIS_DATETIME_FORMAT, LANDSAT_DATETIME_FORMAT, FSC
from s2snow.lis_exception import UnknownPlatform, NoSnowProductFound, NoZipFound
......@@ -37,6 +37,7 @@ class SnowProduct:
# example 1 "SENTINEL2A_20160912-103551-370_L2B-SNOW_T32TLS_D_V1-0"
# example 2 "LANDSAT8_OLITIRS_XS_20160812_N2A_France-MetropoleD0005H0001"
# exemple 3 : "LIS_S2-SNOW-FSC_T31TCH_20180101T105435_1.7.0_1"
# exemple 4 : "FSC_20200612T110855_S2A_T31TCJ_V100_1[.zip]"
logging.debug("snow_product initialisation")
logging.debug("absolute_filename : " + absolute_filename)
......@@ -92,6 +93,11 @@ class SnowProduct:
self.tile_id = name_splitted[2]
self.snow_mask = find_files(self.product_path, ".*SNOW-FS.*C_.*(tif|TIF)")
self.metadata_file = find_files(self.product_path, ".*SNOW-.*.(xml|XML)")
elif FSC in platform:
self.acquisition_date = datetime.strptime(name_splitted[1], LIS_DATETIME_FORMAT)
self.tile_id = name_splitted[3]
self.snow_mask = find_files(self.product_path, ".*FSC(OG|TOC).(tif|TIF)")
self.metadata_file = find_files(self.product_path, ".*_MTD.(xml|XML)")
else:
msg = "Unknown platform or producer: " + platform
logging.error(msg)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment