Deltares / Deltares/imod-python
rasterio.open; attrs remain empty
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 41
- Forks
- 12
- Avg merge
- 21h 8m
- Merged PRs (30d)
- 1
Description
In GitLab by @tomvansteijn on Feb 11, 2021, 09:45
When opening an integer raster file (gtiff), the crs and nodata value are properly set in the DataArray attrs dict. However, when opening another raster file, a float raster, the attrs remain empty.
Not sure if the dtype makes the difference. When the attrs are not set, the "dmin" and "dmax" properties are not calculated correctly as the raster nodata value is not taken into account. This shows in the colormap in the iMOD viewer.
Attached a raster file for which the attrs remain empty when calling rasterio.open.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the attached recharge_mmd.zip file and compare rasterio.open behavior for the integer and float rasters. Inspect where the opened DataArray attrs are populated, then verify that crs and nodata are retained and that dmin and dmax account for nodata values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100