Commit ed5bb739 authored by Manuel Grizonnet's avatar Manuel Grizonnet
Browse files

ENH: add support to landsat8 level 2 nasa format in build_json

parent 2199a372
......@@ -129,11 +129,27 @@ L8_parameters = {"multi":1,
LANDSAT8_LASRC_parameters = {"multi":1,
mission_parameters = {"S2":S2_parameters,\
def str2bool(v):
......@@ -246,13 +262,15 @@ def main():
sentinel2Acronyms = ['S2', 'SENTINEL2', 'S2A', 'S2B']
# Test if it is a MAJA output products (generated with MAJA processor version XX)
# FIXME: This detection based on directory substring detection is very week and error prone
# FIXME: use a factory and detect by using xml metadata
if '.SAFE' in inputPath:
# L2A SEN2COR product"SEN2COR product detected.")"SEN2COR product detected (detect .SAFE in the input path...).")
jsonData = read_product(inputPath, "SEN2COR")
elif '.DBL.DIR' in inputPath:
if any(s in inputPath for s in sentinel2Acronyms):"MAJA native product detected.")"MAJA native product detected (detect .DBL.DIR substring in input path...)")
jsonData = read_product(inputPath, "MAJA")
logging.error("Only MAJA products from Sentinels are supported by script for now.")
......@@ -263,13 +281,18 @@ def main():"THEIA Sentinel product detected.")
jsonData = read_product(inputPath, "Take5")
elif "LANDSAT8" in inputPath:"THEIA Sentinel product detected.")"THEIA LANDSAT8 product detected.")
jsonData = read_product(inputPath, "LANDSAT8")
elif "LC08" in inputPath:"LANDSAT8 LASRC) product detected (LC08_L1TP in input path...).")
jsonData = read_product(inputPath, "LANDSAT8_LASRC")
logging.error("Unknown product type.")
if jsonData:
if not os.path.exists(outputPath):"Create directory " + outputPath + "...")
jsonData["general"]["pout"] = outputPath
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