Conite001 paren8esis commited on
Commit
a90350a
·
0 Parent(s):

Duplicate from orion-ai-lab/S4A

Browse files

Co-authored-by: Mara <paren8esis@users.noreply.huggingface.co>

This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +0 -0
  2. README.md +142 -0
  3. S4A.py +219 -0
  4. data/2019/31TBF/2019_31TBF_patch_17_11.nc +3 -0
  5. data/2019/31TBF/2019_31TBF_patch_17_12.nc +3 -0
  6. data/2019/31TBF/2019_31TBF_patch_17_13.nc +3 -0
  7. data/2019/31TBF/2019_31TBF_patch_18_11.nc +3 -0
  8. data/2019/31TBF/2019_31TBF_patch_18_12.nc +3 -0
  9. data/2019/31TBF/2019_31TBF_patch_18_13.nc +3 -0
  10. data/2019/31TBF/2019_31TBF_patch_18_14.nc +3 -0
  11. data/2019/31TBF/2019_31TBF_patch_18_17.nc +3 -0
  12. data/2019/31TBF/2019_31TBF_patch_18_18.nc +3 -0
  13. data/2019/31TBF/2019_31TBF_patch_18_19.nc +3 -0
  14. data/2019/31TBF/2019_31TBF_patch_18_20.nc +3 -0
  15. data/2019/31TBF/2019_31TBF_patch_18_26.nc +3 -0
  16. data/2019/31TBF/2019_31TBF_patch_19_10.nc +3 -0
  17. data/2019/31TBF/2019_31TBF_patch_19_11.nc +3 -0
  18. data/2019/31TBF/2019_31TBF_patch_19_12.nc +3 -0
  19. data/2019/31TBF/2019_31TBF_patch_19_13.nc +3 -0
  20. data/2019/31TBF/2019_31TBF_patch_19_14.nc +3 -0
  21. data/2019/31TBF/2019_31TBF_patch_19_15.nc +3 -0
  22. data/2019/31TBF/2019_31TBF_patch_19_16.nc +3 -0
  23. data/2019/31TBF/2019_31TBF_patch_19_17.nc +3 -0
  24. data/2019/31TBF/2019_31TBF_patch_19_18.nc +3 -0
  25. data/2019/31TBF/2019_31TBF_patch_19_19.nc +3 -0
  26. data/2019/31TBF/2019_31TBF_patch_19_25.nc +3 -0
  27. data/2019/31TBF/2019_31TBF_patch_19_26.nc +3 -0
  28. data/2019/31TBF/2019_31TBF_patch_19_27.nc +3 -0
  29. data/2019/31TBF/2019_31TBF_patch_20_03.nc +3 -0
  30. data/2019/31TBF/2019_31TBF_patch_20_04.nc +3 -0
  31. data/2019/31TBF/2019_31TBF_patch_20_09.nc +3 -0
  32. data/2019/31TBF/2019_31TBF_patch_20_10.nc +3 -0
  33. data/2019/31TBF/2019_31TBF_patch_20_11.nc +3 -0
  34. data/2019/31TBF/2019_31TBF_patch_20_12.nc +3 -0
  35. data/2019/31TBF/2019_31TBF_patch_20_13.nc +3 -0
  36. data/2019/31TBF/2019_31TBF_patch_20_14.nc +3 -0
  37. data/2019/31TBF/2019_31TBF_patch_20_15.nc +3 -0
  38. data/2019/31TBF/2019_31TBF_patch_20_16.nc +3 -0
  39. data/2019/31TBF/2019_31TBF_patch_20_17.nc +3 -0
  40. data/2019/31TBF/2019_31TBF_patch_20_18.nc +3 -0
  41. data/2019/31TBF/2019_31TBF_patch_20_20.nc +3 -0
  42. data/2019/31TBF/2019_31TBF_patch_20_24.nc +3 -0
  43. data/2019/31TBF/2019_31TBF_patch_20_25.nc +3 -0
  44. data/2019/31TBF/2019_31TBF_patch_20_26.nc +3 -0
  45. data/2019/31TBF/2019_31TBF_patch_20_27.nc +3 -0
  46. data/2019/31TBF/2019_31TBF_patch_21_01.nc +3 -0
  47. data/2019/31TBF/2019_31TBF_patch_21_02.nc +3 -0
  48. data/2019/31TBF/2019_31TBF_patch_21_03.nc +3 -0
  49. data/2019/31TBF/2019_31TBF_patch_21_04.nc +3 -0
  50. data/2019/31TBF/2019_31TBF_patch_21_05.nc +3 -0
.gitattributes ADDED
The diff for this file is too large to render. See raw diff
 
README.md ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ YAML tags:
3
+ ---
4
+
5
+ ## Dataset Description
6
+
7
+ - **Homepage:** [www.sen4agrinet.space.noa.gr](https://www.sen4agrinet.space.noa.gr/)
8
+ - **Repository:** [github.com/Orion-AI-Lab/S4A](https://github.com/Orion-AI-Lab/S4A)
9
+ - **Paper:** ["A Sentinel-2 multi-year, multi-country benchmark dataset for crop classification and segmentation with deep learning" (D. Sykas, M. Sdraka, D. Zografakis, I. Papoutsis](https://arxiv.org/abs/2204.00951)
10
+
11
+ ### Dataset Summary
12
+
13
+ Sen4AgriNet is a Sentinel-2 based time series multi-country benchmark dataset, tailored for agricultural monitoring applications with Machine and Deep Learning. It is annotated from farmer declarations collected via the Land Parcel Identification System (LPIS) for harmonizing country wide labels. These declarations have only recently been made available as open data, allowing for the first time the labelling of satellite imagery from ground truth data. We proceed to propose and standardise a new crop type taxonomy across Europe that address Common Agriculture Policy (CAP) needs, based on the Food and Agriculture Organization (FAO) Indicative Crop Classification scheme. Sen4AgriNet is the only multi-country, multi-year dataset that includes all spectral information. The current version covers the period 2019-2020 for Catalonia and France, while it can be extended to include additional countries.
14
+
15
+ ### Languages
16
+
17
+ All information in the dataset is in English (`en_GB`).
18
+
19
+ ## Dataset Structure
20
+
21
+ ### Data Instances
22
+
23
+ A typical sample in Sen4AgriNet consists of the following fields:
24
+
25
+ ```
26
+ {
27
+ 'patch_full_name': '2019_31TCF_patch_10_14',
28
+ 'patch_year': '2019',
29
+ 'patch_name': 'patch_10_14',
30
+ 'patch_country_code': 'ES',
31
+ 'patch_tile': '31TCF',
32
+ 'B01': array([...]),
33
+ 'B02': array([...]),
34
+ 'B03': array([...]),
35
+ 'B04': array([...]),
36
+ 'B05': array([...]),
37
+ 'B06': array([...]),
38
+ 'B07': array([...]),
39
+ 'B08': array([...]),
40
+ 'B09': array([...]),
41
+ 'B10': array([...]),
42
+ 'B11': array([...]),
43
+ 'B12': array([...]),
44
+ 'B8A': array([...]),
45
+ 'parcels': array([...]),
46
+ 'labels': array([...]),
47
+ 'timestamp': [...]
48
+ }
49
+ ```
50
+
51
+ ### Data Fields
52
+
53
+ Below we provide a brief explanation of each field:
54
+ - `patch_full_name`: The full name of the patch.
55
+ - `patch_year`: The year of the observations included in the patch.
56
+ - `patch_name`: The name of the patch. It is of the form: `patch_xx_yy` where `xx` and `yy` are the indices of the patch inside the tile.
57
+ - `patch_country_code`: The country code of the observations included in the patch. Currently it is either `ES` for Catalonia or `FR` for France.
58
+ - `B01`, ..., `B8A`: Each one is an array containing the observations of the corresponding Sentinel-2 band. The shape of each array is (T, H, W) where T is the number of observations, H the height of the image and W the width of the image.
59
+ - `parcels`: A mask containing the parcels code number.
60
+ - `labels`: A mask containing the class codes for each crop in the taxonomy.
61
+ - `timestamp`: The timestamps of the observations.
62
+
63
+ ### Data Splits
64
+
65
+ In this version of the dataset there are no predefined train/val/test splits so that the users can define their own.
66
+
67
+ ### Data configurations
68
+
69
+ There are the following configurations in the current version of Sen4AgriNet:
70
+ - `complete`: The complete Sen4AgriNet dataset.
71
+ - `cat_2019`: Only Catalonia data for 2019.
72
+ - `cat_2020`: Only Catalonia data for 2020.
73
+ - `fr_2019`: Only France data for 2019.
74
+
75
+ ## Dataset Creation
76
+
77
+ ### Curation Rationale
78
+
79
+ One of the major problems faced by researchers in the fields of Remote Sensing and AI is the absence of country-wide labelled data that are harmonized along space and time. Specifically in the EU, the Common Agriculture Policy (CAP) has placed a stepping stone to overcome this issue by legally establishing Paying Agencies in each EU country which are responsible for distributing subsidies to farmers. In order to fulfill their objectives, Paying Agencies systematically collect the cultivated crop type and parcel geometries for every farmer and record it via the Land Parcel Identification System (LPIS) in a standardized way for each country. Unfortunately, public access to these farmer declarations has been restricted for several years, thus making it almost impossible to get country-wide ground truth data. However, since 2019 and for the
80
+ first time these datasets are gradually becoming open (e.g. France, Catalonia, Estonia, Croatia, Slovenia, Slovakia and Luxemburg). This change offers a significant opportunity for the Earth Observation (EO) community to explore novel and innovative data-driven agricultural applications, by exploiting this abundance of new LPIS information.
81
+
82
+ In principle, this fusion of the LPIS data sources has tremendous potential but there are still some barriers to overcome. First of all, the LPIS system of each country is customly configured to utilize the local language of the crop types and the specific taxonomy structure of the crops that matches the local subsidies policy implementation. This non-standardization of the labels prohibits the spatial generalization of Deep Learning (DL) models and thus needs to be carefully handled to achieve a common representation consistent among countries. On top of these contextual/semantic barriers, parcels are mapped in the corresponding national cartographic projection which in all cases is different from the cartographic projection of the satellite images and pose an additional challenge on the preparation of a consistent, proper and at scale DL-ready dataset.
83
+
84
+ Aiming to overcome the above limitations in this repository we offer Sen4AgriNet, a unique benchmark EO dataset for agricultural monitoring with the following key characteristics:
85
+ - it is **pixel based** to capture spatial parcel variability
86
+ - it is **multi-temporal** to capture the crop phenology phases
87
+ - it is **multi-annual** to model the seasonal variability
88
+ - it is **multi-country** to model the geographic spatial variability
89
+ - it is **object-aggregated** to further incorporate ground truth data (parcel geometries) in the process
90
+ - it is **modular** since it can be enlarged with parcels from more EU countries or expanded in a straightforward way to include additional sensor and non-EO data (e.g. meteorological data)
91
+
92
+ ### Source Data
93
+
94
+ 1) The LPIS data for the region of Catalonia for 2019–2020 provided by the "Agricultura, Ramaderia, Pesca i Alimentacio" with an Open Data Commons Attribution License.
95
+ 2) France LPIS data for 2019 provided by the French Paying Agency with an Open Data Commons Attribution License.
96
+ 3) All Sentinel-2 L1C images with less than 10% cloud coverage for the above tiles.
97
+
98
+ #### Initial Data Collection and Normalization
99
+
100
+ The Sentinel-2 L1C images were downloaded from Copernicus and each image was split into 900 non-overlapping patches. A single patch contains 366x366 images for the 10-meter bands, 183x183 for the 20-meter bands and 61x61 for the 60-meter bands. The size of the patches was chosen in order to have integer division of the size of the tile with all 3 different spatial resolutions of Sentinel-2.
101
+
102
+ #### Annotation process
103
+
104
+ The Indicative Crop Classification (ICC) scheme was developed by the United Nations FAO organization. It is an approach to produce a harmonized vocabulary and taxonomy for crops and plants that are used in food production. Sen4AgriNet adopts and customises an extended version of FAO ICC in order to create a universally applicable crop label nomenclature for the collected LPIS data with the following benefits:
105
+ - Single language (English) is used and naming for all classes across all participating countries.
106
+ - Classes are normalized among different datasets.
107
+ - Hierarchical class structure is adopted. Depending on the application different levels of classes can be used.
108
+ - Additional non-agricultural classes are used (e.g. "fallow land", "barren land", etc.) to model Remote Sensing spectral signatures since agricultural parcels co-exist with other unrelated classes in satellite images.
109
+
110
+ The presented custom FAO/CLC classification scheme has a total of 9 groups, 168 classes and sub-classes. The 161 classes/sub-classes are crop related, 4 are some major CLC classes (as sub-classes in this hierarchy), 2 are the fallow and barren lands, and 1 is the no data sub-class.
111
+
112
+ This crop taxonomy was used to create the `labels` mask. In addition, a second annotation mask is provided (`parcels`) where each parcel obtains a unique identifier, regardless of the crops cultivated in it.
113
+
114
+ ### Personal and Sensitive Information
115
+
116
+ None.
117
+
118
+ ## Considerations for Using the Data
119
+
120
+ ### Social Impact of Dataset
121
+
122
+ We believe that Sen4AgriNet can be regarded as a labelled benchmark dataset, tailored for CAP and the use of Sentinel-2 imagery that come at no cost, and can spur numerous DL-based applications for crop type classification, parcel extraction, parcel counting and semantic segmentation. More importantly, the dataset can be extended to include other input data sources, including Sentinel-1 Synthetic Aperture Radar data, and meteorological data, allowing a new family of applications on early warning risk assessment and agricultural insurance.
123
+
124
+ ## Additional Information
125
+
126
+ ### Licensing Information
127
+
128
+ MIT License.
129
+
130
+ ### Citation Information
131
+
132
+ ```
133
+ @ARTICLE{
134
+ 9749916,
135
+ author={Sykas, Dimitrios and Sdraka, Maria and Zografakis, Dimitrios and Papoutsis, Ioannis},
136
+ journal={IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing},
137
+ title={A Sentinel-2 multi-year, multi-country benchmark dataset for crop classification and segmentation with deep learning},
138
+ year={2022},
139
+ doi={10.1109/JSTARS.2022.3164771}
140
+ }
141
+
142
+ ```
S4A.py ADDED
@@ -0,0 +1,219 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+
16
+ from itertools import product
17
+ import numpy as np
18
+ import xarray as xr
19
+ import netCDF4
20
+ import datasets
21
+ from pathlib import Path
22
+
23
+
24
+ _CITATION = """\
25
+ @ARTICLE{
26
+ 9749916,
27
+ author={Sykas, Dimitrios and Sdraka, Maria and Zografakis, Dimitrios and Papoutsis, Ioannis},
28
+ journal={IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing},
29
+ title={A Sentinel-2 multi-year, multi-country benchmark dataset for crop classification and segmentation with deep learning},
30
+ year={2022},
31
+ doi={10.1109/JSTARS.2022.3164771}
32
+ }
33
+ """
34
+
35
+ _DESCRIPTION = """\
36
+ Sen4AgriNet is a Sentinel-2 based time series multi country benchmark dataset, tailored for
37
+ agricultural monitoring applications with Machine and Deep Learning. It is annotated from
38
+ farmer declarations collected via the Land Parcel Identification System (LPIS) for harmonizing
39
+ country wide labels. These declarations have only recently been made available as open data,
40
+ allowing for the first time the labelling of satellite imagery from ground truth data.
41
+ We proceed to propose and standardise a new crop type taxonomy across Europe that address
42
+ Common Agriculture Policy (CAP) needs, based on the Food and Agriculture Organization (FAO)
43
+ Indicative Crop Classification scheme. Sen4AgriNet is the only multi-country, multi-year dataset
44
+ that includes all spectral information. It is constructed to cover the period 2016-2020 for
45
+ Catalonia and France, while it can be extended to include additional countries.
46
+ """
47
+
48
+ _HOMEPAGE = "https://www.sen4agrinet.space.noa.gr/"
49
+
50
+ _LICENSE = "MIT License"
51
+
52
+ _URL = 'https://huggingface.co/datasets/paren8esis/S4A/resolve/main/data'
53
+
54
+ # The tiles of Catalonia
55
+ CAT_TILES = ['31TBF', '31TCF', '31TCG', '31TDF', '31TDG']
56
+
57
+ # The tiles of France
58
+ FR_TILES = ['31TCJ', '31TDK', '31TCL', '31TDM', '31UCP', '31UDR']
59
+
60
+ # The maximum indices for each patch
61
+ PATCH_IDX = {
62
+ '2019': {
63
+ '31TBF': [29, 29],
64
+ '31TCF': [29, 27],
65
+ '31TCG': [29, 29],
66
+ '31TDF': [15, 9],
67
+ '31TDG': [29, 29],
68
+ '31TCJ': [29, 29],
69
+ '31TDK': [29, 29],
70
+ '31TCL': [29, 29],
71
+ '31TDM': [29, 29],
72
+ '31UCP': [29, 29],
73
+ '31UDR': [29, 29]
74
+ },
75
+ '2020': {
76
+ '31TBF': [29, 29],
77
+ '31TCF': [29, 27],
78
+ '31TCG': [29, 29],
79
+ '31TDF': [15, 9],
80
+ '31TDG': [29, 29]
81
+ }
82
+ }
83
+
84
+
85
+ class S4A(datasets.GeneratorBasedBuilder):
86
+ VERSION = datasets.Version("0.0.1")
87
+
88
+ BUILDER_CONFIGS = [
89
+ datasets.BuilderConfig(name="complete", version=VERSION, description="All Sen4AgriNet data."),
90
+ datasets.BuilderConfig(name="cat_2019", version=VERSION, description="Sen4AgriNet data for Catalonia 2019."),
91
+ datasets.BuilderConfig(name="cat_2020", version=VERSION, description="Sen4AgriNet data for Catalonia 2020."),
92
+ datasets.BuilderConfig(name="fr_2019", version=VERSION, description="Sen4AgriNet data for France 2019."),
93
+ ]
94
+
95
+ DEFAULT_CONFIG_NAME = "complete"
96
+
97
+ def _info(self):
98
+ features = datasets.Features(
99
+ {
100
+ "patch_full_name": datasets.Value("string"),
101
+ "patch_year": datasets.Value("string"),
102
+ "patch_name": datasets.Value("string"),
103
+ "patch_country_code": datasets.Value("string"),
104
+ "patch_tile": datasets.Value("string"),
105
+ "B01": datasets.Array3D(shape=(None, 61, 61), dtype="uint16"),
106
+ "B02": datasets.Array3D(shape=(None, 366, 366), dtype="uint16"),
107
+ "B03": datasets.Array3D(shape=(None, 366, 366), dtype="uint16"),
108
+ "B04": datasets.Array3D(shape=(None, 366, 366), dtype="uint16"),
109
+ "B05": datasets.Array3D(shape=(None, 183, 183), dtype="uint16"),
110
+ "B06": datasets.Array3D(shape=(None, 183, 183), dtype="uint16"),
111
+ "B07": datasets.Array3D(shape=(None, 183, 183), dtype="uint16"),
112
+ "B08": datasets.Array3D(shape=(None, 366, 366), dtype="uint16"),
113
+ "B09": datasets.Array3D(shape=(None, 61, 61), dtype="uint16"),
114
+ "B10": datasets.Array3D(shape=(None, 61, 61), dtype="uint16"),
115
+ "B11": datasets.Array3D(shape=(None, 183, 183), dtype="uint16"),
116
+ "B12": datasets.Array3D(shape=(None, 183, 183), dtype="uint16"),
117
+ "B8A": datasets.Array3D(shape=(None, 183, 183), dtype="uint16"),
118
+ "labels": datasets.Array2D(shape=(366, 366), dtype="uint32"),
119
+ "parcels": datasets.Array2D(shape=(366, 366), dtype="uint32"),
120
+ "timestamp": datasets.Sequence(datasets.Value("timestamp[ns]"))
121
+ }
122
+ )
123
+
124
+ return datasets.DatasetInfo(
125
+ # This is the description that will appear on the datasets page.
126
+ description=_DESCRIPTION,
127
+ features=features,
128
+ homepage=_HOMEPAGE,
129
+ license=_LICENSE,
130
+ citation=_CITATION,
131
+ )
132
+
133
+
134
+ def _split_generators(self, dl_manager):
135
+ root_paths = []
136
+ if self.config.name == "complete":
137
+ for year, tile in list(product(['2019'], FR_TILES)) + list(product(['2019', '2020'], CAT_TILES)):
138
+ x, y = PATCH_IDX[year][tile]
139
+ for x_i in range(x + 1):
140
+ for y_i in range(y + 1):
141
+ try:
142
+ downloaded_paths = dl_manager.download(_URL + f'/{year}' + f'/{tile}' + f'/{year}_{tile}_patch_{str(x_i).zfill(2)}_{str(y_i).zfill(2)}.nc')
143
+ root_paths.append(downloaded_paths)
144
+ except FileNotFoundError as e:
145
+ continue
146
+
147
+ elif self.config.name == 'cat_2019':
148
+ year = '2019'
149
+ for tile in CAT_TILES:
150
+ x, y = PATCH_IDX[year][tile]
151
+ for x_i in range(x + 1):
152
+ for y_i in range(y + 1):
153
+ try:
154
+ downloaded_paths = dl_manager.download(_URL + f'/{year}' + f'/{tile}' + f'/{year}_{tile}_patch_{str(x_i).zfill(2)}_{str(y_i).zfill(2)}.nc')
155
+ root_paths.append(downloaded_paths)
156
+ except FileNotFoundError as e:
157
+ continue
158
+
159
+ elif self.config.name == 'cat_2020':
160
+ year = '2020'
161
+ for tile in CAT_TILES:
162
+ x, y = PATCH_IDX[year][tile]
163
+ for x_i in range(x + 1):
164
+ for y_i in range(y + 1):
165
+ try:
166
+ downloaded_paths = dl_manager.download(_URL + f'/{year}' + f'/{tile}' + f'/{year}_{tile}_patch_{str(x_i).zfill(2)}_{str(y_i).zfill(2)}.nc')
167
+ root_paths.append(downloaded_paths)
168
+ except FileNotFoundError as e:
169
+ continue
170
+
171
+ elif self.config.name == 'fr_2019':
172
+ year = '2019'
173
+ for tile in FR_TILES:
174
+ x, y = PATCH_IDX[year][tile]
175
+ for x_i in range(x + 1):
176
+ for y_i in range(y + 1):
177
+ try:
178
+ downloaded_paths = dl_manager.download(_URL + f'/{year}' + f'/{tile}' + f'/{year}_{tile}_patch_{str(x_i).zfill(2)}_{str(y_i).zfill(2)}.nc')
179
+ root_paths.append(downloaded_paths)
180
+ except FileNotFoundError as e:
181
+ continue
182
+
183
+ return [
184
+ datasets.SplitGenerator(
185
+ name='self.config.name',
186
+ # These kwargs will be passed to _generate_examples
187
+ gen_kwargs={
188
+ "root_paths": root_paths,
189
+ },
190
+ ),
191
+ ]
192
+
193
+
194
+ # method parameters are unpacked from `gen_kwargs` as given in `_split_generators`
195
+ def _generate_examples(self, root_paths):
196
+ for file in root_paths:
197
+ netcdf = netCDF4.Dataset(file)
198
+
199
+ res = {
200
+ "patch_full_name": netcdf.patch_full_name,
201
+ "patch_year": netcdf.patch_year,
202
+ "patch_name": netcdf.patch_name,
203
+ "patch_country_code": netcdf.patch_country_code,
204
+ "patch_tile": netcdf.patch_tile
205
+ }
206
+
207
+ time_recorded = False
208
+
209
+ for variable in ['B01', 'B02', 'B03', 'B04', 'B05', 'B06', 'B07', 'B08', 'B09', 'B10', 'B11', 'B12', 'B8A', 'labels', 'parcels']:
210
+ v = xr.open_dataset(xr.backends.NetCDF4DataStore(netcdf[variable]))
211
+ if not time_recorded:
212
+ res['timestamp'] = (v.time.values.astype(np.int64) // 10 ** 9).tolist()
213
+ time_recorded = True
214
+
215
+ res[variable] = getattr(v, variable).values
216
+
217
+ key = res['patch_full_name']
218
+ yield key, res
219
+
data/2019/31TBF/2019_31TBF_patch_17_11.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e8829ebf06bab9dce4f5b34f6fcb0a90feebbcda6c26881f1f0b0a90bf81aadf
3
+ size 26737603
data/2019/31TBF/2019_31TBF_patch_17_12.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3e50b309fac6400437db200436ff706b2b36d8a726104cd4454304e44c0baf5c
3
+ size 26698716
data/2019/31TBF/2019_31TBF_patch_17_13.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fa38c9b4d62dca43aa836ccc77b2351eb274bf87c09962b965db8667bae5bba5
3
+ size 26631696
data/2019/31TBF/2019_31TBF_patch_18_11.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9e5749417ac55bdfb953ae00ce4fce7cbc1c5533f96287f99065d226d0991df1
3
+ size 26174749
data/2019/31TBF/2019_31TBF_patch_18_12.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dba968796db5689432b151d9bb11072d0c2d96889994a08a72baed469935309f
3
+ size 26411463
data/2019/31TBF/2019_31TBF_patch_18_13.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c9bc1b6b738b5702611d9a8447604ec12ee412eed2ed58e20f5b41a0a878a209
3
+ size 26324270
data/2019/31TBF/2019_31TBF_patch_18_14.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6c30e3e582ecac020fd21c1e8636cf35ca9c79dd07ea61f4ef251eb43037ee5a
3
+ size 26385716
data/2019/31TBF/2019_31TBF_patch_18_17.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ceea53ae2b4f80e740fb23771cfb830caf4d5473573c65b1c6d9be32d7192170
3
+ size 26551568
data/2019/31TBF/2019_31TBF_patch_18_18.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e81247acaddc39f38624e99d84383d53391c3199b178e92f316bcb34ffdb3902
3
+ size 26642721
data/2019/31TBF/2019_31TBF_patch_18_19.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:15d2e16ef8ab2eae805b412b10a1c1f9368fa866aae3124b7185c49194a9a8e2
3
+ size 24262462
data/2019/31TBF/2019_31TBF_patch_18_20.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f2774f810ef84cda424ff64bdda5a910ddc2ad8e23bcfa0dc5fe0f697efad2f2
3
+ size 24699484
data/2019/31TBF/2019_31TBF_patch_18_26.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:63724547d39e85409970fbcc8608c1a98fb12a03864a194e215436ba529c603f
3
+ size 25510304
data/2019/31TBF/2019_31TBF_patch_19_10.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c82e14ab90713a510ee7746643b797a30c42d657591190d5d70103ec3f76ecb3
3
+ size 26051674
data/2019/31TBF/2019_31TBF_patch_19_11.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b5205aa0266d182c40442f55f8985975b729645495fe4f4666c989f73b3192a0
3
+ size 26478534
data/2019/31TBF/2019_31TBF_patch_19_12.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:814078ea3acfbbfc3171693ac0f5f888fe4264cd06a7fb86b514f7b39d24f34c
3
+ size 26988139
data/2019/31TBF/2019_31TBF_patch_19_13.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:22028d1368e3e8bf8420fbc3eed9c4da9fa753602a8c31e6c65b7b3d408533e7
3
+ size 26421534
data/2019/31TBF/2019_31TBF_patch_19_14.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e6787dae2b368509d8571e83c9b850e090cddfc8a8ca777aef09f6b9b8a5ee10
3
+ size 26202468
data/2019/31TBF/2019_31TBF_patch_19_15.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1961ed76da7686405e531644be560456a2dab5e70edc633e569ce3ad7170c84a
3
+ size 25303672
data/2019/31TBF/2019_31TBF_patch_19_16.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f7686c463ff3e0c85b7da76e8ba9ea30ae89cbfd7f0c239b243855b7b27c7ad4
3
+ size 25970813
data/2019/31TBF/2019_31TBF_patch_19_17.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:74d8500bf8450205cb88bae131bc6b50dca0d41cfe108f101081270ba56f8415
3
+ size 26290405
data/2019/31TBF/2019_31TBF_patch_19_18.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1347b407089927e3b3a5aae2c21d2b003913d8b2034dbd4e2108b708b2159db1
3
+ size 26094060
data/2019/31TBF/2019_31TBF_patch_19_19.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:98a74db79afffd06194dac94c5222b76ce248425c13dc2474c1efdf97a4f9e6c
3
+ size 25286275
data/2019/31TBF/2019_31TBF_patch_19_25.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d8da9900d0d4df50636e6090cdda6fa6bd94ae17daa9861a20638c1b78bdcaa0
3
+ size 24304621
data/2019/31TBF/2019_31TBF_patch_19_26.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:24d4532e6ae6346aa093de2861b22e1efdf25371a6ccd707c79046bb577e7f20
3
+ size 25878072
data/2019/31TBF/2019_31TBF_patch_19_27.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cfb470275ead4dbcb62c1ed98e635a0276115f93b777212d7ac6ade6241ed855
3
+ size 25618785
data/2019/31TBF/2019_31TBF_patch_20_03.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:705d7fcde2399126d4846b05a6cbcb8e1f6b817de309c29108b96ce21bc50778
3
+ size 25772040
data/2019/31TBF/2019_31TBF_patch_20_04.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1751bb3a47d4c4433e7466afec36ce9545805c900251fecefbbb708928455cb2
3
+ size 23521132
data/2019/31TBF/2019_31TBF_patch_20_09.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e5c2f2118d1d39d3f7225de740df46f87b7a282dafefee0381b99a217fab3c33
3
+ size 25445598
data/2019/31TBF/2019_31TBF_patch_20_10.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:99f0e23ada14a8c74434146c1828cc2e97faba47d507ef44d3e7446315d9197a
3
+ size 26425456
data/2019/31TBF/2019_31TBF_patch_20_11.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2b722a89fd04b8682493d64d453c8ed334dcfd11526f64fce1e5f37d235cb20f
3
+ size 26821524
data/2019/31TBF/2019_31TBF_patch_20_12.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b753aa0cf91198ba9634bfb4ffba9a125906ffb51007d24e88ed716401326aa2
3
+ size 27065530
data/2019/31TBF/2019_31TBF_patch_20_13.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c0d6a4674e0e9a9d216fe91e7d6408a83146d1aefbb35cf804199f6a9d3d0594
3
+ size 26952314
data/2019/31TBF/2019_31TBF_patch_20_14.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:722d3bcca8170e9d504036128852c53449934ea307a53c9fbadb6ac07145f8a2
3
+ size 26348825
data/2019/31TBF/2019_31TBF_patch_20_15.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bbe57d43d3498a3ce2959999bffa79abd5570063267474eb069a079ff7382dd5
3
+ size 25947769
data/2019/31TBF/2019_31TBF_patch_20_16.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:904bc3e9b6390c8ed4c2dd4d9fe4681ce945910569455599250c510809a4ef73
3
+ size 26148500
data/2019/31TBF/2019_31TBF_patch_20_17.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f08de67ea39bef22a87cb27b6733ba240cdc038af90f0b9b21369570f4d1db50
3
+ size 26010213
data/2019/31TBF/2019_31TBF_patch_20_18.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c410cfbaf239e213207208ec9de3415ec0311f3d74b7f5ba040e8fc4132e5118
3
+ size 23547183
data/2019/31TBF/2019_31TBF_patch_20_20.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:54a784000711236581470abec1cf731f29f482ebd293bd4c60af55a3eca7cec2
3
+ size 23481785
data/2019/31TBF/2019_31TBF_patch_20_24.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4b2e664661bf5725100bf3292108181e1a6a0473e81ce85aefc851ca09a5a4d5
3
+ size 25432807
data/2019/31TBF/2019_31TBF_patch_20_25.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:84db1240e1b4c84ffc6367de9f18e9eaf2593e752d813465f76e834196416e81
3
+ size 25084175
data/2019/31TBF/2019_31TBF_patch_20_26.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:774e4a0c532e3bf31065c33e36e478b27c233a8ba3579c6661ee4885878cc324
3
+ size 25286067
data/2019/31TBF/2019_31TBF_patch_20_27.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:47e5a4d8cee27cd6bc1a2d6fd18ba817b01a4c7494adf2e499214f12b54c0a40
3
+ size 25521844
data/2019/31TBF/2019_31TBF_patch_21_01.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4ef542bdcc07949875dee4fe9f970338f01bed2c20cce2aea0b620fef2e639a4
3
+ size 25941379
data/2019/31TBF/2019_31TBF_patch_21_02.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6d46a8127dc86d936697a1303f41eaa6faa4ae2d57ad743d482ae8a5d2d83a82
3
+ size 25686176
data/2019/31TBF/2019_31TBF_patch_21_03.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ddd70b6d31f6863f69c7ffc567440d3a004e355ab828dab6ce81f4273fe9a25b
3
+ size 25421138
data/2019/31TBF/2019_31TBF_patch_21_04.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:92d51d9ddfb66a88d7f86bf16c24572a7cac6f40246f5b096a4708ba63bdd31e
3
+ size 25060974
data/2019/31TBF/2019_31TBF_patch_21_05.nc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2097080a90ec36ea52d529316f4bfc776490a37267ba4d0bbb15ef4c4aa3cb23
3
+ size 25315095