If we do it: VPD anomalies, trends and cd_summary() tables print the unit the data is actually in. If we never do: every VPD label in cd output reads "Pa" over values that are hPa — off by 100× to any reader who takes the unit at its word.
Problem
cd_variables() gives vpd the unit "Pa" (R/cd_variables.R:46, and the unit doc line at :13). The data is hPa:
R/cd_derive.R:93 — @return SpatRaster of VPD in hPa.
scripts/backfill_edh_all.py:26 — vpd_YYYY.tif hPa (Tetens from tmean + dewpoint)
- both vignettes label trends
hPa/dec by hand
- annual values in the bundled vignette data are ~1.5–4.2, which is hPa-scale (Pa would be ~100× larger)
vpd is absolute, so the anomaly unit is the value unit, and "Pa" reaches cd_summary()'s Unit column, cd_plot_timeseries() labels, and (since #93) raw-value plots.
Proposed Solution
R/cd_variables.R: "Pa" → "hPa", and the doc line.
- Check whether any hand-set
hPa label in the vignettes becomes redundant.
- NEWS: behaviour change — the
Unit column for vpd changes.
Found by the plan review for #93.
If we do it: VPD anomalies, trends and
cd_summary()tables print the unit the data is actually in. If we never do: every VPD label in cd output reads "Pa" over values that are hPa — off by 100× to any reader who takes the unit at its word.Problem
cd_variables()givesvpdthe unit"Pa"(R/cd_variables.R:46, and theunitdoc line at:13). The data is hPa:R/cd_derive.R:93—@return SpatRaster of VPD in hPa.scripts/backfill_edh_all.py:26—vpd_YYYY.tif hPa (Tetens from tmean + dewpoint)hPa/decby handvpdisabsolute, so the anomaly unit is the value unit, and "Pa" reachescd_summary()'sUnitcolumn,cd_plot_timeseries()labels, and (since #93) raw-value plots.Proposed Solution
R/cd_variables.R:"Pa"→"hPa", and the doc line.hPalabel in the vignettes becomes redundant.Unitcolumn for vpd changes.Found by the plan review for #93.