rastertools default windows_size parameters throws error on some S2 tiles
Depending on elevation and sun angle, Radius automatically computed might be too big.
See following error:
INFO:hillshade.py::process_file:Processing file /usr/local/test_lis/dtm/32TLR/dem_20m.tif
2024-02-26T13:43:42.708 ERROR:snow_detector.py::detect_snow:Rastertools hillshade methods encountered an error : The radius (option --radius, value=629) must be strictly less than half the size of the window (option --window_size, value=1024)
2024-02-26T13:43:42.709 ERROR:let_it_snow_fsc.py::let_it_snow_fsc:The radius (option --radius, value=629) must be strictly less than half the size of the window (option --window_size, value=1024)
Traceback (most recent call last):
File "app/let_it_snow_fsc.py", line 166, in let_it_snow_fsc
detect_snow(config, output_dir, h2_chain_version, product_counter)
File "/usr/local/lib/python3.8/site-packages/s2snow/snow_detector.py", line 162, in detect_snow
compute_hillshade_mask_rastertools(relief_shadow_mask, dem, config.metadata, tmp_dir, tg_resolution,
File "/usr/local/lib/python3.8/site-packages/s2snow/hillshade.py", line 309, in compute_hillshade_mask_rastertools
hillshade_str = tool.process_file(dem_path)
File "/usr/local/lib/python3.8/dist-packages/eolab/rastertools/hillshade.py", line 128, in process_file
raise ValueError(f"The radius (option --radius, value={radius}) must be strictly "
ValueError: The radius (option --radius, value=629) must be strictly less than half the size of the window (option --window_size, value=1024)
We must:
- increase default windows_size to a sensible value (4096?)
- Check that it works on different conditions, with correct results
- Eventually make rastertools more robust to this case.