diff --git a/decloud/preprocessing/sentinel1_prepare.py b/decloud/preprocessing/sentinel1_prepare.py index 281d59d7a12d35c6f278957e6d9c88f38871b6a0..a7b9bbc8c3de3a88120c9cc2871aea48b3b8a4d0 100644 --- a/decloud/preprocessing/sentinel1_prepare.py +++ b/decloud/preprocessing/sentinel1_prepare.py @@ -22,6 +22,7 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ """Pre-process one Sentinel-1 image""" +import os import logging import argparse import otbApplication @@ -79,7 +80,7 @@ def main(args): constants.PATCHSIZE_REF) # Calibration + concatenation + tiling/compression - out_fn = system.pathify(params.out_s1_dir) + out_fn + out_fn = os.path.join(params.out_s1_dir, out_fn) if system.is_complete(out_fn): logging.info("File %s already exists. Skipping.", system.remove_ext_filename(out_fn)) else: diff --git a/decloud/preprocessing/sentinel2_prepare.py b/decloud/preprocessing/sentinel2_prepare.py index 38951e7eed353009f61fd1965148dbd8b29bf675..9e7221eca1bfb1a5783158e956a3dd0a6cd08ead 100644 --- a/decloud/preprocessing/sentinel2_prepare.py +++ b/decloud/preprocessing/sentinel2_prepare.py @@ -43,7 +43,7 @@ def fconc(il, suffix, tilesize, out_tile_dir, pixel_type=otbApplication.ImagePix logging.info("Concatenate + Tile + Compress GeoTiff for files: %s", "".join(il)) out_fn = system.basename(il[0]) out_fn = out_fn[:out_fn.rfind("_")] - out_fn = out_tile_dir + out_fn + "_" + suffix + out_fn = os.path.join(out_tile_dir, out_fn + "_" + suffix) out_fn += ".tif?&gdal:co:COMPRESS=DEFLATE" out_fn += "&streaming:type=tiled&streaming:sizemode=height&streaming:sizevalue={}".format(4 * tilesize) out_fn += "&gdal:co:TILED=YES&gdal:co:BLOCKXSIZE={ts}&gdal:co:BLOCKYSIZE={ts}".format(ts=tilesize) @@ -130,7 +130,7 @@ def main(args): logging.info("Product name is %s", product_name) # Out directory - out_tile_dir = system.pathify(params.out_s2_dir) + tile_name + "/" + product_name + "/" + out_tile_dir = os.path.join(params.out_s2_dir, tile_name, product_name) logging.info("Create or use the following output directory: %s", out_tile_dir) system.mkdir(out_tile_dir)