Integrate monthly productivity over a year (no-retrieval months count as zero)
Source:R/productivity.R
vgpm_annual_integrate.RdTurns twelve monthly mean daily rates into one annual mean daily rate in the same units:
npp = sum_m rate_m * days_m / days_in_year, where a month without a retrieval (NA: polar night,
ice, no data) contributes 0 and days_in_year is 365 or 366 for a leap year. A cell with no
retrieval in ANY month stays NA (land, permanent no-data) rather than becoming a zero, so land is
never painted as zero production. n_valid counts the months with a retrieval, so the share of a
year a cell was observed travels with its rate.
Details
Because the result is still a mean daily rate, nothing downstream changes units: with twelve
observed months it equals the day-weighted mean of the months (and, for equal-length months, the
plain mean the old recipe used); with six months of 100 and six of NA it is 100 * days(those six) / 365, not 100.