Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GeoSentinel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mario Chirinos Colunga
GeoSentinel
Commits
0241d74a
Commit
0241d74a
authored
May 23, 2018
by
Mario Chirinos Colunga
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndvi sh p3
parent
3221d5e1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
ndvi.py
geosentinel/ndvi.py
+4
-4
productListToNDVI.sh
tools/productListToNDVI.sh
+1
-1
No files found.
geosentinel/ndvi.py
View file @
0241d74a
...
...
@@ -18,8 +18,8 @@ def geoint_pr_ndvi(nir_fn, vir_fn, outfile):
rows
,
cols
,
geotransform
=
nir
.
RasterYSize
,
nir
.
RasterXSize
,
nir
.
GetGeoTransform
()
# # Read the input bands as numpy arrays.
np_nir
=
nir
.
GetRasterBand
(
1
)
.
ReadAsArray
(
0
,
0
,
nir
.
RasterXSize
,
nir
.
RasterYSize
)
np_red
=
red
.
GetRasterBand
(
1
)
.
ReadAsArray
(
0
,
0
,
red
.
RasterXSize
,
red
.
RasterYSize
)
np_nir
=
nir
.
GetRasterBand
(
1
)
.
ReadAsArray
(
0
,
0
,
nir
.
RasterXSize
,
nir
.
RasterYSize
)
np_red
=
red
.
GetRasterBand
(
1
)
.
ReadAsArray
(
0
,
0
,
red
.
RasterXSize
,
red
.
RasterYSize
)
# Convert the np arrays to 32-bit floating point to make sure division will occur properly.
np_nir_as32
=
np_nir
.
astype
(
np
.
float32
)
...
...
@@ -39,8 +39,8 @@ def geoint_pr_ndvi(nir_fn, vir_fn, outfile):
output
=
driverTiff
.
Create
(
outfile
,
cols
,
rows
,
1
,
gdal
.
GDT_Byte
)
# output = driverTiff.CreateCopy(outfile+".tiff", nir, strict=0)
# output = driverJP2.CreateCopy(outfile, nir, strict=0)
output
.
GetRasterBand
(
1
)
.
SetNoDataValue
(
-
99
)
output
.
GetRasterBand
(
1
)
.
WriteArray
(
result
)
output
.
GetRasterBand
(
1
)
.
SetNoDataValue
(
-
99
)
output
.
GetRasterBand
(
1
)
.
WriteArray
(
result
)
output
.
GetRasterBand
(
1
)
.
FlushCache
()
output
.
SetGeoTransform
(
geotransform
)
output
=
None
...
...
tools/productListToNDVI.sh
View file @
0241d74a
...
...
@@ -48,7 +48,7 @@ do
fileout1
=
$(
echo
$filepattern
|
cut
-d
"_"
-f1
)
fileout2
=
$(
echo
$filepattern
|
cut
-d
"_"
-f2
)
python
$HOME
/git/GeoSentinel/geosentinel/ndvi.py
$NIR
$VIR
ndvi/
$fileout2
"_"
$fileout1
".tiff"
python
3
$HOME
/git/GeoSentinel/geosentinel/ndvi.py
$NIR
$VIR
ndvi/
$fileout2
"_"
$fileout1
".tiff"
# convert $filepattern"04.jpg" $filepattern"03.jpg" $filepattern"02.jpg" -resize 640x480\! -combine video/$fileout2"_"$fileout1".jpg"
if
[
!
-d
"video"
]
;
then
...
...
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