Revision 1f3b3331
Added by Benoit Parmentier about 8 years ago
climate/research/oregon/interpolation/global_product_assessment_part0.R | ||
---|---|---|
9 | 9 |
# |
10 | 10 |
#AUTHOR: Benoit Parmentier |
11 | 11 |
#CREATED ON: 10/27/2016 |
12 |
#MODIFIED ON: 11/21/2016
|
|
12 |
#MODIFIED ON: 11/22/2016
|
|
13 | 13 |
#Version: 1 |
14 | 14 |
#PROJECT: Environmental Layers project |
15 | 15 |
#COMMENTS: |
... | ... | |
58 | 58 |
|
59 | 59 |
###### Function used in the script ####### |
60 | 60 |
|
61 |
#Adding command line arguments to use mpiexec |
|
62 |
args<-commandArgs(TRUE) |
|
63 |
|
|
61 | 64 |
script_path <- "/nobackupp8/bparmen1/env_layers_scripts" #path to script, NEX |
62 | 65 |
#script_path <- "/home/parmentier/Data/IPLANT_project/env_layers_scripts" #path to script |
63 | 66 |
|
... | ... | |
86 | 89 |
source(file.path(script_path,function_assessment_part3)) #source all functions used in this script |
87 | 90 |
|
88 | 91 |
#Product assessment |
89 |
function_product_assessment_part0_functions <- "global_product_assessment_part0_functions_11212016.R"
|
|
92 |
function_product_assessment_part0_functions <- "global_product_assessment_part0_functions_11222016b.R"
|
|
90 | 93 |
source(file.path(script_path,function_product_assessment_part0_functions)) #source all functions used in this script |
91 | 94 |
##Don't load part 1 and part2, mosaic package does not work on NEX |
92 | 95 |
#function_product_assessment_part1_functions <- "global_product_assessment_part1_functions_09192016b.R" |
... | ... | |
97 | 100 |
############################### |
98 | 101 |
####### Parameters, constants and arguments ### |
99 | 102 |
|
103 |
#Find number of param |
|
104 |
#var <- args[1] # variable being interpolated #param 1, arg 1 |
|
105 |
#var<-"TMAX" # variable being interpolated #param 1, arg 1 |
|
106 |
|
|
100 | 107 |
#CRS_locs_WGS84 <- CRS("+proj=longlat +ellps=WGS84 +datum=WGS84 +towgs84=0,0,0") #constant 1 |
101 | 108 |
proj_str <- "+proj=longlat +ellps=WGS84 +datum=WGS84 +towgs84=0,0,0" |
102 | 109 |
|
... | ... | |
124 | 131 |
region_name <- c("reg6") #param 6, arg 3 |
125 | 132 |
out_suffix <- "global_assessment_reg6_10232016" |
126 | 133 |
create_out_dir_param <- TRUE #param 9, arg 6 |
127 |
out_dir <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg6/assessment"
|
|
134 |
out_dir <- "/nobackupp6/aguzman4/climateLayers/out/reg6/assessment"
|
|
128 | 135 |
file_format <- ".tif" #format for mosaiced files # param 11 |
129 | 136 |
NA_flag_val <- -32768 #No data value, # param 12 |
130 | 137 |
plotting_figures <- TRUE #running part2 of assessment to generate figures... # param 14 |
... | ... | |
135 | 142 |
NA_flag_val_mosaic <- -32768 |
136 | 143 |
in_dir_list_filename <- NULL #if NULL, use the in_dir directory to search for info |
137 | 144 |
#countries_shp <-"/data/project/layers/commons/NEX_data/countries.shp" #Atlas |
138 |
countries_hsp <- "/nobackupp8/bparmen1/NEX_data/countries.shp"
|
|
145 |
countries_shp <- "/nobackupp8/bparmen1/NEX_data/countries.shp"
|
|
139 | 146 |
lf_raster <- NULL #list of raster to consider |
140 | 147 |
#On NEX |
141 | 148 |
#contains all data from the run by Alberto |
... | ... | |
148 | 155 |
NA_flag_val <- NA_value |
149 | 156 |
#multiple_region <- TRUE #PARAM 12 |
150 | 157 |
region_name <- "reg6" #PARAM 13 |
151 |
countries_shp <-"/data/project/layers/commons/NEX_data/countries.shp" #PARAM 13, copy this on NEX too |
|
152 | 158 |
#/nobackupp6/aguzman4/climateLayers/out/reg6/subset/shapefiles |
153 | 159 |
list_year_predicted <- c(2000,2012,2013) #year still on disk for reg6 |
154 | 160 |
|
... | ... | |
174 | 180 |
|
175 | 181 |
|
176 | 182 |
##### prepare list of parameters for call of function |
177 |
function_product_assessment_part0_functions <- "global_product_assessment_part0_functions_11212016b.R"
|
|
183 |
function_product_assessment_part0_functions <- "global_product_assessment_part0_functions_11222016b.R"
|
|
178 | 184 |
source(file.path(script_path,function_product_assessment_part0_functions)) #source all functions used in this script |
179 | 185 |
|
180 | 186 |
list_param_predictions_tiles_missing <- list(in_dir1,region_name,y_var_name,interpolation_method,out_suffix,out_dir, |
... | ... | |
190 | 196 |
"pred_mod_name","metric_name") |
191 | 197 |
|
192 | 198 |
#debug(predictions_tiles_missing_fun) |
199 |
#Started at 11.06pm |
|
193 | 200 |
predictions_tiles_missing_fun(1,list_param=list_param_predictions_tiles_missing) |
194 | 201 |
|
195 | 202 |
#### Function to check missing tiles and estimate potential gaps |
Also available in: Unified diff
testing inputs with new function