Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Sen2Chain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ESPACE-DEV
Sen2Chain
Commits
1f8b2b04
Commit
1f8b2b04
authored
5 years ago
by
pascal.mouquet_ird.fr
Browse files
Options
Downloads
Patches
Plain Diff
example scripts update 3
parent
f7099715
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
script_examples/download_tiles.csv
+4
-0
4 additions, 0 deletions
script_examples/download_tiles.csv
script_examples/download_tiles.py
+51
-0
51 additions, 0 deletions
script_examples/download_tiles.py
with
55 additions
and
0 deletions
script_examples/download_tiles.csv
0 → 100644
+
4
−
0
View file @
1f8b2b04
tile;start_time;end_time;max_clouds;site;nom
40KCB;2019-01-01;;;France;Reunion
#37KFR;;;;TAAF_Eparses;Europa
This diff is collapsed.
Click to expand it.
script_examples/download_tiles.py
0 → 100644
+
51
−
0
View file @
1f8b2b04
# -*- coding:utf-8 -*-
"""
Download L1C products from a tile and dates list provided by a csv file
peps and scihub hub limits can be adjusted (line 53)
- usually PEPS is faster for recent data (limit max 8)
- scihub is better for a few months old products (limit max 2)
"""
import
logging
import
pandas
as
pd
from
sen2chain
import
DataRequest
,
DownloadAndProcess
,
Tile
import
datetime
import
os
import
time
import
math
logger
=
logging
.
getLogger
(
"
Downloading L1C
"
)
logging
.
basicConfig
(
level
=
logging
.
INFO
)
fwd
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
# Path to csv process list
tiles_file
=
fwd
+
"
/download_tiles.csv
"
# default number of days to check before today
# if this field is empty in the csv file
delta_t
=
15
tiles_list
=
pd
.
read_csv
(
tiles_file
,
sep
=
'
;
'
,
na_values
=
""
,
comment
=
'
#
'
)
for
index
,
row
in
tiles_list
.
iterrows
():
try
:
if
math
.
isnan
(
row
.
start_time
):
row
.
start_time
=
(
datetime
.
datetime
.
now
()
-
datetime
.
timedelta
(
days
=
delta_t
)).
strftime
(
'
%Y-%m-%d
'
)
except
:
pass
try
:
if
math
.
isnan
(
row
.
end_time
):
row
.
end_time
=
(
datetime
.
datetime
.
now
()
+
datetime
.
timedelta
(
days
=
1
)).
strftime
(
'
%Y-%m-%d
'
)
except
:
pass
tuile
=
Tile
(
row
.
tile
)
req
=
DataRequest
(
start_date
=
row
.
start_time
,
end_date
=
row
.
end_time
).
from_tiles
([
row
.
tile
])
DownloadAndProcess
(
req
,
hubs_limit
=
{
"
peps
"
:
8
,
"
scihub
"
:
0
},
process_products
=
False
,
indices_list
=
[],
nodata_clouds
=
False
,
quicklook
=
False
,
max_processes
=
8
)
time
.
sleep
(
1
)
tuile
=
Tile
(
row
.
tile
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment