Skip to content

Commit 940b3ce

Browse files
authored
Merge pull request #35 from EOPF-Sample-Service/konstntokas-xxx-bugfix_sen2
Bugfix in cubegen of sen2
2 parents ce08a3c + 997b17e commit 940b3ce

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

CHANGES.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
## Changes in 0.1.1 (under development)
1+
## Changes in 0.1.1
2+
3+
* Fixed a bug in Sentinel-2 cube generation where, during mosaicking of adjacent tiles
4+
from the same solar day, data from one spectral band would overwrite all other bands
5+
in the final cube.
26

37

48
## Changes in 0.1.0

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ dependencies:
1010
- pystac
1111
- pystac-client
1212
- xarray
13-
- xarray-eopf
13+
- xarray-eopf >=0.1.1
1414
- xcube >=1.11.0
1515
# Development Dependencies - Tools
1616
- black

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ dependencies = [
4747
"pystac",
4848
"pystac-client",
4949
"xarray",
50-
"xarray-eopf",
50+
"xarray-eopf>=0.1.1",
5151
"xcube>=1.11.0"
5252
]
5353

xcube_eopf/prodhandlers/sentinel2.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -709,14 +709,14 @@ def _create_empty_dataset(
709709
)
710710
x = np.arange(x_start + half_res, x_end, spatial_res)
711711

712-
empty_data = da.full(
713-
(grouped_items.sizes["time"], len(y), len(x)),
714-
np.nan,
715-
chunks=(1, _TILE_SIZE, _TILE_SIZE),
716-
)
712+
chunks = (1, _TILE_SIZE, _TILE_SIZE)
713+
shape = (grouped_items.sizes["time"], len(y), len(x))
717714
ds = xr.Dataset(
718715
{
719-
key: (("time", "y", "x"), empty_data.astype(var))
716+
key: (
717+
("time", "y", "x"),
718+
da.full(shape, np.nan, dtype=var.dtype, chunks=chunks),
719+
)
720720
for (key, var) in sample_ds.data_vars.items()
721721
},
722722
coords={

xcube_eopf/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# Permissions are hereby granted under the terms of the Apache 2.0 License:
33
# https://opensource.org/license/apache-2-0.
44

5-
version = "0.1.1.dev0"
5+
version = "0.1.1"

0 commit comments

Comments
 (0)