Revision 2b2c1f17
Added by Benoit Parmentier over 8 years ago
climate/research/oregon/interpolation/master_script_stage_8.R | ||
---|---|---|
13 | 13 |
#STAGE 8: Comparison of predictions across regions and years with figures generation. |
14 | 14 |
#AUTHOR: Benoit Parmentier |
15 | 15 |
#CREATED ON: 12/29/2015 |
16 |
#MODIFIED ON: 03/21/2016
|
|
16 |
#MODIFIED ON: 04/29/2016
|
|
17 | 17 |
#PROJECT: NCEAS-IPLANT-NASA: Environment Layers |
18 | 18 |
|
19 | 19 |
#First source these files: |
... | ... | |
107 | 107 |
#CALLED FROM MASTER SCRIPT: |
108 | 108 |
|
109 | 109 |
#script_path <- "/nobackupp8/bparmen1/env_layers_scripts" #path to script |
110 |
script_path <- "/home/parmentier/Data/IPLANT_project/env_layers_scripts" |
|
110 |
script_path <- "/home/parmentier/Data/IPLANT_project/env_layers_scripts" #path to script |
|
111 |
|
|
111 | 112 |
function_assessment_part1_functions <- "global_run_scalingup_assessment_part1_functions_02112015.R" #PARAM12 |
112 | 113 |
function_assessment_part1a <-"global_run_scalingup_assessment_part1a_01042016.R" |
113 | 114 |
function_assessment_part2 <- "global_run_scalingup_assessment_part2_02092016.R" |
114 | 115 |
function_assessment_part2_functions <- "global_run_scalingup_assessment_part2_functions_01032016.R" |
115 |
function_assessment_part3 <- "global_run_scalingup_assessment_part3_02102016.R"
|
|
116 |
function_assessment_part3 <- "global_run_scalingup_assessment_part3_04292016b.R"
|
|
116 | 117 |
source(file.path(script_path,function_assessment_part1_functions)) #source all functions used in this script |
117 | 118 |
source(file.path(script_path,function_assessment_part1a)) #source all functions used in this script |
118 | 119 |
source(file.path(script_path,function_assessment_part2)) #source all functions used in this script |
... | ... | |
149 | 150 |
#master directory containing the definition of tile size and tiles predicted |
150 | 151 |
#in_dir1 <- "/nobackupp6/aguzman4/climateLayers/out/" #param 5, arg 2 |
151 | 152 |
in_dir <- args[2] #param 5, arg 2 |
152 |
in_dir <- "/data/project/layers/commons/NEX_data/reg23_assessment" |
|
153 |
|
|
153 |
#in_dir <- "/data/project/layers/commons/NEX_data/reg23_assessment"
|
|
154 |
in_dir <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg4/assessment" |
|
154 | 155 |
#in_dir <- "" #PARAM 0 |
155 | 156 |
#y_var_name <- "dailyTmax" #PARAM1 |
156 | 157 |
#interpolation_method <- c("gam_CAI") #PARAM2 |
... | ... | |
159 | 160 |
#region_names <- c("reg23","reg4") #selected region names, |
160 | 161 |
#run assessment by region, this is a unique region only |
161 | 162 |
region_name <- args[3] #param 6, arg 3 |
162 |
region_name <- c("reg23") #param 6, arg 3
|
|
163 |
region_name <- c("reg4") #param 6, arg 3
|
|
163 | 164 |
|
164 | 165 |
#out_prefix <- "run_global_analyses_pred_12282015" #param 7, arg 4 |
165 | 166 |
#out_dir <- "/nobackupp8/bparmen1/" #param 8, arg 5 |
166 | 167 |
#out_dir <-paste(out_dir,"_",out_prefix,sep="") |
167 | 168 |
create_out_dir_param <- TRUE #param 9, arg 6 |
168 | 169 |
out_prefix <- args[4] #param 7, arg 4 |
169 |
out_suffix <- "global_analyses_overall_assessment_reg23_03212016"
|
|
170 |
out_suffix <- "global_analyses_overall_assessment_reg4_04292016"
|
|
170 | 171 |
|
171 | 172 |
out_dir <- args[5] #param 8, arg 5 |
172 |
out_dir <- "/data/project/layers/commons/NEX_data/reg23_assessment"
|
|
173 |
out_dir <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg4/assessment"
|
|
173 | 174 |
|
174 | 175 |
#out_dir <-paste(out_dir,"_",out_prefix,sep="") |
175 | 176 |
create_out_dir_param <- args[6] #param 9, arg 6 |
... | ... | |
181 | 182 |
list_year_predicted <- args[7] # param 10, arg 7, min and max year |
182 | 183 |
|
183 | 184 |
#run_figure_by_year <- TRUE # param 10, arg 7 |
184 |
list_year_predicted <- "1996,2014"
|
|
185 |
list_year_predicted <- "1984,2014"
|
|
185 | 186 |
|
186 | 187 |
file_format <- ".tif" #format for mosaiced files # param 11 |
187 | 188 |
NA_flag_val <- -9999 #No data value, # param 12 |
188 | 189 |
#num_cores <- 6 #number of cores used # param 13, arg 8 |
189 | 190 |
plotting_figures <- TRUE #running part2 of assessment to generate figures... # param 14 |
190 | 191 |
num_cores <- args[8] #number of cores used # param 13, arg 8 |
191 |
num_cores <-6 #number of cores used # param 13, arg 8
|
|
192 |
num_cores <-11 #number of cores used # param 13, arg 8
|
|
192 | 193 |
|
193 | 194 |
##Additional parameters used in part 2, some these may be removed as code is simplified |
194 | 195 |
mosaic_plot <- FALSE #param 15 |
... | ... | |
203 | 204 |
max_mem <- args[9] #param 21 |
204 | 205 |
max_mem <- 1e+07 |
205 | 206 |
#in_dir_list_filename <- args[10] #param 22 |
206 |
in_dir_list_filename <- "/data/project/layers/commons/NEX_data/reg23_assessment/stage6_reg23_in_dir_list_03212016.txt" |
|
207 |
in_dir_list_filename <- NULL #if NULL, use teh in_dir directory to search for info |
|
208 |
#in_dir_list_filename <- "/data/project/layers/commons/NEX_data/reg23_assessment/stage6_reg23_in_dir_list_03212016.txt" |
|
207 | 209 |
#in_dir_list_filename <- "/data/project/layers/commons/NEX_data/reg4_assessment/stage6_reg4_in_dir_list_02072016.txt" |
208 | 210 |
run_figure_by_year <- args[11] # param 10, arg 7, if true will create figures for individual years... |
209 |
run_figure_by_year <- TRUE # param 10, arg 7, if true will create figures for individual years...
|
|
211 |
run_figure_by_year <- FALSE # param 10, arg 7, if true will create figures for individual years...
|
|
210 | 212 |
|
211 | 213 |
#### Prepare parameters for the production of figures... |
212 | 214 |
proj_str <- CRS_interp |
... | ... | |
265 | 267 |
"multiple_region","countries_shp","plot_region","num_cores", |
266 | 268 |
"region_name","df_assessment_files_name","threshold_missing_day","year_predicted" |
267 | 269 |
) |
268 |
#debug(run_assessment_plotting_prediction_fun) |
|
270 |
#undebug(run_assessment_plotting_prediction_fun)
|
|
269 | 271 |
df_assessment_figures_files <- |
270 | 272 |
run_assessment_plotting_prediction_fun(list_param_run_assessment_part2_plotting) |
271 | 273 |
l_list_param_run_assessment_part2_plotting[[j]] <- list_param_run_assessment_part2_plotting |
... | ... | |
278 | 280 |
#function_assessment_part2 <- "global_run_scalingup_assessment_part2_01032016.R" |
279 | 281 |
#source(file.path(script_path,function_assessment_part2)) #source all functions used in this script |
280 | 282 |
|
281 |
#debug(run_assessment_combined_region_plotting_prediction_fun) |
|
283 |
#undebug(run_assessment_combined_region_plotting_prediction_fun)
|
|
282 | 284 |
df_assessment_combined_figures_files <- |
283 | 285 |
run_assessment_combined_region_plotting_prediction_fun(list_param_run_assessment_combined_region_plotting_prediction) |
284 | 286 |
} |
Also available in: Unified diff
running overall assessment stage8 30 years summary for region 4, South America