Summary of changes and related issue
For several tools in our codebase (and for many external library calculations), there is a need for a dimension named time in a given DataArray for calculations. However, warming levels code removes this time index and replaces it with a hours/days/months_from_center dimension, since that is more accurate name than just time. This also does create some challenges with computing on this DataArray, since the hours/days/months_from_center dimension is filled with timedeltas and no longer timestamps. So, this PR is focused on including a helper function in utils that allows a user to toggle from WL indexing to a dummy time-based indexing to allow for potential metric calculations to still occur as desired.
Description of PR
Summary of changes and related issue For several tools in our codebase (and for many external library calculations), there is a need for a dimension named
time
in a given DataArray for calculations. However, warming levels code removes this time index and replaces it with ahours/days/months_from_center
dimension, since that is more accurate name than justtime
. This also does create some challenges with computing on this DataArray, since thehours/days/months_from_center
dimension is filled with timedeltas and no longer timestamps. So, this PR is focused on including a helper function inutils
that allows a user to toggle from WL indexing to a dummy time-based indexing to allow for potential metric calculations to still occur as desired.This function is aimed to be used in
vulnerability.py
andwarming_levels_approach.ipynb
(included in https://github.com/cal-adapt/cae-notebooks/pull/103)Type of change
Checklist: