Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
let-it-snow
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
Container Registry
Model registry
Operate
Environments
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
Remote Modules
let-it-snow
Commits
7feaa437
Commit
7feaa437
authored
4 years ago
by
Aurore Dupuis
Browse files
Options
Downloads
Plain Diff
Merge branch 'release-1.6' into 'develop'
Patch 1.6.5 See merge request
!59
parents
c09d5f11
5bcc1fe5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!77
Release 1.7.1
,
!59
Patch 1.6.5
,
!43
Patch 1.6.2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/run_snow_annual_map.py
+25
-15
25 additions, 15 deletions
app/run_snow_annual_map.py
python/s2snow/version.py
+1
-1
1 addition, 1 deletion
python/s2snow/version.py
with
26 additions
and
16 deletions
app/run_snow_annual_map.py
+
25
−
15
View file @
7feaa437
...
...
@@ -56,34 +56,42 @@ def main(argv):
"""
main script of snow extraction procedure
"""
json_file
=
argv
[
1
]
# Set logging level and format.
logging
.
basicConfig
(
stream
=
sys
.
stdout
,
level
=
logging
.
INFO
,
\
format
=
'
%(asctime)s - %(filename)s:%(lineno)s - %(levelname)s - %(message)s
'
)
logging
.
info
(
"
Start run_snow_annual_map.py
"
)
logging
.
info
(
"
Input args = {}
"
.
format
(
json_file
))
logging
.
info
(
"
Load parameters
"
)
# ----------------------------------------------------------------------------------------
# Set parameters
# ----------------------------------------------------------------------------------------
with
open
(
json_file
)
as
json_data_file
:
params
=
json
.
load
(
json_data_file
)
output_dir
=
params
.
get
(
"
path_out
"
)
if
not
os
.
path
.
exists
(
output_dir
):
logging
.
info
(
"
Create directory {} ...
"
.
format
(
output_dir
))
os
.
makedirs
(
output_dir
)
log
=
params
.
get
(
"
log
"
,
True
)
stdout_file
=
op
.
join
(
output_dir
,
"
stdout.log
"
)
stderr_file
=
op
.
join
(
output_dir
,
"
stderr.log
"
)
if
log
:
sys
.
stdout
=
open
(
params
.
get
(
"
log_stdout
"
,
stdout_file
),
'
w
'
)
sys
.
stderr
=
open
(
params
.
get
(
"
log_stderr
"
,
stderr_file
),
'
w
'
)
# Set logging level and format.
mode
=
params
.
get
(
"
mode
"
,
"
RUNTIME
"
)
if
mode
==
"
DEBUG
"
:
logging
.
basicConfig
(
stream
=
sys
.
stdout
,
level
=
logging
.
DEBUG
,
\
format
=
'
%(asctime)s - %(filename)s:%(lineno)s - %(levelname)s - %(message)s
'
)
logging
.
debug
(
"
Debug is enabled
"
)
else
:
logging
.
basicConfig
(
stream
=
sys
.
stdout
,
level
=
logging
.
INFO
,
\
format
=
'
%(asctime)s - %(filename)s:%(lineno)s - %(levelname)s - %(message)s
'
)
logging
.
info
(
"
Start run_snow_annual_map.py
"
)
logging
.
info
(
"
Input args = {}
"
.
format
(
json_file
))
tile_id
=
params
.
get
(
"
tile_id
"
)
date_start
=
str_to_datetime
(
params
.
get
(
"
date_start
"
),
"
%d/%m/%Y
"
)
date_stop
=
str_to_datetime
(
params
.
get
(
"
date_stop
"
),
"
%d/%m/%Y
"
)
date_margin
=
timedelta
(
days
=
params
.
get
(
"
date_margin
"
,
0
))
logging
.
debug
(
"
Date margin: {}
"
.
format
(
date_margin
))
output_dir
=
params
.
get
(
"
path_out
"
)
if
not
os
.
path
.
exists
(
output_dir
):
logging
.
info
(
"
Create directory {} ...
"
.
format
(
output_dir
))
os
.
makedirs
(
output_dir
)
processing_id
=
str
(
tile_id
+
"
_
"
+
datetime_to_str
(
date_start
)
+
"
_
"
+
datetime_to_str
(
date_stop
))
path_out
=
op
.
join
(
output_dir
,
processing_id
)
...
...
@@ -116,10 +124,6 @@ def main(argv):
densification_path_list
=
[]
log
=
params
.
get
(
"
log
"
,
True
)
if
log
:
sys
.
stdout
=
open
(
params
.
get
(
"
log_stdout
"
,
op
.
join
(
path_out
,
"
stdout.log
"
)),
'
w
'
)
sys
.
stderr
=
open
(
params
.
get
(
"
log_stderr
"
,
op
.
join
(
path_out
,
"
stderr.log
"
)),
'
w
'
)
# ----------------------------------------------------------------------------------------
# Search snow products
...
...
@@ -214,6 +218,9 @@ def main(argv):
shutil
.
copy2
(
nobs_output_file
,
path_out
)
shutil
.
copy2
(
smod_file
,
path_out
)
shutil
.
copy2
(
sod_file
,
path_out
)
if
log
:
shutil
.
copy2
(
stdout_file
,
path_out
)
shutil
.
copy2
(
stderr_file
,
path_out
)
os
.
remove
(
input_dates_file_path
)
os
.
remove
(
output_dates_file_path
)
...
...
@@ -224,6 +231,9 @@ def main(argv):
os
.
remove
(
nobs_output_file
)
os
.
remove
(
smod_file
)
os
.
remove
(
sod_file
)
if
log
:
os
.
remove
(
stdout_file
)
os
.
remove
(
stderr_file
)
logging
.
info
(
"
End run_snow_annual_map.py
"
)
...
...
This diff is collapsed.
Click to expand it.
python/s2snow/version.py
+
1
−
1
View file @
7feaa437
...
...
@@ -20,4 +20,4 @@
# limitations under the License.
#
VERSION
=
"
1.6.
3
"
VERSION
=
"
1.6.
5
"
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