Skip to content
Snippets Groups Projects
Commit 7a9a98e2 authored by Gaëlle USSEGLIO's avatar Gaëlle USSEGLIO
Browse files

ENH : Adapt generateConfigFile to TSX/PAZ/TDX products

parent d5fade69
No related branches found
No related tags found
3 merge requests!52Merge for v1.1.0,!50Finalize Python chains (v1.1.0),!49Add python tests
......@@ -86,9 +86,11 @@ def askForMultiSlc(config_handler) :
+ str(Sensor.S1SM) + \
" (for Sentinel-1 StripMap mode) or " + \
str(Sensor.CSK) + \
" (for Cosmo-Skymed Spotligth and StriMap mode) : " )
" (for Cosmo-Skymed Spotligth and StriMap mode) " \
+ str(Sensor.TSX) + \
" (for TSX/PAZ/TDX products) : " )
if sensor not in [str(Sensor.S1SM), str(Sensor.CSK)] :
if sensor not in [str(Sensor.S1SM), str(Sensor.CSK), str(Sensor.TSX)] :
prRed("Unknown sensor")
quit()
......@@ -110,7 +112,13 @@ def askForMultiSlc(config_handler) :
# reference image (must be into Input_Path)
reference_image = inPurple("Which image is your reference : " )
check_file_dir(reference_image)
reference_image = os.path.basename(reference_image)
if sensor != str(Sensor.TSX):
reference_image = os.path.basename(reference_image)
else:
# TSX mode : relative path to image (from input_dir)
common_path = os.path.commonpath([os.path.abspath(input_path),
os.path.abspath(reference_image)])
reference_image = os.path.relpath(reference_image, common_path)
if not utils.get_img_from_dir(reference_image, input_path) :
prRed(reference_image + " not found into given input path " + \
......@@ -165,6 +173,9 @@ def askForMultiSlc(config_handler) :
if sensor == str(Sensor.CSK):
ext = "h5"
pol = reference_image.split("_")[5]
elif sensor == str(Sensor.TSX):
ext = "cos"
pol = os.path.basename(reference_image).split("_")[1]
else :
pol = reference_image.split("-")[3]
......@@ -178,6 +189,14 @@ def askForMultiSlc(config_handler) :
# Avoid duplicates
tiff_dates = utils.avoid_duplicates(tiff_dates)
ref_abs_path = os.path.abspath(reference_image)
if sensor == str(Sensor.TSX):
ref_abs_path = os.path.join(os.path.abspath(input_path),
reference_image)
if os.path.abspath(ref_abs_path) in tiff_dates:
tiff_dates.remove(os.path.abspath(ref_abs_path))
if reference_image in tiff_dates:
tiff_dates.remove(reference_image)
......@@ -203,7 +222,7 @@ def askForMultiSlc(config_handler) :
# EOF file
eof_path = None
if sensor != str(Sensor.CSK):
if sensor not in [str(Sensor.CSK), str(Sensor.TSX)]:
res_eof = inLightPurple("Would you like to indicate fine orbits (yes/no) : ")
if res_eof == "yes" :
......@@ -244,9 +263,11 @@ def askForDiapOTB(config_handler):
+ str(Sensor.S1SM) + \
" (for Sentinel-1 StripMap mode) or " + \
str(Sensor.CSK) + \
" (for Cosmo-Skymed Spotligth and StriMap mode) : " )
" (for Cosmo-Skymed Spotligth and StriMap mode) or " \
+ str(Sensor.TSX) + \
" (for TSX/PAZ/TDX products) : ")
if sensor not in [str(Sensor.S1SM), str(Sensor.CSK)] :
if sensor not in [str(Sensor.S1SM), str(Sensor.CSK), str(Sensor.TSX)] :
prRed("Unknown sensor")
quit()
......@@ -284,7 +305,7 @@ def askForDiapOTB(config_handler):
# EOF file
eof_path = None
if sensor != str(Sensor.CSK) :
if sensor not in [str(Sensor.CSK), str(Sensor.TSX)]:
res_eof = inLightPurple("Would you like to indicate fine orbits (yes/no) : ")
if res_eof == "yes" :
......
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