Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Remote Modules
let-it-snow
Commits
1b23e1ee
Commit
1b23e1ee
authored
Oct 18, 2016
by
Manuel Grizonnet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ENH: replace gdal translate subprocess
parent
cab6a89b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
python/s2snow/snow_detector.py
python/s2snow/snow_detector.py
+2
-2
No files found.
python/s2snow/snow_detector.py
View file @
1b23e1ee
...
...
@@ -315,7 +315,7 @@ class snow_detector :
def
pass0
(
self
):
#Pass -1 : generate custom cloud mask
#Extract red band
call_subprocess
([
"
gdal
_t
ranslate
"
,
"-a_nodata"
,
str
(
self
.
nodata
),
"-ot"
,
"Int16"
,
"-b"
,
str
(
self
.
nRed
),
self
.
img
,
self
.
redBand_path
])
gdal
.
T
ranslate
(
self
.
redBand_path
,
self
.
img
,
format
=
'GTiff'
,
outputType
=
gdal
.
GDT_Int16
,
noData
=
self
.
nodata
,
bandList
=
[
self
.
nRed
])
dataset
=
gdal
.
Open
(
self
.
redBand_path
,
GA_ReadOnly
)
xSize
=
dataset
.
RasterXSize
...
...
@@ -328,7 +328,7 @@ class snow_detector :
call_subprocess
([
"gdalwarp"
,
"-overwrite"
,
"-r"
,
"bilinear"
,
"-ts"
,
str
(
xSize
/
self
.
rf
),
str
(
ySize
/
self
.
rf
),
self
.
redBand_path
,
op
.
join
(
self
.
path_tmp
,
"red_coarse.tif"
)])
#Resample red band nn
#FIXME: use MACCS resampling filter contribute
by J. Michel
here
#FIXME: use MACCS resampling filter contribute
in OTB 5.6
here
call_subprocess
([
"gdalwarp"
,
"-overwrite"
,
"-r"
,
"near"
,
"-ts"
,
str
(
xSize
),
str
(
ySize
),
op
.
join
(
self
.
path_tmp
,
"red_coarse.tif"
),
op
.
join
(
self
.
path_tmp
,
"red_nn.tif"
)])
#edit result to set the resolution to the input image resolution
...
...
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