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
24de2398
Commit
24de2398
authored
May 23, 2018
by
geoint
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
08d8f93c
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
4 deletions
+32
-4
.ndvi.py.swp
geosentinel/.ndvi.py.swp
+0
-0
ndvi.py
geosentinel/ndvi.py
+21
-2
out_ndvi.jp2
geosentinel/out_ndvi.jp2
+0
-0
out_ndvi.jp2.aux.xml
geosentinel/out_ndvi.jp2.aux.xml
+9
-0
productListToNDVI.sh
tools/productListToNDVI.sh
+2
-2
No files found.
geosentinel/.ndvi.py.swp
deleted
100644 → 0
View file @
08d8f93c
File deleted
geosentinel/ndvi.py
View file @
24de2398
...
...
@@ -32,12 +32,31 @@ def geoint_pr_ndvi(nir_fn, vir_fn, outfile):
result
=
np
.
divide
(
numerator
,
denominator
)
driverJP2
=
gdal
.
GetDriverByName
(
'JP2OpenJPEG'
)
driverTiff
=
gdal
.
GetDriverByName
(
'GTiff'
)
ndvi_int8
=
np
.
multiply
((
result
+
1
),
(
2
**
7
-
1
))
# output = driverTiff.Create(outfile, cols, rows, 1, gdal.GDT_Byte)
output
=
driverJP2
.
CreateCopy
(
outfile
,
nir
,
strict
=
0
)
raster
=
np
.
zeros
((
rows
,
cols
),
dtype
=
np
.
uint16
)
output_band
=
output
.
GetRasterBand
(
1
)
output_band
.
SetNoDataValue
(
-
99
)
output_band
.
WriteArray
(
ndvi_int8
)
output_band
.
WriteArray
(
raster
)
#output.GetRasterBand(1).WriteArray(raster)
output
.
GetRasterBand
(
1
)
.
FlushCache
()
output
.
GetRasterBand
(
1
)
.
WriteArray
(
raster
)
output
.
FlushCache
()
output
=
None
# output.SetGeoTransform(geotransform)
output_band
=
None
nir
=
None
#del output
#ndvi_int8)
def
main
(
argv
):
geoint_pr_ndvi
(
argv
[
1
],
argv
[
2
],
argv
[
3
])
...
...
geosentinel/out_ndvi.jp2
0 → 100644
View file @
24de2398
File added
geosentinel/out_ndvi.jp2.aux.xml
0 → 100644
View file @
24de2398
<PAMDataset>
<PAMRasterBand
band=
"1"
>
<NoDataValue>
-9.90000000000000E+01
</NoDataValue>
<Metadata
domain=
"IMAGE_STRUCTURE"
>
<MDI
key=
"COMPRESSION"
>
JPEG2000
</MDI>
<MDI
key=
"NBITS"
>
15
</MDI>
</Metadata>
</PAMRasterBand>
</PAMDataset>
tools/productListToNDVI.sh
View file @
24de2398
...
...
@@ -48,14 +48,14 @@ do
fileout1
=
$(
echo
$filepattern
|
cut
-d
"_"
-f1
)
fileout2
=
$(
echo
$filepattern
|
cut
-d
"_"
-f2
)
python /home/geoint/git/GeoSentinel/geosentinel/ndvi.py
$
filepattern
"04.jp2"
$filepattern
"08.jp2"
ndvi/
$fileout2
"_"
$fileout1
".jpg
"
python /home/geoint/git/GeoSentinel/geosentinel/ndvi.py
$
NIR
$VIR
ndvi/
$fileout2
"_"
$fileout1
".jp2
"
# convert $filepattern"04.jpg" $filepattern"03.jpg" $filepattern"02.jpg" -resize 640x480\! -combine video/$fileout2"_"$fileout1".jpg"
if
[
!
-d
"video"
]
;
then
mkdir
video
fi
gdal_translate
-projwin
$3
-projwin_srs
WGS84
-ot
Byte
-scale
0 4096 0 255
-of
JPEG ndvi/
$fileout2
"_"
$fileout1
".jpg
"
video/
$fileout2
"_"
$fileout1
".jpg"
# gdal_translate -projwin $3 -projwin_srs WGS84 -ot Byte -scale 0 4096 0 255 -of JPEG ndvi/$fileout2"_"$fileout1".jp2
" video/$fileout2"_"$fileout1".jpg"
cd
..
...
...
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