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
a065bda4
Commit
a065bda4
authored
Apr 20, 2018
by
Pedro Alfonso Ramirez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add unzip
parent
b2c048f0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
3 deletions
+66
-3
unzip_sentinel_files
examples/unzip_sentinel_files
+49
-0
ui_utils.py
geosentinel/ui_utils.py
+15
-1
setup.py
setup.py
+2
-2
No files found.
examples/unzip_sentinel_files
0 → 100644
View file @
a065bda4
#!/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 unzip Sentinel files in a specific directory
"""
from
argparse
import
ArgumentParser
from
geosentinel.ui_utils
import
(
find_files
,
unzip
,
SENTINEL_UNZIP_ARGUMENTS
)
def
main
():
"""
Unzip all Sentinel files in the folder specified by the user and print the number files and the list of files.
Please run: python unzip_sentinel_files --help before usage
"""
parser
=
ArgumentParser
(
description
=
"Unzip Sentinel files in the folder specified by the user"
,
parents
=
[
SENTINEL_UNZIP_ARGUMENTS
])
args
=
parser
.
parse_args
()
list_files
=
find_files
(
args
)
unzip
(
list_files
,
args
)
#print list_files
if
__name__
==
"__main__"
:
main
()
geosentinel/ui_utils.py
View file @
a065bda4
...
@@ -73,6 +73,14 @@ SENTINEL_FIND_ARGUMENTS.add_argument("folder", help="Folder to find Sentinel fil
...
@@ -73,6 +73,14 @@ SENTINEL_FIND_ARGUMENTS.add_argument("folder", help="Folder to find Sentinel fil
SENTINEL_FIND_ARGUMENTS
.
add_argument
(
"plattform"
,
help
=
"sentinel-1 or sentinel-2"
)
SENTINEL_FIND_ARGUMENTS
.
add_argument
(
"plattform"
,
help
=
"sentinel-1 or sentinel-2"
)
SENTINEL_UNZIP_ARGUMENTS
=
ArgumentParser
(
add_help
=
False
)
SENTINEL_UNZIP_ARGUMENTS
.
add_argument
(
"folder"
,
help
=
"Folder to find Sentinel files"
)
SENTINEL_UNZIP_ARGUMENTS
.
add_argument
(
"plattform"
,
help
=
"sentinel-1 or sentinel-2"
)
SENTINEL_UNZIP_ARGUMENTS
.
add_argument
(
"product_type"
,
help
=
"sentinel product type {SM_SLC, SM_GRDF, SM_GRDH, SM_GRDM, IW_SLC, IW_GRDH, IW_GDRM, EW_SLC, EW_GRDH, EW_GRDM, WV_SLC, WV_GRDM, MSIL1C, OPER_PRD }"
)
def
find_files
(
args
):
def
find_files
(
args
):
...
@@ -90,7 +98,13 @@ def find_files(args):
...
@@ -90,7 +98,13 @@ def find_files(args):
files
=
[
f
for
f
in
files
if
f
.
startswith
(
namfil1
)
or
f
.
startswith
(
namfil2
)]
files
=
[
f
for
f
in
files
if
f
.
startswith
(
namfil1
)
or
f
.
startswith
(
namfil2
)]
return
files
return
files
def
unzip
(
list_files
,
args
):
for
image
in
list_files
:
print
"Unzziped... "
,
image
File
=
args
.
folder
+
"
\\
"
+
image
zip_ref
=
zipfile
.
ZipFile
(
File
)
# create zipfile object
zip_ref
.
extractall
(
args
.
folder
)
# extract file to dir
zip_ref
.
close
()
# close file
def
check_existing_directory
(
folder
)
:
def
check_existing_directory
(
folder
)
:
...
...
setup.py
View file @
a065bda4
...
@@ -19,9 +19,9 @@
...
@@ -19,9 +19,9 @@
from
setuptools
import
setup
from
setuptools
import
setup
setup
(
name
=
"
stereo
"
,
setup
(
name
=
"
geosentinel
"
,
version
=
"1.0"
,
version
=
"1.0"
,
description
=
(
"Library and utilities for S
tereo cameras calibration
"
),
description
=
(
"Library and utilities for S
entinel products
"
),
author
=
"Adan Salazar"
,
author
=
"Adan Salazar"
,
author_email
=
"asalazargaribay@gmail.com"
,
author_email
=
"asalazargaribay@gmail.com"
,
packages
=
[
"geosentinel"
],
packages
=
[
"geosentinel"
],
...
...
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