Commit aa21e56a authored by Gaetano Raffaele's avatar Gaetano Raffaele
Browse files

ENH: add compress option to SPOT67 preprocessing

No related merge requests found
Showing with 6 additions and 5 deletions
+6 -5
...@@ -10,16 +10,16 @@ def run_segmentation(img, threshold, cw, sw , out_seg, ...@@ -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) VHR.segmentation.lsgrm(img,params,out_seg,n_proc,memory,None,remove_graph,force_parallel)
return 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 = VHR.vhrbase.SPOT67RasterPipeline(in_fld)
sp.to_toa() sp.to_toa()
sp.orthorectify(dem_fld, geoid_file) sp.orthorectify(dem_fld, geoid_file)
if not skip_ps: 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.pansharp()
sp.write_outputs(out_fld) sp.write_outputs(out_fld, compress=compress)
else: else:
sp.write_outputs(out_fld) sp.write_outputs(out_fld, compress=compress)
return return
def main(args): def main(args):
...@@ -51,6 +51,7 @@ 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("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("geoid", type=str, help="Path to the geoid file.")
vhrprep.add_argument("--skip_ps", help="Skip pansharpening step.", action='store_true') 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): ...@@ -68,7 +69,7 @@ def main(args):
arg.n_proc, arg.mem_limit, not arg.keep_graph, arg.force_parallel) arg.n_proc, arg.mem_limit, not arg.keep_graph, arg.force_parallel)
if arg.cmd == "preprocess_spot67": 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 return 0
......
Supports Markdown
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