Project

General

Profile

« Previous | Next » 

Revision b1260ae5

Added by Benoit Parmentier over 8 years ago

adding valid range option to master script mosaicing

View differences:

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: 04/20/2016  
17
#MODIFIED ON: 04/23/2016  
18 18
#PROJECT: NCEAS INPLANT: Environment and Organisms                                                                           
19 19

  
20 20
#First source these files:
......
63 63

  
64 64
#script_path <- "/home/parmentier/Data/IPLANT_project/env_layers_scripts"
65 65
script_path <- "/nobackupp8/bparmen1/env_layers_scripts" #path to script
66
function_mosaicing_functions <- "global_run_scalingup_mosaicing_function_04202016b.R" #PARAM12
67
function_mosaicing <-"global_run_scalingup_mosaicing_04202016b.R"
66
function_mosaicing_functions <- "global_run_scalingup_mosaicing_function_04222016b.R" #PARAM12
67
function_mosaicing <-"global_run_scalingup_mosaicing_04222016.R"
68 68
source(file.path(script_path,function_mosaicing)) #source all functions used in this script 
69 69
source(file.path(script_path,function_mosaicing_functions)) #source all functions used in this script 
70 70

  
......
113 113
#algorithm <- "python" #PARAM 16 #if R use mosaic function for R, if python use modified gdalmerge script from Alberto Guzmann
114 114
#layers_option <- c("var_pred") #arg 17 ,param 17, options are:#res_training, res_testing,ac_training, ac_testing, var_pred
115 115
#tmp_files <- FALSE #arg 18, param 18
116
#use_int <- TRUE #, param 19, use int32 for output layers mosaiced
117
#scaling <- 100 #, param 20, 
116
#data_type <- Int16 #, param 19, use int32 for output layers mosaiced
117
#scaling <- 100 #, param 20, if null use 1
118
#values_range <- c(-100,100)
118 119

  
119
var<-"TMAX" # variable being interpolated #param 1, arg 1
120
var <- "TMAX" # variable being interpolated #param 1, arg 1
120 121
in_dir <- "/nobackupp6/aguzman4/climateLayers/out/" #PARAM2,arg 2
121 122
region_name <- "reg4" #PARAM 3, arg 3 #reg4 South America, Africa reg5,Europe reg2, North America reg1, Asia reg3
122
out_suffix <- "reg4" #PARAM 4, arg 4
123
out_suffix <- "reg4_1991" #PARAM 4, arg 4
123 124
out_suffix_str <- region_name #PARAM 4, CONST 3
124 125
out_dir <- "/nobackupp8/bparmen1/climateLayers/out/reg4" #PARAM 5,arg 5 use this location for now
125 126
create_out_dir_param <- TRUE #PARAM 6, arg 6
......
130 131
metric_name <- "rmse" #RMSE, MAE etc. #PARAM 11, arg 11
131 132
day_start <- "19910101" #PARAM 12 arg 12
132 133
day_end <- "19910103" #PARAM 13 arg 13
133
infile_mask <- "/nobackupp8/bparmen1/NEX_data/regions_input_files/r_mask_reg4.tif" #PARAM 14, arg 14
134
#infile_mask <- "/nobackupp8/bparmen1/NEX_data/regions_input_files/r_mask_reg4.tif" #PARAM 14, arg 14
135
infile_mask <- "/nobackupp8/bparmen1/NEX_data/regions_input_files/r_mask_LST.tif"
134 136
df_assessment_files_name <- "/nobackupp6/aguzman4/climateLayers/out/reg4/assessment/output_reg4_1991/df_assessment_files_reg4_1991_reg4_1991.txt"  # data.frame with all files used in assessmnet, PARAM 15
135 137
algorithm <- "python" #PARAM 16 #if R use mosaic function for R, if python use modified gdalmerge script from Alberto Guzmann
136 138
layers_option <- c("var_pred") #arg 17 ,param 17, options are:#res_training, res_testing,ac_training, ac_testing, var_pred
137 139
tmp_files <- FALSE #arg 18, param 18
138
use_int <- TRUE #, param 19, use int32 for output layers mosaiced
139
scaling <- 100 #, param 20, 
140
data_type <- "Int16" #, param 19, use int32 for output layers mosaiced
141
scaling <- 100 #, param 20, if NULL don't rescale values
142
values_range <- c(-100,100) #args 21, if NULL don't screen values
140 143

  
141 144
#path_assessment <- NOT USED "/nobackupp6/aguzman4/climateLayers/out/reg4/assessment/output_reg4_1991" #PARAM 14a, arg 14
142 145

  
143 146
### Testing several years on the bridge before running jobs on nodes with qsub
144 147
#Use the following command to run as script via the shell on the bridge 
145
#Rscript /nobackupp8/bparmen1/env_layers_scripts/master_script_stage_7_04202016.R TMAX /nobackupp6/aguzman4/climateLayers/out/ reg4 reg4 /nobackupp8/bparmen1/climateLayers/out/reg4 TRUE 1991 6 1e+07 use_edge_weights rmse 19910101 19910103 /nobackupp8/bparmen1/NEX_data/regions_input_files/r_mask_reg4.tif /nobackupp6/aguzman4/climateLayers/out/reg4/assessment/output_reg4_1991/df_assessment_files_reg4_1991_reg4_1991.txt python var_pred FALSE TRUE 100 
148
#Rscript /nobackupp8/bparmen1/env_layers_scripts/master_script_stage_7_04202016.R TMAX /nobackupp6/aguzman4/climateLayers/out/ reg4 reg4 /nobackupp8/bparmen1/climateLayers/out/reg4 TRUE 1991 6 1e+07 use_edge_weights rmse 19910101 19910103 /nobackupp8/bparmen1/NEX_data/regions_input_files/mask_reg4_bool.tif /nobackupp6/aguzman4/climateLayers/out/reg4/assessment/output_reg4_1991/df_assessment_files_reg4_1991_reg4_1991.txt python var_pred FALSE Int16 100 -100,100
146 149

  
147 150
############################
148 151

  
......
209 212
#layers_option <- c("var_pred") #options are:
210 213
#res_training, res_testing,ac_training, ac_testing, var_pred
211 214
tmp_files <- args[18] #PARAM 18
212
use_int <- args[19] #PARAM 19 #use integer 32 for layers outputs
215
data_type <- args[19] #PARAM 19 #use integer 32 for layers outputs
213 216
scaling <- args[20] #PARAM 19 #use integer 32 for layers outputs
217
values_range <-  args[21] #Param 21, args 21
214 218

  
215 219
#tmp_files <- FALSE
216 220
interpolation_method <- c("gam_CAI") #PARAM21
......
219 223
proj_str<- CRS_WGS84 #PARAM 24 #check this parameter
220 224
file_format <- ".tif" #PARAM 25
221 225
NA_value <- -9999 #PARAM 26
222
NA_flag_val <- NA_value #PARAM 27
226
#NA_value <- -32768 #PARAM 26
227
NA_flag_val <- NA_value #PARAM 26
223 228
use_autokrige <- F #PARAM 28
224 229
#proj_str <- CRS_locs_WGS84 #PARAM 29
225 230
#python script and gdal on NEX NASA:
......
254 259
##30 parameters passed
255 260
list_param_run_mosaicing_prediction <- list(in_dir,y_var_name,interpolation_method,region_name,
256 261
                 mosaicing_method,out_suffix,out_suffix_str,metric_name,pred_mod_name,var_pred, out_dir,
257
                 create_out_dir_param,day_to_mosaic_range,year_predicted,proj_str,file_format,NA_value,num_cores,
258
                 use_autokrige,infile_mask,df_assessment_files_name,mosaic_python,
259
                 python_bin,algorithm,match_extent,list_models,layers_option,tmp_files,use_int,scaling)
