Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions PROFOUND database/Processing/Create_Stand_Data.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ names(df) <- c("year", "species_id", "site_id", "dbhArith_cm", "ba_m2ha", "age"
"stemBiomass_kgha", "rootBiomass_kgha")
df$stem <- NULL

# biomass stock variables from t/ha into kg/ha because raw data values are in t/ha
df$foliageBiomass_kgha <- df$foliageBiomass_kgha * 1000
df$branchesBiomass_kgha <- df$branchesBiomass_kgha * 1000
df$stemBiomass_kgha <- df$stemBiomass_kgha * 1000
df$rootBiomass_kgha <- df$rootBiomass_kgha * 1000

#df <- dropDuplicates(df, Tree_Data$BilyKriz)
#df <- df[ df$year %in% unique(Tree_Data$BilyKriz$year), ]
Stand_Data$BilyKriz <- df
Expand Down Expand Up @@ -174,15 +180,24 @@ cat(Soroe_LAI_2000_2013.df.des)
# Description is all there
df <- Soroe_LAI_2000_2013.df
df$species_id <- "fasy"
# reduce to single lai measurement per year:
# use only July measurements since most often lai is measured in July in Soro
df <- df[which(!duplicated(df$year)),]
head(df)
names(df) <- gsub("LAI", "lai", names(df))
Stand_Data$Soro<- df

#inFile <- "/home/trashtos/ownCloud/PROFOUND_Data/Processed/Soro/Standdata_for_DB.txt"
#df <- read.table(inFile, header = T, sep = "\t")
#df <- df[,colSums(is.na(df))<nrow(df)]
#Stand_Data$Soro

#------------------------------------------------------------------------------#
inFile <- "./Soro/standdata_biomass_for_database_soroe_28-04-2020.txt"
df_biomass <- read.table(inFile, header = T, sep = "\t")

df_full <- merge(df_biomass, df, by="year", all.x=T)

Stand_Data$Soro<- df_full
#------------------------------------------------------------------------------#
#Combine the Tree data
locations <- unique(c(names(Stand_Data), names(Stand_Data_Tree)))
# Remove Hyttiala from this
Expand Down
2 changes: 1 addition & 1 deletion PROFOUND database/Processing/Create_Tree_Data.R
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ Tree_Data$Solling_305 <- df
#------------------------------------------------------------------------------#
# Soro
#------------------------------------------------------------------------------#
tree_file <- "./Soro/treedata_for_database_soroe_20-03-2017.txt"
tree_file <- "./Soro/treedata_for_database_soroe_28-04-2020.txt"
df <- read.table(tree_file, header=T, sep="\t")
# description says height and dbh in m. Dbh it is in cm!!!
names(df)
Expand Down
2 changes: 1 addition & 1 deletion PROFOUND database/Processing/summaryProfound.R
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ unique(unlist(plotAll))

