Skip to content

Conversation

@emmanuelmathot
Copy link
Contributor

Introduce a FixedScaleOffset filter to enhance the processing of Sentinel-2 data by detecting scale and offset attributes. This filter optimizes data storage and ensures accurate representation of reflectance values. The implementation includes error handling for missing dependencies and integrates with existing encoding configurations.

Fixes #106

@emmanuelmathot emmanuelmathot requested a review from d-v-b January 12, 2026 08:47
# - FixedScaleOffset converts float64 -> uint16

# Clean storage dtype string
if isinstance(storage_dtype, str):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zarr-python has a function zarr.dtype.parse_dtype that will generate the correct zarr data type from a numpy dtype string. Do parse_dtype(original_dtype_string, zarr_format=3).to_json(zarr_format=3)

>>> parse_dtype('u1', zarr_format=3).to_json(zarr_format=3)
'uint8'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FixedScaleOffset codec not preserved during zarr v2 to v3 conversion

2 participants