262
                 create_out_dir_param,day_to_mosaic_range,year_predicted,proj_str,file_format,NA_value,
263
                 num_cores,use_autokrige,infile_mask,df_assessment_files_name,mosaic_python,
264
                 python_bin,algorithm,match_extent,list_models,layers_option,tmp_files,data_type,scaling,values_range)
260 265
param_names <- c("in_dir","y_var_name","interpolation_method","region_name",
261 266
                 "mosaicing_method","out_suffix","out_suffix_str","metric_name","pred_mod_name","var_pred","out_dir",
262
                 "create_out_dir_param","day_to_mosaic_range","year_predicted","proj_str","file_format","NA_value","num_cores",
263
                 "use_autokrige","infile_mask","df_assessment_files_name","mosaic_python",
264
                 "python_bin","algorithm","match_extent","list_models","layers_option","tmp_files","use_int","scaling")
267
                 "create_out_dir_param","day_to_mosaic_range","year_predicted","proj_str","file_format","NA_value",
268
                 "num_cores","use_autokrige","infile_mask","df_assessment_files_name","mosaic_python",
269
                 "python_bin","algorithm","match_extent","list_models","layers_option","tmp_files","data_type","scaling","values_range")
265 270
names(list_param_run_mosaicing_prediction) <- param_names
266 271
#list_param_run_mosaicing_prediction
267 272
#debug(run_mosaicing_prediction_fun)

Also available in: Unified diff