Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ESPACE-DEV
pyrasta
Commits
6200b3e2
Commit
6200b3e2
authored
Aug 01, 2021
by
Benjamin Pillot
Browse files
Fix band number
parent
9fac44bf
Changes
1
Show whitespace changes
Inline
Side-by-side
pyrasta/tools/calculator.py
View file @
6200b3e2
...
@@ -30,7 +30,7 @@ def _log(raster, out_file):
...
@@ -30,7 +30,7 @@ def _log(raster, out_file):
array
=
raster
.
_gdal_dataset
.
GetRasterBand
(
band
+
1
).
\
array
=
raster
.
_gdal_dataset
.
GetRasterBand
(
band
+
1
).
\
ReadAsArray
(
*
window
).
astype
(
"float32"
)
ReadAsArray
(
*
window
).
astype
(
"float32"
)
out_ds
.
GetRasterBand
(
band
).
WriteArray
(
np
.
log
(
array
),
window
[
0
],
window
[
1
])
out_ds
.
GetRasterBand
(
band
+
1
).
WriteArray
(
np
.
log
(
array
),
window
[
0
],
window
[
1
])
# Close dataset
# Close dataset
out_ds
=
None
out_ds
=
None
...
@@ -47,7 +47,7 @@ def _log10(raster, out_file):
...
@@ -47,7 +47,7 @@ def _log10(raster, out_file):
array
=
raster
.
_gdal_dataset
.
GetRasterBand
(
band
+
1
).
\
array
=
raster
.
_gdal_dataset
.
GetRasterBand
(
band
+
1
).
\
ReadAsArray
(
*
window
).
astype
(
"float32"
)
ReadAsArray
(
*
window
).
astype
(
"float32"
)
out_ds
.
GetRasterBand
(
band
).
WriteArray
(
np
.
log10
(
array
),
window
[
0
],
window
[
1
])
out_ds
.
GetRasterBand
(
band
+
1
).
WriteArray
(
np
.
log10
(
array
),
window
[
0
],
window
[
1
])
# Close dataset
# Close dataset
out_ds
=
None
out_ds
=
None
...
...
Write
Preview
Supports
Markdown
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