Skip to content

Commit

Permalink
OPTIM: Always use chunks when reading rasters sertit#58
Browse files Browse the repository at this point in the history
  • Loading branch information
remi-braun committed Mar 6, 2023
1 parent 4ab8217 commit 6bd4e49
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 12 deletions.
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release History

## 0.YY.Z (2023-MM-DD)

### Other

- OPTIM: Always use chunks when reading rasters ([#58](https://github.com/sertit/eoreader/issues/58))

## 0.19.2 (2023-02-23)

### Bug Fixes
Expand Down
14 changes: 7 additions & 7 deletions docs/sar.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ mostly because SNAP doesn't handle them.
| `Capella` | SICD, SIDD, CPHD ||
| `COSMO-Skymed` | SCS ||
| `COSMO-SkyMed` 1st Generation | DGM ||
| `COSMO-SkyMed` 2nd Generation | DGM | |
| `COSMO-SkyMed` | GEC, GTC | |
| `COSMO-SkyMed` 2nd Generation | DGM | |
| `COSMO-SkyMed` | GEC, GTC | |
| `ICEYE` | SLC ||
| `ICEYE` | GRD ||
| `ICEYE` | ORTHO | 💤 |
| `RADARSAT Constellation Mission` | SLC | |
| `RADARSAT Constellation Mission` | GRC, GCC, GCD | |
| `RADARSAT Constellation Mission` | SLC | |
| `RADARSAT Constellation Mission` | GRC, GCC, GCD | |
| `RADARSAT Constellation Mission` | GRD ||
| `RADARSAT-2` | SLC ||
| `RADARSAT-2` | SGX, SCN, SCW,<br>SCF, SCS, SSG, SPG | |
| `RADARSAT-2` | SGX, SCN, SCW,<br>SCF, SCS, SSG, SPG | |
| `RADARSAT-2` | SGF ||
| `Sentinel-1` | SLC ||
| `Sentinel-1` | GRD ||
Expand All @@ -50,11 +50,11 @@ mostly because SNAP doesn't handle them.
| `SAOCOM-1` | GTC ||
| `TerraSAR-X`, `TanDEM-X`, `PAZ SAR` | SSC ||
| `TerraSAR-X`, `TanDEM-X`, `PAZ SAR` | MGD ||
| `TerraSAR-X`, `TanDEM-X`, `PAZ SAR` | GEC | |
| `TerraSAR-X`, `TanDEM-X`, `PAZ SAR` | GEC | |
| `TerraSAR-X`, `TanDEM-X`, `PAZ SAR` | EEC ||

✅: Tested
: Never tested, **use it at your own risk!**
⚠: Never tested, **use it at your own risk!**
❌: Not handled
💤: Waiting for the release

Expand Down
5 changes: 5 additions & 0 deletions eoreader/env_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,8 @@
"""
If set and :code:`dask` is installed, EOReader will read products as dask arrays instead of numpy arrays.
"""

TILE_SIZE = "EOREADER_TILE_SIZE"
"""
If set, overrides the default tile size used in chunking (2048 by default)
"""
9 changes: 4 additions & 5 deletions eoreader/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

from eoreader import EOREADER_NAME
from eoreader.bands import is_index, is_sat_band, to_str
from eoreader.env_vars import USE_DASK
from eoreader.env_vars import TILE_SIZE, USE_DASK
from eoreader.exceptions import InvalidProductError
from eoreader.keywords import _prune_keywords

Expand Down Expand Up @@ -159,10 +159,9 @@ def read(
"""
window = kwargs.get("window")

if use_dask():
chunks = True
else:
chunks = None
# Always use chunks
tile_size = os.getenv(TILE_SIZE, 2048)
chunks = [tile_size, tile_size]

try:
# Disable georef warnings here as the SAR/Sentinel-3 products are not georeferenced
Expand Down

0 comments on commit 6bd4e49

Please sign in to comment.