Repository navigation
prepClimateLayers: write stacks band-interleaved and tiled (needs reproducible#622) - #29
eliotmcintire wants to merge 4 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CwcjqqK59FmTJscyi7xUqv
…gdal = ) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CwcjqqK59FmTJscyi7xUqv
…rop the test's skip-if-ignored probe Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CwcjqqK59FmTJscyi7xUqv
|
@achubaty This code change changes the way the rasters are stored. This allows them to be read back downstream vastly faster in the cases that I am needing in fireSense --> estimated 350-500s reads of one layer drops to sub second. With no change in actual data. |
|
The change does what it says: the stacks In canClimateDataI ran canClimateData's real
Suggestions for this PR
|
…drop redundant cache-key entry, bump to 2.2.3.9010 The gdal options are an argument of the cached postProcessTo() call, so they are already in its Cache() key; the extra digest4cache entry only forced a rebuild of single-layer stacks. climateStackGdalOptions() is exported so canClimateData can use these options instead of a copy, and add them to its own cache key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@achubaty Thanks, all four are done in d61ba4d. 🤖 Generated with Claude Code |
Conflicts resolved by hand: R/prepClimateLayers.R: PR side (cache-key gdalOptions line dropped in review). NEWS: both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014G18Mik3fH4z5M5CyMSUS6
|
Closing: this change is carried on |
Climate data files are now laid out on disk so that reading one year is fast, instead of having to unpack all years every time. Reading one year's climate goes from about 9 seconds to a fraction of a second.
Affects: speed of climate-driven runs; existing multi-year climate files are rebuilt once on the next run, with identical values.
Technical details
prepClimateLayers()(R/prepClimateLayers.R, thepostProcessTo(writeTo = )call) wrote the yearly stacks with GDAL defaults, pixel-interleaved in 1-row compressed strips, so reading one year's layer decompresses all 90 (about 8.8 s per variable; ~25 s per simulated year in climateYear). Multi-layer stacks are now written withgdal = climateStackGdalOptions()(INTERLEAVE=BAND,TILED=YES, 256x256 blocks, LZW kept), and the same layer reads in about 0.14 s. Needs reproducible >= 3.2.1.9057 (reproducible#622), now the Imports floor.After review:
climateStackGdalOptions()is exported, so canClimateData can use it in its own rewrite and cache key instead of a copy.gdalis an argument of the cachedpostProcessTo()call, so it is already in thatCache()key (checked withCacheDigest()); the extradigest4cacheentry is removed, so single-layer stacks are not rebuilt for it. Version 2.2.3.9010. Merged with development (#30, #31).The test checks
INTERLEAVE=BAND, 256x256 blocks, LZW and values identical at tolerance 0 to the old layout. Local suite: 62 passed, 0 failed, 1 skipped; the 2 errors are theprepClimateLayerstests that need Google Drive credentials, which this session does not have.🤖 Generated with Claude Code