We currently hardcoded that HazardForecast.date is always set to zero when reading in xarray raster data. This was decided because it remains unclear if date encodes the forecast date or the valid date (forecast date + lead time).
It might be useful to only use this setting as a default. When the user explicitly sets, e.g., data_vars={"date": "valid_time"}, the appropriate data should be loaded from the dataset. This is currently not possible (it technically is, but the read data is always overwritten by the hardcoded zeros).
Zeros hardcoded here:
|
kwargs["date"] = np.zeros_like(kwargs["date"], dtype=int) |
This line should only apply if the user did not supply
data_vars={"date": ...}
We currently hardcoded that
HazardForecast.dateis always set to zero when reading in xarray raster data. This was decided because it remains unclear ifdateencodes the forecast date or the valid date (forecast date + lead time).It might be useful to only use this setting as a default. When the user explicitly sets, e.g.,
data_vars={"date": "valid_time"}, the appropriate data should be loaded from the dataset. This is currently not possible (it technically is, but the read data is always overwritten by the hardcoded zeros).Zeros hardcoded here:
climada_python/climada/hazard/forecast.py
Line 540 in 8100a31
This line should only apply if the user did not supply
data_vars={"date": ...}