土壤数据库

土壤数据库,采用GEE截取

GEE代码见: https://code.earthengine.google.com/90ca0e35421652bfeb25ea0c666b0e24?noload=1

library(dplyr)
library(stringr)

read_gee <- function(f) {
  fread(f) |> select(-`system:index`, -`.geo`) |> 
    relocate(site)
}
CI <- read_gee("data-raw/st341_MODIS/Soil/Raw/flux341_CI.csv") |> rename(CI = first)

fs = dir2("data-raw/st341_MODIS/Soil/Raw", "soil")
names = basename(fs) |> str_extract("(?<=soil_).*(?=\\.)")
fs %<>% set_names(names)

lst = map(fs, read_gee)
d_soil = melt_list(lst, "var") |> 
  relocate(var, site, b0, b10, b30, b60, b100, b200)

dat = melt(d_soil, c("var", "site"), variable.name = "depth") %>% 
  dcast(site + depth ~ var, value.var = "value") %>% 
  merge(CI, by = "site") %>% 
  relocate(site, depth, clay, sand, organic, bulk, texture, swc, ph) %>% 
  mutate(swc = swc / 100, ph = ph/10, bulk = bulk/100)

fwrite(dat, "data-raw/st341_MODIS/st_341_soil.csv")
# 单位
# bulk = read_gee(fs[3]), # kg / m3
# read_gee(fs[3])

field_capacity



rpkgs/rfluxnet documentation built on Dec. 31, 2024, 9:32 a.m.