Skip to content
Snippets Groups Projects
Commit ae940ff7 authored by clblatte's avatar clblatte
Browse files

some uncommented lines for wind data load

parent 2b5429f6
No related branches found
No related tags found
No related merge requests found
......@@ -104,8 +104,8 @@ write.table(rslt, paste0(path, "output/rslt_", sim_variant, "_all.csv" ), sep =
# # First extraction of wind simulated Korsnas data for MSc
#
# sim_variant <- "without_SA"
# db_names <- c("MV_Korsnas_Wind_1") # , "MV_Korsnas_Wind_2", "rsu_example2"
# sim_variant <- "without"
# db_names <- c("MV_Pori_Wind_1", "MV_Pori_Wind_2", "MV_Pori_Wind_3") #
#
#
# columns <- paste0("id,
......@@ -125,14 +125,18 @@ write.table(rslt, paste0(path, "output/rslt_", sim_variant, "_all.csv" ), sep =
# Harvested_V,
# Biomass,
# income_biomass,
# CARBON_STORAGE")
#
# CARBON_STORAGE,
# Carb_flux_nat_wd_nrg,
# Carbon_flux_natural_rm_wind")
#
#
# # Carb_flux_nat_wd_nrg,
# # Carbon_flux_natural_rm_wind"
# # Harvested_V_log,
# # Harvested_V_log_under_bark,
# # Harvested_V_pulp,
# # Harvested_V_pulp_under_bark
# # V_log,
# # V_log,
# # H_gm,
# # SINCE_DRAINAGE,
# # DRAINAGE_STATUS,
......@@ -140,15 +144,13 @@ write.table(rslt, paste0(path, "output/rslt_", sim_variant, "_all.csv" ), sep =
# # SINCE_DRAINAGE_ORIG,
# # V_pulp,
# # SOIL_CLASS
# # Carb_flux_nat_wd_nrg,
# # Carbon_flux_natural_rm_wind")
#
#
#
# rslt <- NULL
#
# for (name in db_names){
# db <- dbConnect(dbDriver("SQLite"), dbname = paste0(path,"input_data/without_SA_5_stands/simulated_", sim_variant, "_" , name, ".db"))
# db <- dbConnect(dbDriver("SQLite"), dbname = paste0(path,"input_data/withoutCC_wind/simulated_", sim_variant, "_" , name, ".db"))
# rsl <- dbGetQuery( db, paste0("select ", columns, " from UNIT"))
# rsl$gpkg <- name
# dbDisconnect(db)
......@@ -160,10 +162,10 @@ write.table(rslt, paste0(path, "output/rslt_", sim_variant, "_all.csv" ), sep =
# left_join(regime, by= "branching_group", all.X = TRUE)
#
# ### write table
# write.table(rslt, paste0(path, "output/rsl_without_SA_MV_Kitee.csv" ), sep = ";", row.names = F, col.names = TRUE)
# write.table(rslt, paste0(path, "output/test/rslt_", sim_variant, "CC_WIND_Pori_all.csv" ), sep = ";", row.names = F, col.names = TRUE)
#
# rslt <- read.csv(paste0(path, "output/test/rslt_", sim_variant, "_all.csv" ), sep = ";", header = TRUE, stringsAsFactors = FALSE)
#
# rslt <- read.csv(paste0(path, "output/rsl_without_SA_MV_Kitee.csv" ), sep = ";", header = TRUE, stringsAsFactors = FALSE)
......
......@@ -164,33 +164,33 @@ rm(create_table_max_v, create_table_OPERS2, create_table_OPERS3, create_table_UN
# # First extraction of wind simulated Korsnas data for MSc
#
# sim_variant <- "without_SA"
# db_names <- c("MV_Korsnas_Wind_1") # , "MV_Korsnas_Wind_2", "rsu_example2"
#
# sim_variant <- "without"
# db_names <- c("MV_Pori_Wind_1", "MV_Pori_Wind_2", "MV_Pori_Wind_3") #
#
#
#
# for (name in db_names){
# # Connect to the database
# con <- dbConnect(dbDriver("SQLite"), dbname = paste0(path,"input_data/simulated_", sim_variant,"_" ,name , "_rsu.db"))
# # con <- dbConnect(dbDriver("SQLite"), dbname = paste0(path,"input_data/test/simulated_", sim_variant,"_" ,name , ".db"))
#
#
# con <- dbConnect(dbDriver("SQLite"), dbname = paste0(path,"input_data/withoutCC_wind/simulated_", sim_variant,"_" ,name , ".db"))
#
# # If the following tables already exist, for which the query is defined, remove them
# tab_to_delete <- c("OPERS2", "OPERS3", "max_v", "UNIT")
#
#
# for(i in tab_to_delete){
# if(dbExistsTable(con, i)) {dbRemoveTable(con, i)}
# }
#
# # Run the Queries and create the final table "UNIT",
# # which contains the development of all stands and indicators under the simulated management regimes
#
# # Run the Queries and create the final table "UNIT",
# # which contains the development of all stands and indicators under the simulated management regimes
# query_to_run <- c(create_table_max_v, create_table_OPERS2, create_table_OPERS3, create_table_UNIT)
#
#
# for(i in query_to_run){
# dbExecute(con, i)
# }
#
#
# dbDisconnect(con)
#
#
# rm(query_to_run, tab_to_delete, con)
# }
#
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment