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
d8abcfc7
Commit
d8abcfc7
authored
May 22, 2018
by
Mario Chirinos Colunga
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Update"
This reverts commit
95b2d119
parent
95b2d119
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
69 additions
and
52 deletions
+69
-52
downloadTest.py
examples/downloadTest.py
+0
-7
download_images
examples/download_images
+54
-0
APISentinel.py
geosentinel/APISentinel.py
+3
-8
APISentinel.pyc
geosentinel/APISentinel.pyc
+0
-0
__init__.pyc
geosentinel/__init__.pyc
+0
-0
ADT_Jasper.cpp
tools/jp2tojpg/ADT_Jasper.cpp
+3
-3
sentinelToRGBJPG.sh
tools/sentinelToRGBJPG.sh
+9
-34
No files found.
examples/downloadTest.py
View file @
d8abcfc7
...
...
@@ -9,11 +9,4 @@ area = "POLYGON((-89.79030210118333 21.122657323983717,-89.77308220413153 21.122
footprint
=
"Intersects(POLYGON((-89.79030210118333 21.122657323983717,-89.77308220413153 21.122657323983717,-89.77308220413153 21.140540053466538,-89.79030210118333 21.140540053466538,-89.79030210118333 21.122657323983717)))"
products
=
sentinel
.
getProducts
(
area
,
(
'20150101'
,
'20180517'
),
{
"platformname"
:
"Sentinel-2"
,
"cloudcoverpercentage"
:
"[0 TO 10]"
})
print
len
(
products
)
for
p
in
products
:
print
products
[
p
][
'filename'
]
print
len
(
products
)
products
=
sentinel
.
filterProducts
(
products
)
for
p
in
products
:
print
products
[
p
][
'filename'
]
print
len
(
products
)
#sentinel.downloadProducts(products,dir)
examples/download_images
0 → 100644
View file @
d8abcfc7
#!/bin/python
# Copyright (C) 2018 Adan Salazar <asalazargaribay@gmail.com>
#
#
# This file is part of GeoSentinel
#
#
# GeoSentinel is free software you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GeoSentinel is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with StereoVision. If not, see <http://www.gnu.org/licenses/>.
"""
Example of dowloading Sentinel images from the Copernicus Open Access Hub < https://scihub.copernicus.eu/dhus/#/home >
"""
from
sentinelsat.sentinel
import
read_geojson
,
geojson_to_wkt
from
argparse
import
ArgumentParser
from
geosentinel.ui_utils
import
(
download_sentinel_mages
)
from
geosentinel.arguments
import
SENTINEL_ARGUMENTS
def
main
():
"""
Download all Sentinel images from the Copernicus Hub and save them in the folder specified by the user.
Please run: python dowload_images --help before usage
First, parse arguments provided by the user. Then choose the images that are in the
dates and polygon provided by the user, then remove the images that do not overlap more than 30
%
of the input polygon and the polygon of the image. Finally, download the remaining images.
"""
parser
=
ArgumentParser
(
description
=
"Download Sentinel images from the Copernicus Hub"
,
parents
=
[
SENTINEL_ARGUMENTS
])
args
=
parser
.
parse_args
()
path_json
=
args
.
input_file
args
.
footprint
=
geojson_to_wkt
(
read_geojson
(
path_json
))
download_sentinel_mages
(
args
)
if
__name__
==
"__main__"
:
main
()
geosentinel/APISentinel.py
View file @
d8abcfc7
...
...
@@ -82,13 +82,8 @@ class APISentinel(object):
self
.
api
.
download_all
(
products
)
def
filterProducts
(
self
,
productList
):
#, user_footprint, threshold):
products
=
productList
.
copy
()
for
p
in
productList
:
if
productList
[
p
][
'filename'
]
.
find
(
"OPER_PRD"
)
!=
-
1
:
del
products
[
p
]
# def filterProducts(self, products_list, user_footprint, threshold):
# products_down = OrderedDict()
# products_down = products_list.copy()
# products_df = self.api.to_dataframe(products_list)
...
...
@@ -109,6 +104,6 @@ class APISentinel(object):
# # Deleting element
# del products_down[products_df.uuid[i]]
return
products
# return products_down
geosentinel/APISentinel.pyc
deleted
100644 → 0
View file @
95b2d119
File deleted
geosentinel/__init__.pyc
deleted
100644 → 0
View file @
95b2d119
File deleted
tools/jp2tojpg/ADT_Jasper.cpp
View file @
d8abcfc7
...
...
@@ -184,9 +184,9 @@ jas_matrix_t *imgData[nChannels];
{
for
(
unsigned
int
x
=
0
;
x
<
width
;
++
x
)
{
floa
t
delta
=
max
-
min
;
jas_matrix_set
(
imgData
[
i
],
y
,
x
,
(
unsigned
char
)(
255
*
((
float
)
data
[
nChannels
*
(
y
*
width
+
x
)
+
i
]
-
min
)
/
delta
)
);
//
jas_matrix_set(imgData[i], y, x, (unsigned char)(255*data[nChannels*(y*width+x)+i]/(pow(2,12))) );
//in
t delta = max-min;
//jas_matrix_set(imgData[i], y, x, (unsigned char)(255* (
data[nChannels*(y*width+x)+i]-min)/delta) );
jas_matrix_set
(
imgData
[
i
],
y
,
x
,
(
unsigned
char
)(
255
*
data
[
nChannels
*
(
y
*
width
+
x
)
+
i
]
/
(
pow
(
2
,
12
)))
);
}
}
}
...
...
tools/sentinelToRGBJPG.sh
View file @
d8abcfc7
...
...
@@ -7,42 +7,21 @@ ext=.jpg
cd
$BASEDIR
for
f
in
$(
find
.
-type
f
-name
'*.zip'
)
do
unzip
-j
$f
*
B02.jp2
*
B03.jp2
*
B04.jp2
-d
$OUTDIR
filepattern
=
$(
echo
$f
|
cut
-d
"_"
-f6
)
"_"
$(
echo
$f
|
cut
-d
"_"
-f3
)
"_B"
filename
=
$OUTDIR$filepattern
echo
$filename
if
[
!
-e
$filename
"02.jp2"
-o
!
-e
$filename
"03.jp2"
-o
!
-e
$filename
"04.jp2"
]
;
then
unzip
-n
-j
$f
*
B02.jp2
*
B03.jp2
*
B04.jp2
-d
$OUTDIR
else
echo
PASS
$f
fi
cd
$OUTDIR
red
=
$(
ls
$filepattern
"04.jp2"
-t
|head
-1
)
green
=
$(
ls
$filepattern
"03.jp2"
-t
|head
-1
)
blue
=
$(
ls
$filepattern
"02.jp2"
-t
|head
-1
)
echo
"red-"
$red
echo
"gre-"
$green
echo
"blu-"
$blue
red
=
$(
ls
*
B04.jp2
-t
|head
-1
)
green
=
$(
ls
*
B03.jp2
-t
|head
-1
)
blue
=
$(
ls
*
B02.jp2
-t
|head
-1
)
# m=$(pwd)
# red=$m/$red
# green=$m/$green
# blue=$m/$blue
if
[
!
-e
$filepattern
"04.jpg"
]
;
then
jp2ToJPGandStretch
$red
fi
# ./jp2ToJPGandStretch $red
# ./jp2ToJPGandStretch $green
# ./jp2ToJPGandStretch $blue
if
[
!
-e
$filepattern
"03.jpg"
]
;
then
jp2ToJPGandStretch
$green
fi
if
[
!
-e
$filepattern
"02.jpg"
]
;
then
jp2ToJPGandStretch
$blue
fi
# red=$(ls *B04.jpg -t |head -1)
# green=$(ls *B03.jpg -t |head -1)
# blue=$(ls *B02.jpg -t |head -1)
...
...
@@ -50,16 +29,12 @@ do
# red=$m/$red
# green=$m/$green
# blue=$m/$blue
if
[
!
-d
"video"
]
;
then
mkdir
video
fi
fileout
=
$(
echo
$filepattern
|
cut
-d
"_"
-f2
)
convert
$filepattern
"04.jpg"
$filepattern
"02.jpg"
$filepattern
"02.jpg"
-combine
video/
$fileout
".jpg"
# convert $red $green $blue -combine $(OUTDIR)/$count$ext
# rm *.jp2
# rm *B04.jpg
# rm *B03.jpg
# rm *B02.jpg
# count=$((count+1))
cd
..
done
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