Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SIMO_output
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clblatte
SIMO_output
Commits
ae940ff7
Commit
ae940ff7
authored
5 years ago
by
clblatte
Browse files
Options
Downloads
Patches
Plain Diff
some uncommented lines for wind data load
parent
2b5429f6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
loadDB.R
+13
-11
13 additions, 11 deletions
loadDB.R
structure_SIMO_rslDB_FBE.R
+13
-13
13 additions, 13 deletions
structure_SIMO_rslDB_FBE.R
with
26 additions
and
24 deletions
loadDB.R
+
13
−
11
View file @
ae940ff7
...
...
@@ -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_
K
or
snas
_Wind_1"
) #
, "MV_
K
or
snas
_Wind_2", "
rsu_example2"
# sim_variant <- "without"
# db_names <- c("MV_
P
or
i
_Wind_1", "MV_
P
or
i
_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_sta
nd
s
/simulated_", sim_variant, "_" , name, ".db"))
# db <- dbConnect(dbDriver("SQLite"), dbname = paste0(path,"input_data/without
CC_wi
nd/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)
...
...
This diff is collapsed.
Click to expand it.
structure_SIMO_rslDB_FBE.R
+
13
−
13
View file @
ae940ff7
...
...
@@ -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_
K
or
snas
_Wind_1"
) #
, "MV_
K
or
snas
_Wind_2", "
rsu_example2"
#
# sim_variant <- "without"
# db_names <- c("MV_
P
or
i
_Wind_1", "MV_
P
or
i
_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)
# }
#
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment