Commit 6f958476 authored by Manuel Grizonnet's avatar Manuel Grizonnet
Browse files

WIP: add support for sen2cor

parent a3e74eab
......@@ -68,6 +68,22 @@ MAJA_parameters = {"multi":10,
SEN2COR_parameters = {"mode":"sen2cor",
S2_parameters = {"multi":10,
......@@ -116,7 +132,8 @@ L8_parameters = {"multi":1,
mission_parameters = {"S2":S2_parameters,\
def str2bool(v):
......@@ -165,6 +182,12 @@ def read_product(inputPath, mission):
conf_json["cloud"]["high_cloud_mask"] = params["high_cloud_mask"]
conf_json["cloud"]["rf"] = params["rf"]
#Check if an optional mode is provided in the mission configuration
# Use in case of SEN2COR to handle differences between maja and sen2cor encoding
if params["mode"] is not None:
conf_json["general"]["mode"] = params["mode"]
return conf_json
logging.error(inputPath + " doesn't exist.")
......@@ -223,7 +246,10 @@ def main():
sentinel2Acronyms = ['S2', 'SENTINEL2', 'S2A', 'S2B']
# Test if it is a MAJA output products (generated with MAJA processor version XX)
if '.DBL.DIR' in inputPath:
if '.SAFE' in inputPath:
# L2A SEN2COR product
jsonData = read_product(inputPath, "SEN2COR")
elif '.DBL.DIR' in inputPath:
if any(s in inputPath for s in sentinel2Acronyms):
jsonData = read_product(inputPath, "MAJA")
......@@ -244,7 +270,7 @@ def main():
jsonData["general"]["pout"] = outputPath
# Override parameters for group general
if args.nodata:
if args.nodata is not None:
jsonData["general"]["nodata"] = args.nodata
if args.preprocessing is not None:
jsonData["general"]["preprocessing"] = args.preprocessing
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment