Revision d7a1ad79
Added by Benoit Parmentier over 8 years ago
climate/research/oregon/interpolation/master_script_stage_7.R | ||
---|---|---|
14 | 14 |
|
15 | 15 |
#AUTHOR: Benoit Parmentier |
16 | 16 |
#CREATED ON: 01/01/2016 |
17 |
#MODIFIED ON: 06/19/2016
|
|
17 |
#MODIFIED ON: 06/24/2016
|
|
18 | 18 |
#PROJECT: NCEAS INPLANT: Environment and Organisms |
19 | 19 |
|
20 | 20 |
#First source these files: |
... | ... | |
41 | 41 |
#run mosaic for ac testing, n |
42 | 42 |
#Rscript /nobackupp8/bparmen1/env_layers_scripts/master_script_stage_7_06192016.R TMAX /nobackupp6/aguzman4/climateLayers/out/ reg4 reg4_1999 /nobackupp8/bparmen1/climateLayers/out/reg4 TRUE 1999 6 1e+07 use_edge_weights n 19990107 19990108 /nobackupp8/bparmen1/NEX_data/regions_input_files/r_mask_LST_reg4.tif /nobackupp6/aguzman4/climateLayers/out/reg4/assessment/output_reg4_1999/df_assessment_files_reg4_1999_reg4_1999.txt python ac_testing FALSE Int16 100 -100,100 |
43 | 43 |
|
44 |
#Rscript /nobackupp8/bparmen1/env_layers_scripts/master_script_stage_7_06192016.R TMAX /nobackupp6/aguzman4/climateLayers/out/ reg5 reg5_1985 /nobackupp6/aguzman4/climateLayers/out/reg5/mosaicsAc/ TRUE 1981 6 1e+07 use_edge_weights n 19910101 19910101 /nobackupp8/bparmen1/NEX_data/regions_input_files/r_mask_LST_reg5.tif /nobackupp6/aguzman4/climateLayers/out/reg5/assessment/output_reg5_1985/df_assessment_files_reg5_1985_reg5_1985.txt python ac_testing FALSE Int16 100 -100,100 |
|
45 |
|
|
46 |
|
|
47 |
#script /nobackupp8/bparmen1/env_layers_scripts/master_script_stage_7_06192016.R TMAX /nobackupp6/aguzman4/climateLayers/out/ reg5 reg5_1985 /nobackupp6/aguzman4/climateLayers/out/reg5/mosaicsAc/ TRUE 1985 6 1e+07 use_edge_weights n 19850101 19850101 /nobackupp8/bparmen1/NEX_data/regions_input_files/r_mask_LST_reg5.tif /nobackupp6/aguzman4/climateLayers/out/reg5/assessment/output_reg5_1985/df_assessment_files_reg5_1985_reg5_1985.txt python ac_testing FALSE Int16 100 -100,100 |
|
48 |
|
|
44 | 49 |
################################################################################################## |
45 | 50 |
|
46 | 51 |
### PARAMETERS DEFINED IN THE SCRIPT |
... | ... | |
77 | 82 |
|
78 | 83 |
#script_path <- "/home/parmentier/Data/IPLANT_project/env_layers_scripts" |
79 | 84 |
script_path <- "/nobackupp8/bparmen1/env_layers_scripts" #path to script |
80 |
function_mosaicing_functions <- "global_run_scalingup_mosaicing_function_06192016.R" #PARAM12
|
|
81 |
function_mosaicing <-"global_run_scalingup_mosaicing_06192016.R"
|
|
85 |
function_mosaicing_functions <- "global_run_scalingup_mosaicing_function_07012016.R" #PARAM12
|
|
86 |
function_mosaicing <-"global_run_scalingup_mosaicing_07012016.R"
|
|
82 | 87 |
source(file.path(script_path,function_mosaicing)) #source all functions used in this script |
83 | 88 |
source(file.path(script_path,function_mosaicing_functions)) #source all functions used in this script |
84 | 89 |
|
... | ... | |
108 | 113 |
#The 20 arguments are passed directly from Rscript: |
109 | 114 |
|
110 | 115 |
### Use the following values to run code from the shell: |
111 |
# var <- "TMAX" # variable being interpolated #param 1, arg 1
|
|
112 |
# in_dir <- "/nobackupp6/aguzman4/climateLayers/out/" #PARAM2,arg 2
|
|
113 |
# region_name <- "reg4" #PARAM 3, arg 3 #reg4 South America, Africa reg5,Europe reg2, North America reg1, Asia reg3
|
|
114 |
# out_suffix <- "reg4_1999" #PARAM 4, arg 4
|
|
115 |
# out_suffix_str <- region_name #PARAM 4, CONST 3
|
|
116 |
# out_dir <- "/nobackupp8/bparmen1/climateLayers/out/reg4" #PARAM 5,arg 5 use this location for now
|
|
117 |
# create_out_dir_param <- TRUE #PARAM 6, arg 6
|
|
118 |
# year_predicted <- 1999 #PARAM 7, arg 7
|
|
119 |
# num_cores <- 6 #PARAM 8, arg 8
|
|
120 |
# max_mem = 1e+07 #param 9, arg 9
|
|
121 |
# mosaicing_method <- "use_edge_weights" #PARAM10, arg 10
|
|
122 |
# metric_name <- "rmse" # "mae", "r" for MAE, R etc.; can also be ns or nv? #PARAM 11, arg 11
|
|
116 |
var <- "TMAX" # variable being interpolated #param 1, arg 1 |
|
117 |
in_dir <- "/nobackupp6/aguzman4/climateLayers/out/" #PARAM2,arg 2 |
|
118 |
region_name <- "reg5" #PARAM 3, arg 3 #reg4 South America, Africa reg5,Europe reg2, North America reg1, Asia reg3
|
|
119 |
out_suffix <- "reg5_1991" #PARAM 4, arg 4
|
|
120 |
out_suffix_str <- region_name #PARAM 4, CONST 3 |
|
121 |
out_dir <- "/nobackupp8/bparmen1/climateLayers/out/reg5/mosaicsAc" #PARAM 5,arg 5 use this location for now
|
|
122 |
create_out_dir_param <- TRUE #PARAM 6, arg 6 |
|
123 |
year_predicted <- 1991 #PARAM 7, arg 7
|
|
124 |
num_cores <- 6 #PARAM 8, arg 8
|
|
125 |
max_mem = 1e+07 #param 9, arg 9 |
|
126 |
mosaicing_method <- "use_edge_weights" #PARAM10, arg 10 |
|
127 |
metric_name <- "rmse" # "mae", "r" for MAE, R etc.; can also be ns or nv? #PARAM 11, arg 11 |
|
123 | 128 |
#metric_name <- "n" |
124 | 129 |
#metric_name <- "mae" |
125 | 130 |
|
126 | 131 |
#day_start <- "19990701" #PARAM 12 arg 12 |
127 | 132 |
#day_end <- "19990703" #PARAM 13 arg 13 |
128 |
#day_start <- "19990107" #PARAM 12 arg 12 |
|
129 |
#day_end <- "19990108" #PARAM 13 arg 13 |
|
130 |
#infile_mask <- "/nobackupp8/bparmen1/NEX_data/regions_input_files/r_mask_LST_reg4.tif" #PARAM 14, arg 14 |
|
131 |
#df_assessment_files_name <- "/nobackupp6/aguzman4/climateLayers/out/reg4/assessment/output_reg4_1999/df_assessment_files_reg4_1999_reg4_1999.txt" # data.frame with all files used in assessmnet, PARAM 15 |
|
132 |
#algorithm <- "python" #PARAM 16 #if R use mosaic function for R, if python use modified gdalmerge script from Alberto Guzmann |
|
133 |
day_start <- "19910101" #PARAM 12 arg 12 |
|
134 |
day_end <- "19910101" #PARAM 13 arg 13 |
|
135 |
infile_mask <- "/nobackupp8/bparmen1/NEX_data/regions_input_files/r_mask_LST_reg5.tif" #PARAM 14, arg 14 |
|
136 |
df_assessment_files_name <- "/nobackupp6/aguzman4/climateLayers/out/reg5/assessment/output_reg5_1991/df_assessment_files_reg5_1991_reg5_1991.txt" # data.frame with all files used in assessmnet, PARAM 15 |
|
137 |
#df_assessment_files_name <- "/nobackupp6/aguzman4/climateLayers/out/reg5/assessment/output_reg5_1985/df_assessment_files_reg5_1985_reg5_1985.txt" |
|
138 |
algorithm <- "python" #PARAM 16 #if R use mosaic function for R, if python use modified gdalmerge script from Alberto Guzmann |
|
133 | 139 |
#layers_option <- c("var_pred") #arg 17 ,param 17, options are:#res_training, res_testing,ac_training, ac_testing, var_pred |
134 | 140 |
#layers_option <- c("ac_training") #arg 17 ,param 17, options are:#res_training, res_testing,ac_training, ac_testing, var_pred |
135 | 141 |
#layers_option <- c("res_training") # #arg 17 ,param 17, options are:#res_training, res_testing,ac_training, ac_testing, var_pred |
136 | 142 |
#layers_option <- c("res_testing") #arg 17 ,param 17, options are:#res_training, res_testing,ac_training, ac_testing, var_pred |
137 |
#layers_option <- c("ac_testing") #arg 17 ,param 17, options are:#res_training, res_testing,ac_training, ac_testing, var_pred
|
|
143 |
layers_option <- c("ac_testing") #arg 17 ,param 17, options are:#res_training, res_testing,ac_training, ac_testing, var_pred |
|
138 | 144 |
|
139 |
#tmp_files <- TRUE #arg 18, param 18, keep temp files if TRUE
|
|
140 |
#data_type <- "Int16" #, param 19, use int32 for output layers mosaiced
|
|
141 |
#scaling <- 100 #, param 20, if null use 1
|
|
142 |
#values_range <- "-100,100"
|
|
143 |
#NA_flag_val <- -32768 #should be here
|
|
145 |
tmp_files <- FALSE #arg 18, param 18, keep temp files if TRUE
|
|
146 |
data_type <- "Int16" #, param 19, use int32 for output layers mosaiced |
|
147 |
scaling <- 100 #, param 20, if null use 1 |
|
148 |
values_range <- "-100,100" |
|
149 |
NA_flag_val <- -32768 #should be here |
|
144 | 150 |
|
145 | 151 |
|
146 | 152 |
#path_assessment <- NOT USED "/nobackupp6/aguzman4/climateLayers/out/reg4/assessment/output_reg4_1991" #PARAM 14a, arg 14 |
... | ... | |
276 | 282 |
#debug(debug_fun_test) |
277 | 283 |
#debug_fun_test(list_param_raster_prediction) |
278 | 284 |
i <- 1 #this select the first year of list_year_predicted |
279 |
#function_mosaicing_functions <- "global_run_scalingup_mosaicing_function_05312016.R" #PARAM12
|
|
280 |
#function_mosaicing <-"global_run_scalingup_mosaicing_06072016.R"
|
|
281 |
#source(file.path(script_path,function_mosaicing)) #source all functions used in this script
|
|
282 |
#source(file.path(script_path,function_mosaicing_functions)) #source all functions used in this script
|
|
285 |
function_mosaicing_functions <- "global_run_scalingup_mosaicing_function_06232016.R" #PARAM12
|
|
286 |
function_mosaicing <-"global_run_scalingup_mosaicing_06232016.R"
|
|
287 |
source(file.path(script_path,function_mosaicing)) #source all functions used in this script |
|
288 |
source(file.path(script_path,function_mosaicing_functions)) #source all functions used in this script |
|
283 | 289 |
|
284 | 290 |
if (stages_to_run[7]==7){ |
285 | 291 |
assessment_prediction_obj <- run_mosaicing_prediction_fun(i,list_param_run_mosaicing_prediction) |
Also available in: Unified diff
testing bug for production layers of accuracy for Africa