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
c3622864
Commit
c3622864
authored
2 years ago
by
Aurore Dupuis
Browse files
Options
Downloads
Plain Diff
Merge branch '99-add-DOI-into-metadata' into 'develop'
Add DOI in snow products metadata Closes
#99
See merge request
!97
parents
5748fa1e
5bcf159e
No related branches found
No related tags found
1 merge request
!97
Add DOI in snow products metadata
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
python/s2snow/lis_constant.py
+3
-0
3 additions, 0 deletions
python/s2snow/lis_constant.py
python/s2snow/snow_detector.py
+2
-1
2 additions, 1 deletion
python/s2snow/snow_detector.py
python/s2snow/snow_synthesis.py
+5
-3
5 additions, 3 deletions
python/s2snow/snow_synthesis.py
with
10 additions
and
4 deletions
python/s2snow/lis_constant.py
+
3
−
0
View file @
c3622864
...
...
@@ -121,3 +121,6 @@ OUTPUT_UNDEFINED = 9
MUSCATE_DATETIME_FORMAT
=
"
%Y%m%d-%H%M%S-%f
"
LANDSAT_DATETIME_FORMAT
=
"
%Y%m%d
"
LIS_DATETIME_FORMAT
=
"
%Y%m%dT%H%M%S
"
# DOI
DOI_URL
=
"
https://doi.org/10.24400/329360/F7Q52MNK
"
This diff is collapsed.
Click to expand it.
python/s2snow/snow_detector.py
+
2
−
1
View file @
c3622864
...
...
@@ -40,7 +40,7 @@ from s2snow.lis_constant import N_GREEN, N_SWIR, N_RED, GDAL_OPT, LABEL_NO_DATA,
NO_DATA_MASK
,
DEM_RESAMPLED
,
CLOUD_PASS1
,
HISTOGRAM
,
\
SLOPE_MASK
,
GREEN
,
RED
,
SWIR
,
SNOW_PASS2
,
SNOW_PASS2_VEC
,
\
SNOW_PASS3
,
SNOW_PASS3_VEC
,
SNOW_MASK
,
SNOW_ALL
,
NDSI
,
FSCTOC
,
SNOW_VEC
,
METADATA
,
SNOW_PASS1
,
TMP_DIR
,
\
MODE_SENTINEL2
,
MISSION_S2
MODE_SENTINEL2
,
MISSION_S2
,
DOI_URL
from
s2snow.qc_flags
import
edit_lis_fsc_qc_layers
from
s2snow.resolution
import
define_band_resolution
,
adapt_to_target_resolution
...
...
@@ -821,6 +821,7 @@ def create_metadata(final_mask_file, output_dir, product_id, zs):
root
=
etree
.
Element
(
"
Source_Product
"
)
etree
.
SubElement
(
root
,
"
PRODUCT_ID
"
).
text
=
product_id
etree
.
SubElement
(
root
,
"
DOI
"
).
text
=
DOI_URL
egil
=
etree
.
SubElement
(
root
,
"
Global_Index_List
"
)
etree
.
SubElement
(
egil
,
"
QUALITY_INDEX
"
,
name
=
'
ZS
'
).
text
=
str
(
zs
)
etree
.
SubElement
(
...
...
This diff is collapsed.
Click to expand it.
python/s2snow/snow_synthesis.py
+
5
−
3
View file @
c3622864
...
...
@@ -35,7 +35,7 @@ from otbApplication import ImagePixelType_uint8, ImagePixelType_uint16
# Import python decorators for the different needed OTB applications
from
s2snow.compute_NOBS
import
compute_NOBS
from
s2snow.compute_SOD_SMOD
import
compute_SOD_SMOD
from
s2snow.lis_constant
import
TMP_DIR
,
OUTPUT_DATES_FILE
from
s2snow.lis_constant
import
TMP_DIR
,
OUTPUT_DATES_FILE
,
DOI_URL
from
s2snow.lis_exception
import
NoProductMatchingSynthesis
from
s2snow.otb_wrappers
import
band_math
,
super_impose
,
band_mathX
,
gap_filling
,
get_app_output
from
s2snow.snow_product
import
SnowProduct
...
...
@@ -199,11 +199,13 @@ def create_snow_annual_map_metadata(product_list, output_dir):
logging
.
debug
(
"
output_dir : %s
"
,
str
(
output_dir
))
metadata_path
=
op
.
join
(
output_dir
,
"
LIS_METADATA.XML
"
)
logging
.
info
(
"
Metadata file: %s
"
,
metadata_path
)
root
=
etree
.
Element
(
"
INPUTS_LIST
"
)
root
=
etree
.
Element
(
"
METADATA
"
)
etree
.
SubElement
(
root
,
"
DOI
"
).
text
=
DOI_URL
input_lst
=
etree
.
SubElement
(
root
,
"
INPUTS_LIST
"
)
for
product_path
in
product_list
:
logging
.
debug
(
"
Product path: {}
"
.
format
(
product_path
))
product_name
=
op
.
basename
(
str
(
product_path
))
etree
.
SubElement
(
roo
t
,
"
PRODUCT_NAME
"
).
text
=
product_name
etree
.
SubElement
(
input_ls
t
,
"
PRODUCT_NAME
"
).
text
=
product_name
et
=
etree
.
ElementTree
(
root
)
et
.
write
(
metadata_path
,
pretty_print
=
True
)
...
...
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