Skip to content

fix: Check alpha band in Array.as_masked#114

Merged
kylebarron merged 8 commits intomainfrom
kyle/add-fixtures
Feb 28, 2026
Merged

fix: Check alpha band in Array.as_masked#114
kylebarron merged 8 commits intomainfrom
kyle/add-fixtures

Conversation

@kylebarron
Copy link
Member

@kylebarron kylebarron commented Feb 28, 2026

Change list

A GeoTIFF can hold an alpha band. This is one of the bands of the primary data IFD but is defined to hold alpha values that refer to the other bands.

Since the alpha band originates as one of the data bands, we do not remove the alpha band from the primary array.

But in order to match rasterio semantics in as_masked, we need to check for the alpha band and then set mask values according to that band.

  • Check for alpha band in as_masked so that we match rasterio semantics.
  • Add tests against rasterio

Other references:

@kylebarron kylebarron changed the title Kyle/add-fixtures fix: Check alpha band in Array.as_masked Feb 28, 2026
@github-actions github-actions bot added the fix label Feb 28, 2026
@kylebarron kylebarron merged commit 1bbe282 into main Feb 28, 2026
6 checks passed
@kylebarron kylebarron deleted the kyle/add-fixtures branch February 28, 2026 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants