Skip to content

Fix NLCD TCC filename detection#15

Open
erin-glen wants to merge 1 commit intopreprocessing/disturbancesfrom
codex/add-missing-tree-canopy-inputs
Open

Fix NLCD TCC filename detection#15
erin-glen wants to merge 1 commit intopreprocessing/disturbancesfrom
codex/add-missing-tree-canopy-inputs

Conversation

@erin-glen
Copy link
Owner

Motivation

  • The workflow reported missing NLCD Tree Canopy (TCC) rasters for years like 2001/2004/2006/2008 because the expected filename pattern didn't match the v2023-5 per-year date-range filenames.
  • v2023-5 TCC files include explicit start/end dates per year (e.g., nlcd_tcc_conus_wgs84_v2023-5_20010101_20011231_projected.tif).
  • A more robust file-resolution approach is needed to find rasters whose filenames place the year token after tcc.

Description

  • Update the NLCD_TCC_FILENAME_FMT pattern to "nlcd_tcc_conus_wgs84_v2023-5_{year}0101_{year}1231_projected.tif" to match v2023-5 per-year date ranges.
  • Add a fallback fuzzy glob in _resolve_tcc_path that tries *tcc*{year}*projected*.tif when the primary fuzzy pattern fails to catch filenames with the year after tcc.
  • Preserve the existing resolution order: prefer exact matches, then fuzzy searches across primary and fallback directories, and finally return the expected path for graceful warnings when missing.

Testing

  • No automated tests were executed for this change.

Codex Task

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.

1 participant