Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Gaetano Raffaele
moringa
Commits
7c117847
Commit
7c117847
authored
Jun 11, 2021
by
Florian de Boissieu
Browse files
add file filtering for out of ROI and existing files, before running parallel processing
parent
2a5ecb59
Changes
1
Hide whitespace changes
Inline
Side-by-side
s1process.py
View file @
7c117847
...
...
@@ -237,8 +237,8 @@ def checkRoiInS1Acquisition(s1file, roifile):
in_geom
=
getS1ExtentGeometry
(
s1file
)
isIntersecting
=
in_geom
.
Intersects
(
roi_geom
)
dsv
=
None
print
(
roi_geom
.
ExportToWkt
())
print
(
in_geom
.
ExportToWkt
())
#
print(roi_geom.ExportToWkt())
#
print(in_geom.ExportToWkt())
return
isIntersecting
def
preClip
(
infile
,
outfile
,
roi_buffered_vector
,
overwrite
=
False
,
verbose
=
True
,
ram
=
1024
):
...
...
@@ -904,6 +904,15 @@ def s1process(indir, outdir, epsg=None,
if
geoid
is
None
:
geoid
=
download_geoid
(
cache_dir
,
verbose
)
print
(
'Number of files to process: '
+
str
(
len
(
proc_files
)))
print
(
'Reducing to files inside ROI...'
)
proc_files
=
[
f
for
f
in
proc_files
if
checkRoiInS1Acquisition
(
f
,
roi
)]
if
not
overwrite
:
print
(
'Remove already existing files...'
)
outfiles
=
[
ortho_dir
/
infile
.
name
.
replace
(
'.tiff'
,
'_clipped_cal'
+
lut
+
'_ortho.tiff'
)
for
infile
in
proc_files
]
proc_files
=
[
f
for
f
,
o
in
zip
(
proc_files
,
outfiles
)
if
not
o
.
exists
()]
print
(
'Number of files to process: '
+
str
(
len
(
proc_files
)))
outfiles
=
[
ortho_dir
/
infile
.
name
.
replace
(
'.tiff'
,
'_clipped_cal'
+
lut
+
'_ortho.tiff'
)
for
infile
in
proc_files
]
mp_args
=
[(
infile
,
outfile
,
roi
,
dem_dir
,
geoid
,
lut
,
orthofit
,
overwrite
,
ram
)
for
infile
,
outfile
in
zip
(
proc_files
,
outfiles
)]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment