Skip to content

Commit 3c2b281

Browse files
authored
release: v0.5.8
## [0.5.8] - 2025-04-08 ### Added - `polars` method in `zonal_stats`. ### Fixed - Naming of landsat native cloudmask. - Supports "." in asset name for asset query.
2 parents 0b00c79 + 6bf0eeb commit 3c2b281

File tree

9 files changed

+265
-51
lines changed

9 files changed

+265
-51
lines changed

docs/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [0.5.8] - 2025-04-08
8+
9+
### Added
10+
11+
- `polars` method in `zonal_stats`.
12+
13+
### Fixed
14+
15+
- Naming of landsat native cloudmask.
16+
- Supports "." in asset name for asset query.
17+
718
## [0.5.7] - 2025-03-28
819

920
### Added

earthdaily/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
__all__ = ["options"]
1313

14-
__version__ = "0.5.7"
14+
__version__ = "0.5.8"
1515

1616

1717
def EarthDataStore(

earthdaily/earthdatastore/__init__.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,6 +1101,7 @@ def datacube(
11011101

11021102
# if mask_with, need to add assets or to get mask item id
11031103
if mask_with:
1104+
sensor_mask = mask_with
11041105
if mask_with not in mask._available_masks:
11051106
raise NotImplementedError(
11061107
f"Specified mask '{mask_with}' is not available. Available masks providers are : {mask._available_masks}"
@@ -1231,7 +1232,7 @@ def datacube(
12311232
assets_mask = {
12321233
mask._native_mask_asset_mapping[
12331234
collections[0]
1234-
]: mask._native_mask_def_mapping[collections[0]]
1235+
]: mask._native_mask_asset_mapping[collections[0]]
12351236
}
12361237
# force resampling at nearest as qualitative value.
12371238
ds_mask = datacube(
@@ -1261,9 +1262,9 @@ def datacube(
12611262

12621263
# To filter by cloud_cover / clear_cover, we need to compute clear pixels as field level
12631264
if clear_cover or mask_statistics:
1264-
xy = ds[mask_with].isel(time=0).size
1265+
xy = ds[sensor_mask].isel(time=0).size
12651266

1266-
null_pixels = ds[mask_with].isnull().sum(dim=("x", "y"))
1267+
null_pixels = ds[sensor_mask].isnull().sum(dim=("x", "y"))
12671268
n_pixels_as_labels = xy - null_pixels
12681269

12691270
ds = ds.assign_coords({"clear_pixels": ("time", n_pixels_as_labels.data)})
@@ -1289,7 +1290,7 @@ def datacube(
12891290
if mask_with:
12901291
if clear_cover:
12911292
ds = mask.filter_clear_cover(ds, clear_cover)
1292-
ds = ds.drop_vars(mask_with)
1293+
ds = ds.drop_vars(sensor_mask)
12931294

12941295
return ds
12951296

@@ -1307,6 +1308,9 @@ def _update_search_for_assets(self, assets):
13071308
"properties",
13081309
]
13091310
}
1311+
for idx, asset in enumerate(assets):
1312+
assets[idx] = f"'{asset}'" if "." in asset else asset
1313+
13101314
fields["include"].extend([f"assets.{asset}" for asset in assets])
13111315
return fields
13121316

0 commit comments

Comments
 (0)