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
68b6c36d
Commit
68b6c36d
authored
May 09, 2018
by
Alfonso Ramire Pedraza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update
parent
dd1c1ac4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
2 deletions
+53
-2
UnZip.py
geosentinel/UnZip.py
+51
-0
tools.py
geosentinel/tools.py
+2
-2
No files found.
geosentinel/UnZip.py
0 → 100644
View file @
68b6c36d
# -*- coding: utf-8 -*-
# @package UnZip Sentinel Files
"""
Example:
$ python -m doctest -v UnZip.py
"""
import
zipfile
from
tools
import
(
tools
)
class
UnZip
(
object
):
""" Class for Sentinel satellites configuration
Test Case
>>> Files = tools('IW_SLC')
>>> dir='make'
>>> platform='Sentinel-1'
>>> list_files=Files.findFilesSentinel(dir,platform)
>>> print 'There is/are
%
d '
%
len(list_files) + platform + ' file(s)'
>>> unzip=UnZip(dir)
>>> unzip.unzip_files_Sentinel(list_files)
"""
def
__init__
(
self
,
folder
):
"""The constructor Initialize Sentinel Data.
Args:
self: The object pointer.
folder (str): destination directory.
Returns:
pointer: The object pointer.
"""
self
.
dir
=
folder
def
unzip_files_Sentinel
(
self
,
list_files
):
#def findFilesSentinel(self,dir,platform):
"""UnZip Files Sentinel
Args:
self (pointer): The object pointer.
OrderedDict: Sentinel Product list found.
"""
for
image
in
list_files
:
print
"Unzziped... "
,
image
File
=
self
.
dir
+
"/"
+
image
zip_ref
=
zipfile
.
ZipFile
(
File
)
# create zipfile object
zip_ref
.
extractall
(
self
.
dir
)
# extract file to dir
zip_ref
.
close
()
# close file
geosentinel/tools.py
View file @
68b6c36d
...
@@ -11,9 +11,9 @@ class tools(object):
...
@@ -11,9 +11,9 @@ class tools(object):
""" Class for Sentinel satellites configuration
""" Class for Sentinel satellites configuration
Test Case
Test Case
>>> Files = tools('all')
>>> Files = tools('all')
>>>
folder='../../../Documentos/Image_Sentinel
'
>>>
dir='make
'
>>> platform='Sentinel-2'
>>> platform='Sentinel-2'
>>> list_files=Files.findFilesSentinel(
folde
r,platform)
>>> list_files=Files.findFilesSentinel(
di
r,platform)
>>> print 'There is/are
%
d '
%
len(list_files) + platform + ' file(s)'
>>> print 'There is/are
%
d '
%
len(list_files) + platform + ' file(s)'
"""
"""
...
...
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