return(unique(unlist(variablesAll)) )
for (i in 1:length(files)){
table <-read.table(files[1], sep = ";", header = TRUE , colClasses = "character"),
table <-read.table(files[1], sep = ";", header = TRUE , colClasses = "character")
unique(table$code_plot)
unique(table$code_country)
}
Expand Down
2 changes: 1 addition & 1 deletion PROFOUND database/createDB/Create_DB.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ source("Version_to_DB.R")
source("Sites_to_DB.R")
source("Create_SITES_Views.R")
source("MetadataSITES_to_DB.R")
source("SITEDESCRIPTION_to_DB.R")
source("SITEDESCRIPTION_to_DB-2.R")
Comment thread
matsmahnken marked this conversation as resolved.
source("MetadataSITEDESCRIPTION_to_DB.R")
source("Create_SITEDESCRIPTION_Views.R")
# create ecological description
Expand Down
4 changes: 2 additions & 2 deletions PROFOUND database/createDB/MetadataSITEDESCRIPTION_to_DB.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ columns <- c("record_id","variable", "site_id", "type", "units", "description")
# Load libraries
# open connection to DB
db <- dbConnect(SQLite(), dbname= myDB)
if ( "METADATA_SITES_master" %in% dbListTables(db)){
dbSendQuery(db, "DROP TABLE METADATA_SITES_master")}
if ( "METADATA_SITEDESCRIPTION_master" %in% dbListTables(db)){
dbSendQuery(db, "DROP TABLE METADATA_SITEDESCRIPTION_master")}
# create table in DB (cant type minus)
dbSendQuery(conn = db,
"CREATE TABLE METADATA_SITEDESCRIPTION_master
Expand Down
16 changes: 16 additions & 0 deletions PROFOUND database/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,22 @@

# News

## v0.3 - Release Notes

### Changes in existing datasets

* TREE: removed duplicates in TREE views coming from TREE_master and PLOTSIZE_master JOIN for Soro, KROOF and Hyytiala. Replaced entire Soro data with new updated data now available from 1994-2017.
* STAND: corrected values for foliageBiomass_kgha, branchesBiomass_kgha, stemBiomass_kgha and rootBiomass_kgha for Bily Kriz to match unit. Replaced Soro data with new updated including biomass data available from 1994-2017.
* CLIMATE_ISMIPFT: renamed rad_Jcm2day to rad_Jcm2.
* METADATA_CLIMATE_ISIMIPFT: renamed unit of variable rad_Jcm2day from J cm-2 day-1 to J cm-2. CLIMATE_ISIMIP2A: renamed rad_Jcm2day to rad_Jcm2.
* METADATA_CLIMATE_ISIMIP2A: renamed unit of variable rad_Jcm2day from J cm-2 day-1 to J cm-2. CLIMATE_ISIMIP2B: renamed rad_Jcm2day to rad_Jcm2.
* METADATA_CLIMATE_ISIMIP2B: renamed unit of variable rad_Jcm2day from J cm-2 day-1 to J cm-2. CLIMATE_ISIMIP2BLBC: renamed rad_Jcm2day to rad_Jcm2.
* METADATA_CLIMATE_ISIMIP2BLBC: renamed unit of variable rad_Jcm2day from J cm-2 day-1 to J cm-2. CLIMATE_LOCAL: renamed rad_Jcm2day to rad_Jcm2.
* METADATA_CLIMATE_LOCAL: renamed unit of variable rad_Jcm2day from J cm-2 day-1 to J cm-2.
* METADATA_MODIS_MOD17A2: renamed unit of variables gpp_gCm2d and psNet_gm2d from gC m-2 d to gC m-2 d-1.
* SITEDESCRIPTION: minor changes in Soro site description. SOURCE: corrected reference DOI link.


## v0.2.0 - Release Notes

### New datasets
Expand Down
4 changes: 2 additions & 2 deletions ProfoundData/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: ProfoundData
Title: Downloading and Exploring Data from the PROFOUND Database
Version: 0.2.1
Date: 2020-03-13
Version: 0.3.0
Date: 2020-05-04
Authors@R: c(person("Ramiro", "Silveyra Gonzalez", email = "rasilgon@gmail.com", role = c("aut")),
person("Christopher", "Reyer", email = "reyer@pik-potsdam.de", role = c("aut")),
person("Mahnken", "Mats", email = "mahnken@pik-potsdam.de", role = c("aut")),
Expand Down
18 changes: 6 additions & 12 deletions ProfoundData/NEWS.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
# ProfoundData 0.2.2

New features

-

Major changes

- None
# ProfoundData 0.3.0

Minor changes

- Add
- renamed variable "Jcm2day" to "Jcm2"
- updated DOI and download links to reference to DB version 0.3
- minor change to plotting TREE variables

Bugfixes

- Add, ideally with issue / commit
- corrected flux unit conversion error in summarizeData() (see commit 3dfa079142654780a9bb74da8cca3754bf0c4f26)

# ProfoundData 0.2.1

small updates and improcement of user-experience
small updates and improvement of user-experience

# ProfoundData 0.2.0

Expand Down
12 changes: 5 additions & 7 deletions ProfoundData/R/plotPROFOUND.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,16 @@ plotPROFOUND.TREE <-function(tmp){
}else{
plotDBH <- FALSE
plotHeight <- FALSE
plotCombined <- TRUE
plotCombined <- FALSE
overviewPlots <- 0
if ("dbh1_cm" %in% names(dataSpp)) plotDBH <- TRUE
if ("height1_m" %in% names(dataSpp)) plotHeight <- TRUE
if(!is.null(tmp[["variables"]]) & length(tmp[["variablesChecked"]]) <= 2) plotCombined <- F
if(plotDBH & plotHeight) plotCombined <- TRUE
# Check if only variable is requested
if (plotHeight & plotDBH & plotCombined){
overviewPlots <- 4
}else if (plotHeight & plotDBH & !plotCombined){
overviewPlots <- 2
} else if (plotHeight || plotDBH & !plotCombined){
overviewPlots <- 1
overviewPlots <- 2
}
# This a values for segment(s)
epsilon <- 0.1
Expand All @@ -40,7 +38,7 @@ plotPROFOUND.TREE <-function(tmp){
oldpar <- par(mfrow = c(1,1), mar=c(4,4,4,2))
on.exit(par(oldpar))
}
if (plotCombined){

# Histrogram based on year
# create positions for tick marks, one more than number of bars
atYear <- 1:(length(unique(dataSpp$year)) + 1)
Expand All @@ -51,7 +49,7 @@ plotPROFOUND.TREE <-function(tmp){
# add x-axis with centered position, with labels, but without ticks.
axis(side = 1, at = mp[seq(1, length(unique(dataSpp$year)), 2)],
tick = FALSE, labels = unique(dataSpp$year)[seq(1, length(unique(dataSpp$year)), 2)])
}

# Plot averaged DBH
if(plotDBH){
meanSppDBH <- aggregate(dataSpp$dbh1_cm ~ dataSpp$year, dataSpp, mean, na.action = na.omit, simplify = T)
Expand Down
2 changes: 1 addition & 1 deletion ProfoundData/R/registerDatabaseFunctions.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ downloadDatabase<- function(location=NULL){
#if(is.null(location)) location = choose_directory()
if(is.null(location)) location = getwd()
file = paste(location, "/ProfoundData.zip", sep = "")
download.file("http://www.pik-potsdam.de/data/doi/10.5880/PIK.2019.008/ProfoundData.zip"
download.file("http://www.pik-potsdam.de/data/doi/10.5880/PIK.2020.006/ProfoundData.zip"
, file)
if(file.exists(file)) message("download successfull, trying to unzip. This may not work on some operating systems. In this case, locate the downloaded file and unzip by hand.")

Expand Down
2 changes: 1 addition & 1 deletion ProfoundData/R/summarizeData.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#' \itemize{
#' \item Climatic datasets
#' \itemize{
#' \item p_mm and rad_Jcm2day are total yearly values
#' \item p_mm and rad_Jcm2 are total yearly values
#' \item tmax_degC, tmean_degC, tmin_degC, relhum_percent, airpress_hPa and wind_ms are mean yearly values
#' }
#' \item TREE dataset
Expand Down
8 changes: 4 additions & 4 deletions ProfoundData/R/summarizePROFOUND.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ summarizePROFOUND.CLIMATE <- function(data, by = "total"){
p_mm <- ifelse("p_mm" %in% colnames(subData),sum(subData$p_mm, na.rm = T),NA)
relhum_percent <- ifelse("relhum_percent" %in% colnames(subData), mean(subData$relhum_percent, na.rm = T),NA)
airpress_hPa <- ifelse("airpress_hPa" %in% colnames(subData), mean(subData$airpress_hPa, na.rm = T),NA)
rad_Jcm2day <- ifelse("rad_Jcm2day" %in% colnames(subData), sum(subData$rad_Jcm2day, na.rm = T),NA)
rad_Jcm2 <- ifelse("rad_Jcm2" %in% colnames(subData), sum(subData$rad_Jcm2, na.rm = T),NA)
wind_ms <- ifelse("wind_ms" %in% colnames(subData), mean(subData$wind_ms, na.rm = T),NA)
subSummary <- cbind(site, site_id, year, tmax_degC, tmean_degC, tmin_degC, p_mm,
relhum_percent, airpress_hPa, rad_Jcm2day, wind_ms)
relhum_percent, airpress_hPa, rad_Jcm2, wind_ms)
return(subSummary)
}
# Summarize
Expand Down Expand Up @@ -42,7 +42,7 @@ summarizePROFOUND.CLIMATE <- function(data, by = "total"){

summarizePROFOUND.ISIMIP <- function(data, by ="total"){
#by <- "total"
variables <- c("year", "tmax_degC","tmean_degC","tmin_degC","p_mm","relhum_percent","airpress_hPa","rad_Jcm2day",
variables <- c("year", "tmax_degC","tmean_degC","tmin_degC","p_mm","relhum_percent","airpress_hPa","rad_Jcm2",
"wind_ms")
# or do a long table
if ("forcingDataset" %in% names(data)){
Expand Down Expand Up @@ -183,7 +183,7 @@ summarizePROFOUND.FLUX <- function(data, by = "total"){
if (by == "year" || by == "total"){
# Convert to tC/ha
colnames(subSummary) <- gsub("_gCm2", "_tCha1", colnames(subSummary))
subSummary <-apply(subSummary, c(1,2), function(x) x*(1/1000000)*(100000/1))
subSummary <-apply(subSummary, c(1,2), function(x) x*(1/1000000)*(10000/1))
subSummary <- as.data.frame(cbind(site, site_id, year,subSummary))
}else if (by == "day"){
mo <- unique(subData$mo)
Expand Down
10 changes: 5 additions & 5 deletions ProfoundData/data-raw/ChildDatasetSummary.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ df <- df[, !colnames(df) %in% c("source")]
rownames(df) <- NULL
```

The sites parameters were provided by the local site data responsibles. The sites variables that we included in the database are listed in the table below.
The site parameters were provided by the local site data responsibles. The site variables that we included in the database are listed in the table below.


```{r, echo=F, warning = F, message=F}
Expand All @@ -27,7 +27,7 @@ df <- df[, !colnames(df) %in% c("source")]
rownames(df) <- NULL
```

The sites description were provided by the local site data responsibles. The site description variables that we included in the database are listed in the table below.
The site description was provided by the local site data responsibles. The site description variables that we included in the database are listed in the table below.


```{r, echo=F, warning = F, message=F}
Expand Down Expand Up @@ -75,7 +75,7 @@ df <- df[, !colnames(df) %in% c("source")]
rownames(df) <- NULL
```

The soil data were provided by the local site data responsibles. The variables that we included in the database are listed in the table below. The data is very heteregenous, therefore not all variables are available for each site.
The soil data were provided by the local site data responsibles. The variables that we included in the database are listed in the table below. The data is very heterogeneous, therefore not all variables are available for each site.

```{r, echo=F, warning = F, message=F}
pander(df, adding = 0, missing = '**--**', round = 3, use.hyphening = TRUE, split.cells = 3, split.tables = 200, caption = tableCaption("Description of SOIL variables included in the database."))
Expand All @@ -93,7 +93,7 @@ df <- df[df$source != "FLUXNET",]
df <- df[, !colnames(df) %in% c("source", "comments")]
rownames(df) <- NULL

maskVariables <- c( "site_id", "date","year", "mo","day","airpress_hPa","p_mm", "rad_Jcm2day", "record_id", "relhum_percent", "tmax_degC", "tmean_degC","tmin_degC", "wind_ms")
maskVariables <- c( "site_id", "date","year", "mo","day","airpress_hPa","p_mm", "rad_Jcm2", "record_id", "relhum_percent", "tmax_degC", "tmean_degC","tmin_degC", "wind_ms")
```


Expand All @@ -103,7 +103,7 @@ pander(df, adding = 0, missing = '**--**', round = 3, use.hyphening = TRUE, s

## Dataset CLIMATE_LOCAL

The CLIMATE LOCAL data refers to climate data measured at each forest site or meteorological stations close to the site of the forest site. For those forest sites for which the data has been derived from half-hourly [FLUXNET2015](http://fluxnet.fluxdata.org/) data, we also provide the original half-hourly data in the table METEOROLOGICAL.
The CLIMATE LOCAL data refers to climate data measured at each forest site or meteorological stations close to the site of the forest site. For those forest sites for which the data has been derived from half-hourly [FLUXNET2015](http://fluxnet.fluxdata.org/) data, we also provide the original half-hourly data in the table METEOROLOGICAL.

When relative humidity was not part of the original data, we calculated it from the vapour pressure deficit and the daily temperatures as

Expand Down
6 changes: 3 additions & 3 deletions ProfoundData/data-raw/PROFOUNDdatabase.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: "The PROFOUND database"
author: "Ramiro Silveyra Gonzalez, Christopher Reyer, Mats Mahnken, Florian Hartig"
date: "`r Sys.Date()`"
abstract: "This vignette provides an overview of the Profound databse for benchmarking forest vegetation models, in particular database structure, content, data policy and an overview of each forest site contained in the database. \n \n \n"
abstract: "This vignette provides an overview of the Profound database for benchmarking forest vegetation models, in particular database structure, content, data policy and an overview of each forest site contained in the database. \n \n \n"
output:
rmarkdown::html_vignette:
toc: true
Expand Down Expand Up @@ -67,9 +67,9 @@ set.seed(1)

# Overview

The PROFOUND database (PROFOUND DB) brings together data from a wide range of data sources to evaluate vegetation models and simulate climate impacts at the forest stand scale. It includes 9 forest sites across Europe, and provides for them a site description as well as soil, climate, CO2, Nitrogen deposition, tree-level, forest stand-level and remote sensing data. Moreover, for a subset of 5 sites, also time series of carbon fluxes, energy balances and soil water are available.
The PROFOUND database (PROFOUND DB) brings together data from a wide range of data sources to evaluate vegetation models and simulate climate impacts at the forest stand scale. It includes 9 forest sites across Europe, and provides for them a site description as well as soil, climate, CO2, Nitrogen deposition, tree-level, forest stand-level and remote sensing data. Moreover, for a subset of 5 sites, also time series of carbon fluxes, energy balances and soil water are available.

For more details, see the [ProfoundData website](http://doi.org/10.5880/PIK.2019.008), as well as Reyer et al, The PROFOUND database for evaluating vegetation models and simulating climate impacts on forests, Earth Syst. Sci. Data Discuss., [https://doi.org/10.5194/essd-2019-220](https://doi.org/10.5194/essd-2019-220), in review, 2019.
For more details, see the [ProfoundData website](http://doi.org/10.5880/PIK.2020.006), as well as Reyer et al, The PROFOUND database for evaluating vegetation models and simulating climate impacts on forests, Earth Syst. Sci. Data Discuss., [https://doi.org/10.5194/essd-2019-220](https://doi.org/10.5194/essd-2019-220), in review, 2019.


# Data Policy
Expand Down
Loading