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
Lozac'h Loic
AgriSoilMoisture
Commits
37db2bf3
Commit
37db2bf3
authored
Feb 28, 2020
by
Lozac'h Loic
Browse files
UPDATE: BatchMosaic add vh support
parent
c3ac57de
Changes
2
Hide whitespace changes
Inline
Side-by-side
python/SoilMoistureBatchExtractAndMosaic2S2Tile.py
View file @
37db2bf3
...
...
@@ -115,6 +115,7 @@ if __name__ == "__main__":
"""
)
parser
.
add_argument
(
'-format'
,
choices
=
[
'S1-SNAP'
,
'L8-NDVI'
],
required
=
True
)
parser
.
add_argument
(
'-mode'
,
choices
=
[
'vv'
,
'vh'
],
required
=
True
,
default
=
"vv"
)
parser
.
add_argument
(
'-indir'
,
action
=
'store'
,
required
=
True
,
help
=
'Directory containing Sentinel1 SNAP Calibrated or Landsat8 NDVI'
)
parser
.
add_argument
(
'-inref'
,
action
=
'store'
,
required
=
True
,
help
=
'Image references Sentinel-2 Tile, example any S2 NDVI'
)
parser
.
add_argument
(
'-outdir'
,
action
=
'store'
,
required
=
True
,
help
=
'Output directory'
)
...
...
@@ -131,6 +132,16 @@ if __name__ == "__main__":
splitinref
=
os
.
path
.
basename
(
args
.
inref
).
split
(
"_"
)
tileid
=
splitinref
[
1
]
if
args
.
mode
==
"vv"
:
modeinprefix
=
"Sigma0_VV.img"
modeoutprefix
=
"_VV.TIF"
elif
args
.
mode
==
"vh"
:
modeinprefix
=
"Sigma0_VH.img"
modeoutprefix
=
"_VH.TIF"
else
:
print
(
"Error: mode not recognized"
)
exit
()
if
args
.
format
==
"S1-SNAP"
:
indir
=
[]
...
...
@@ -152,10 +163,10 @@ if __name__ == "__main__":
if
len
(
l
)
==
2
:
in1
=
os
.
path
.
join
(
indir
[
l
[
0
]],
"Sigma0_VV.img"
)
in2
=
os
.
path
.
join
(
indir
[
l
[
1
]],
"Sigma0_VV.img"
)
in1
=
os
.
path
.
join
(
indir
[
l
[
0
]],
modeinprefix
)
in2
=
os
.
path
.
join
(
indir
[
l
[
1
]],
modeinprefix
)
outfile
=
outfilebase
+
"_VV.TIF"
outfile
=
outfilebase
+
modeoutprefix
if
os
.
path
.
exists
(
outfile
)
:
continue
...
...
@@ -173,8 +184,8 @@ if __name__ == "__main__":
dejafait
.
append
(
indir
[
l
[
1
]])
elif
len
(
l
)
==
1
:
in1
=
os
.
path
.
join
(
file
,
"Sigma0_VV.img"
)
outfile
=
outfilebase
+
"_VV.TIF"
in1
=
os
.
path
.
join
(
file
,
modeinprefix
)
outfile
=
outfilebase
+
modeoutprefix
if
os
.
path
.
exists
(
outfile
)
:
continue
...
...
python/SoilMoisturePipeline.py
View file @
37db2bf3
...
...
@@ -964,6 +964,8 @@ if __name__ == "__main__":
print
(
"#################################################################################### "
)
print
(
"Resolving filenames for "
+
sard
)
#TODO find S1A or S1B
sardata
=
os
.
path
.
basename
(
sard
)
fdate
=
re
.
findall
(
"20\d{6}T\d{6}"
,
sardata
)
if
not
(
fdate
):
...
...
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