Skip to content

cd_variables(): vpd unit is Pa but the data is hPa #96

Description

@NewGraphEnvironment

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions