-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.txt
215 lines (155 loc) · 5.29 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
image:https://travis-ci.org/ZGIS/sentinel-2-id-generator.svg?branch=master[image]
https://codecov.io/gh/ZGIS/sentinel-2-id-generator[image:https://codecov.io/gh/ZGIS/sentinel-2-id-generator/branch/master/graph/badge.svg[codecov]]
https://www.repostatus.org/#concept[image:https://www.repostatus.org/badges/latest/concept.svg[Project
Status: Concept – Minimal or no implementation has been done yet, or the
repository is only intended to be a limited example, demo, or
proof-of-concept.]]
== Sentinel 2 id generator
_Disclaimer: This not yet ready-to-use. Seriously … come back later._
_This README was generated by a jupyter notebook and automatically
exported into Markdown. You might want to open the README.ipynb file to
see the original outputs. Do not edit the Markdown file directly as any
changes will be overwritten._
== 1. Problem
There is no unique universal identifier (uuid) for Sentinel data, which
is valid across all data hubs and is unique for the distinct images.
Even within a data hub (e.g. the Copernicus Open Data Hub) the same
image might have different uuids.
To have a clean database in the EO-Compass and the data cubes, we need
an id generator which generates reliably identical ids for identical
images and distinct ids for distinct images. In this way, a UNIQUE
constraint in the metadata table is able to prevent duplicate entries.
The semantics of what identical images are is not the job of the
database.
== 2. Sentinel-2 metadata structure (relevant elements)
For the first version the granule id (according to the UTM grid) and the
acquistion time will be used. The formatting is as follows according to
the naming convention
(https://sentinel.esa.int/web/sentinel/user-guides/sentinel-2-msi/naming-convention):
+*In[1]:*+
[source, ipython3]
----
#
# Tile/Granule id / Footprint / UTM grid id
#
# General pattern: Txxxxx
#
# Example:
#
granule_id = 'T33UVP'
#
# Acquisition time
#
# General pattern: YYYYMMDDHHMMSS
#
# Example:
#
acquisition_time = '20170105T013442'
#
# Relative orbit
#
# General pattern: integer
#
# Example:
#
rel_orbit = 122
----
== 3. Initial considerations
There will be a (simplified) version 1 of the Sentinel-2 id generator,
which is scene-based. I.e., it takes a scene name according to the UTM
grid and the acquisition time. The version 2 of the Sentinel-2 id
generator will work on arbitrary geographic regions.
== 3.1 Identical images
When are two images identical?
When they have:
* the same acquisition time
* the same footprint
* … tbd
== 3.2 Image sub-sets and partially identical images
It should be reflected that an image is a sub-set or partially identical
with another image.
== 3.3 Image footprints
It should be reflected in the id that two images have the same
footprint, but were acquired at different times.
== 3.4 Acquisition time
It is reasonable to expect that there is a time tolerance of a few
miniutes required. For example the temporal granularity might be 5
minutes (neglecting day/night changes for simplicity).
== 3.5 Image versions
Images might be re-processed by ESA using a different software version.
The version should be reflected in the id.
== 4. Example / general pattern
Version 1:
_______________________________________________________________________________________________________________________
\{granule-id}-\{rel_orbit}-\{acquisitionyear}-\{acquisitiondayofyear}-\{acquisitionhour}-\{acquisitiontime
(minutes / 5)}
t33uvp-122-2017-005-01-6
_______________________________________________________________________________________________________________________
Version 2 might be something like this: >
\{instrument}-\{platform}-\{processinglevel}-\{…?} > > MSI-A-1C-…?
== 5. Usage
Use the package as follows
+*In[2]:*+
[source, ipython3]
----
#
# Import the package
#
from s2_idgen import s2_idgen
#
# Generate a new id
#
id = s2_idgen.Generator(
granule_id = 'T33UVP',
acquisition_time = '20170105T013442',
rel_orbit = 122)
#
# Access the id
#
id.getID()
----
+*Out[2]:*+
----'t33uvp-122-2017-005-01-6'----
== 6. Development
Clone the repository:
[source,bash]
----
git clone https://github.com/ZGIS/sentinel-2-id-generator.git
----
Change working directory
[source,bash]
----
cd sentinel-2-id-generator
----
Create and activate the conda environment
[source,bash]
----
conda env create -f environment.yml
activate sentinel-tools
----
You may run the tests to verify that it is working properly
[source,bash]
----
coverage run -m s2_idgen.test_s2_idgen
----
This is made for working with Jupyter Lab. You may want to install the
current envionment as kernel:
[source,bash]
----
ipython kernel install --user --name=<any_name_for_kernel>
----
Open Jupyter Lab (and/or perhaps your most favourite python IDE) and
have fun!
Do not manually edit the README.md and README.txt as they should be
generated from this notebook.
== 7. Acknowledgements
This python package is developed with support by the Austrian Research
Promotion Agency (FFG) under the Austrian Space Application Programme
(ASAP) within the project http://sen2cube.at[Sen2Cube.at] (project no.:
866016).
== 8. Contact
If you have any questions or inquiry, please open an issue or contact
one of:
http://uni-salzburg.at/zgis/tiede[Dr. Dirk Tiede]
http://uni-salzburg.at/zgis/sudmanns[Mr. Martin Sudmanns]
http://uni-salzburg.at/zgis/augustin[Ms. Hannah Augustin]