diff --git a/moringa.py b/moringa.py index 78838948f76c8a04d46d6b49df9f8f67534b9354..25fecbe8340c27764476c3168d1fbd999096b9c9 100755 --- a/moringa.py +++ b/moringa.py @@ -10,16 +10,16 @@ def run_segmentation(img, threshold, cw, sw , out_seg, VHR.segmentation.lsgrm(img,params,out_seg,n_proc,memory,None,remove_graph,force_parallel) return -def preprocess_spot67(in_fld, out_fld, dem_fld, geoid_file, skip_ps): +def preprocess_spot67(in_fld, out_fld, dem_fld, geoid_file, skip_ps, compress): sp = VHR.vhrbase.SPOT67RasterPipeline(in_fld) sp.to_toa() sp.orthorectify(dem_fld, geoid_file) if not skip_ps: - sp.write_outputs(out_fld, update_pipe=True) + sp.write_outputs(out_fld, update_pipe=True, compress=compress) sp.pansharp() - sp.write_outputs(out_fld) + sp.write_outputs(out_fld, compress=compress) else: - sp.write_outputs(out_fld) + sp.write_outputs(out_fld, compress=compress) return def main(args): @@ -51,6 +51,7 @@ def main(args): vhrprep.add_argument("dem_fld", type=str, help="Path to the folder containing DEM covering the scene in WGS84 projection.") vhrprep.add_argument("geoid", type=str, help="Path to the geoid file.") vhrprep.add_argument("--skip_ps", help="Skip pansharpening step.", action='store_true') + vhrprep.add_argument("--compress", help="Use lossless compresion on outputs.", action='store_true') @@ -68,7 +69,7 @@ def main(args): arg.n_proc, arg.mem_limit, not arg.keep_graph, arg.force_parallel) if arg.cmd == "preprocess_spot67": - preprocess_spot67(arg.fld, arg.out_fld, arg.dem_fld, arg.geoid, arg.skip_ps) + preprocess_spot67(arg.fld, arg.out_fld, arg.dem_fld, arg.geoid, arg.skip_ps, arg.compress) return 0