Revision e7ea31e9
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: 08/22/2016
|
|
17 |
#MODIFIED ON: 08/25/2016
|
|
18 | 18 |
#PROJECT: NCEAS INPLANT: Environment and Organisms |
19 | 19 |
|
20 | 20 |
#First source these files: |
... | ... | |
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 |
#Region 5: test |
44 | 44 |
#Rscript /nobackupp8/bparmen1/env_layers_scripts/master_script_stage_7_07052016.R TMAX /nobackupp6/aguzman4/climateLayers/out/ reg5 reg5_1991 /nobackupp6/aguzman4/climateLayers/out/reg5/mosaicsAc/ TRUE 1991 6 1e+07 use_edge_weights rmse 19910101 19910103 /nobackupp8/bparmen1/NEX_data/regions_input_files/r_mask_LST_reg5.tif /nobackupp6/aguzman4/climateLayers/out/reg5/assessment/output_reg5_1991/df_assessment_files_reg5_1991_reg5_1991.txt python ac_testing FALSE Int16 100 -100,100 |
45 |
|
|
45 | 46 |
#Region 1: test |
46 | 47 |
|
48 |
#Alberto run |
|
47 | 49 |
#Rscript /nobackupp8/bparmen1/env_layers_scripts/master_script_stage_7_04232016.R TMAX /nobackupp6/aguzman4/climateLayers/out/ reg1 reg1_1984 /nobackupp6/aguzman4/climateLayers/out/reg1/mosaics/ TRUE 1984 40 1e+07 use_edge_weights rmse 19840101 19841231 /nobackupp8/bparmen1/NEX_data/regions_input_files/r_mask_LST_reg1.tif /nobackupp6/aguzman4/climateLayers/out/reg1/assessment//output_reg1_1984/df_assessment_files_reg1_1984_reg1_1984.txt python var_pred FALSE Int16 100 -100,100 |
48 |
#Rscript /nobackupp8/bparmen1/env_layers_scripts/master_script_stage_7_08132016.R TMAX /nobackupp6/aguzman4/climateLayers/out/ reg1 reg1_1984 /nobackupp6/aguzman4/climateLayers/out/reg1/mosaics/ TRUE 1984 6 1e+07 use_edge_weights rmse 19840101 19840103 /nobackupp8/bparmen1/NEX_data/regions_input_files/r_mask_LST_reg1.tif /nobackupp6/aguzman4/climateLayers/out/reg1/assessment//output_reg1_1984/df_assessment_files_reg1_1984_reg1_1984.txt python var_pred FALSE Int16 100 -100,100 |
|
49 | 50 |
|
50 |
#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 |
|
51 |
#### Note it is mosaic not "mosaics" |
|
52 |
#Run reg1 for reg1 and number of station n: |
|
53 |
#Rscript /nobackupp8/bparmen1/env_layers_scripts/master_script_stage_7_08232016.R TMAX /nobackupp6/aguzman4/climateLayers/out/ reg1 reg1_1984 /nobackupp8/bparmen1/climateLayers/out/reg1/mosaic/ TRUE 1984 6 1e+07 use_edge_weights n 19840101 19840101 /nobackupp8/bparmen1/NEX_data/regions_input_files/r_mask_LST_reg1.tif /nobackupp6/aguzman4/climateLayers/out/reg1/assessment//output_reg1_1984/df_assessment_files_reg1_1984_reg1_1984.txt python ac_testing FALSE Int16 1 0,32767 |
|
54 |
|
|
55 |
#Run reg1 for reg1 and residuals testing: |
|
56 |
#Rscript /nobackupp8/bparmen1/env_layers_scripts/master_script_stage_7_08232016.R TMAX /nobackupp6/aguzman4/climateLayers/out/ reg1 reg1_1984 /nobackupp8/bparmen1/climateLayers/out/reg1/mosaic/ TRUE 1984 6 1e+07 use_edge_weights rmse 19840101 19840101 /nobackupp8/bparmen1/NEX_data/regions_input_files/r_mask_LST_reg1.tif /nobackupp6/aguzman4/climateLayers/out/reg1/assessment//output_reg1_1984/df_assessment_files_reg1_1984_reg1_1984.txt python res_testing FALSE Int16 100 -100,100 |
|
57 |
|
|
58 |
#Run reg1 for reg1 and rmse testing: |
|
59 |
#Rscript /nobackupp8/bparmen1/env_layers_scripts/master_script_stage_7_08232016.R TMAX /nobackupp6/aguzman4/climateLayers/out/ reg1 reg1_1984 /nobackupp8/bparmen1/climateLayers/out/reg1/mosaic/ TRUE 1984 6 1e+07 use_edge_weights rmse 19840101 19840101 /nobackupp8/bparmen1/NEX_data/regions_input_files/r_mask_LST_reg1.tif /nobackupp6/aguzman4/climateLayers/out/reg1/assessment//output_reg1_1984/df_assessment_files_reg1_1984_reg1_1984.txt python ac_testing FALSE Int16 100 -100,100 |
|
60 |
|
|
61 |
#Run reg1 for reg1 and var_pred (tmax): |
|
62 |
#Rscript /nobackupp8/bparmen1/env_layers_scripts/master_script_stage_7_08232016.R TMAX /nobackupp6/aguzman4/climateLayers/out/ reg1 reg1_1984 /nobackupp8/bparmen1/climateLayers/out/reg1/mosaic/ TRUE 1984 6 1e+07 use_edge_weights rmse 19840101 19840101 /nobackupp8/bparmen1/NEX_data/regions_input_files/r_mask_LST_reg1.tif /nobackupp6/aguzman4/climateLayers/out/reg1/assessment//output_reg1_1984/df_assessment_files_reg1_1984_reg1_1984.txt python var_pred FALSE Int16 100 -100,100 |
|
63 |
|
|
64 |
|
|
51 | 65 |
|
52 | 66 |
################################################################################################## |
53 | 67 |
|
... | ... | |
117 | 131 |
#The 20 arguments are passed directly from Rscript: |
118 | 132 |
|
119 | 133 |
### Use the following values to run code from the shell: |
120 |
var <- "TMAX" # variable being interpolated #param 1, arg 1 |
|
121 |
in_dir <- "/nobackupp6/aguzman4/climateLayers/out/" #PARAM2,arg 2 |
|
122 |
region_name <- "reg1" #PARAM 3, arg 3 #reg4 South America, Africa reg5,Europe reg2, North America reg1, Asia reg3 |
|
123 |
out_suffix <- "reg1_1984" #PARAM 4, arg 4 |
|
124 |
out_suffix_str <- region_name #PARAM 4, CONST 3 |
|
125 |
#out_dir <- "/nobackupp8/bparmen1/climateLayers/out/reg5/mosaicsAc" #PARAM 5,arg 5 use this location for now |
|
126 |
out_dir <- "/nobackupp8/bparmen1/climateLayers/out/reg1/mosaic" |
|
127 |
create_out_dir_param <- TRUE #PARAM 6, arg 6 |
|
128 |
year_predicted <- 1984 #PARAM 7, arg 7 |
|
129 |
num_cores <- 6 #PARAM 8, arg 8 |
|
130 |
max_mem = 1e+07 #param 9, arg 9 |
|
131 |
mosaicing_method <- "use_edge_weights" #PARAM10, arg 10 |
|
132 |
#metric_name <- "rmse" # "mae", "r" for MAE, R etc.; can also be ns or nv? #PARAM 11, arg 11 |
|
133 |
metric_name <- "n" |
|
134 |
#metric_name <- "mae" |
|
135 |
|
|
136 |
#day_start <- "19990701" #PARAM 12 arg 12 |
|
137 |
#day_end <- "19990703" #PARAM 13 arg 13 |
|
138 |
day_start <- "19840101" #PARAM 12 arg 12 |
|
139 |
day_end <- "19840101" #PARAM 13 arg 13 |
|
140 |
#infile_mask <- "/nobackupp8/bparmen1/NEX_data/regions_input_files/r_mask_LST_reg5.tif" #PARAM 14, arg 14 |
|
141 |
infile_mask <- "/nobackupp8/bparmen1/NEX_data/regions_input_files/r_mask_LST_reg1.tif" #PARAM 14, arg 14 |
|
142 |
df_assessment_files_name <- "/nobackupp6/aguzman4/climateLayers/out/reg1/assessment//output_reg1_1984/df_assessment_files_reg1_1984_reg1_1984.txt" |
|
143 |
#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 |
|
144 |
#df_assessment_files_name <- "/nobackupp6/aguzman4/climateLayers/out/reg5/assessment/output_reg5_1985/df_assessment_files_reg5_1985_reg5_1985.txt" |
|
145 |
algorithm <- "python" #PARAM 16 #if R use mosaic function for R, if python use modified gdalmerge script from Alberto Guzmann |
|
146 |
#layers_option <- c("var_pred") #arg 17 ,param 17, options are:#res_training, res_testing,ac_training, ac_testing, var_pred |
|
147 |
#layers_option <- c("ac_training") #arg 17 ,param 17, options are:#res_training, res_testing,ac_training, ac_testing, var_pred |
|
148 |
#layers_option <- c("res_training") # #arg 17 ,param 17, options are:#res_training, res_testing,ac_training, ac_testing, var_pred |
|
149 |
#layers_option <- c("res_testing") #arg 17 ,param 17, options are:#res_training, res_testing,ac_training, ac_testing, var_pred |
|
150 |
layers_option <- c("ac_testing") #arg 17 ,param 17, options are:#res_training, res_testing,ac_training, ac_testing, var_pred |
|
151 |
|
|
152 |
tmp_files <- FALSE #arg 18, param 18, keep temp files if TRUE |
|
153 |
data_type <- "Int16" #, param 19, use int32 for output layers mosaiced |
|
154 |
scaling <- 100 #, param 20, if null use 1 |
|
155 |
scaling <- 1 #use this if predicting n rather than other variables |
|
156 |
#values_range <- "-100,100" |
|
157 |
values_range <- "0,32767" #this is for n variable |
|
158 |
NA_flag_val <- -32768 #should be here |
|
134 |
# var <- "TMAX" # variable being interpolated #param 1, arg 1
|
|
135 |
# in_dir <- "/nobackupp6/aguzman4/climateLayers/out/" #PARAM2,arg 2
|
|
136 |
# region_name <- "reg1" #PARAM 3, arg 3 #reg4 South America, Africa reg5,Europe reg2, North America reg1, Asia reg3
|
|
137 |
# out_suffix <- "reg1_1984" #PARAM 4, arg 4
|
|
138 |
# out_suffix_str <- region_name #PARAM 4, CONST 3
|
|
139 |
# #out_dir <- "/nobackupp8/bparmen1/climateLayers/out/reg5/mosaicsAc" #PARAM 5,arg 5 use this location for now
|
|
140 |
# out_dir <- "/nobackupp8/bparmen1/climateLayers/out/reg1/mosaic"
|
|
141 |
# create_out_dir_param <- TRUE #PARAM 6, arg 6
|
|
142 |
# year_predicted <- 1984 #PARAM 7, arg 7
|
|
143 |
# num_cores <- 6 #PARAM 8, arg 8
|
|
144 |
# max_mem = 1e+07 #param 9, arg 9
|
|
145 |
# mosaicing_method <- "use_edge_weights" #PARAM10, arg 10
|
|
146 |
# #metric_name <- "rmse" # "mae", "r" for MAE, R etc.; can also be ns or nv? #PARAM 11, arg 11
|
|
147 |
# metric_name <- "n"
|
|
148 |
# #metric_name <- "mae"
|
|
149 |
# |
|
150 |
# #day_start <- "19990701" #PARAM 12 arg 12
|
|
151 |
# #day_end <- "19990703" #PARAM 13 arg 13
|
|
152 |
# day_start <- "19840101" #PARAM 12 arg 12
|
|
153 |
# day_end <- "19840101" #PARAM 13 arg 13
|
|
154 |
# #infile_mask <- "/nobackupp8/bparmen1/NEX_data/regions_input_files/r_mask_LST_reg5.tif" #PARAM 14, arg 14
|
|
155 |
# infile_mask <- "/nobackupp8/bparmen1/NEX_data/regions_input_files/r_mask_LST_reg1.tif" #PARAM 14, arg 14
|
|
156 |
# df_assessment_files_name <- "/nobackupp6/aguzman4/climateLayers/out/reg1/assessment//output_reg1_1984/df_assessment_files_reg1_1984_reg1_1984.txt"
|
|
157 |
# #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
|
|
158 |
# #df_assessment_files_name <- "/nobackupp6/aguzman4/climateLayers/out/reg5/assessment/output_reg5_1985/df_assessment_files_reg5_1985_reg5_1985.txt"
|
|
159 |
# algorithm <- "python" #PARAM 16 #if R use mosaic function for R, if python use modified gdalmerge script from Alberto Guzmann
|
|
160 |
# #layers_option <- c("var_pred") #arg 17 ,param 17, options are:#res_training, res_testing,ac_training, ac_testing, var_pred
|
|
161 |
# #layers_option <- c("ac_training") #arg 17 ,param 17, options are:#res_training, res_testing,ac_training, ac_testing, var_pred
|
|
162 |
# #layers_option <- c("res_training") # #arg 17 ,param 17, options are:#res_training, res_testing,ac_training, ac_testing, var_pred
|
|
163 |
# #layers_option <- c("res_testing") #arg 17 ,param 17, options are:#res_training, res_testing,ac_training, ac_testing, var_pred
|
|
164 |
# layers_option <- c("ac_testing") #arg 17 ,param 17, options are:#res_training, res_testing,ac_training, ac_testing, var_pred
|
|
165 |
# |
|
166 |
# tmp_files <- FALSE #arg 18, param 18, keep temp files if TRUE
|
|
167 |
# data_type <- "Int16" #, param 19, use int32 for output layers mosaiced
|
|
168 |
# scaling <- 100 #, param 20, if null use 1
|
|
169 |
# scaling <- 1 #use this if predicting n rather than other variables
|
|
170 |
# #values_range <- "-100,100"
|
|
171 |
# values_range <- "0,32767" #this is for n variable
|
|
172 |
# NA_flag_val <- -32768 #should be here
|
|
159 | 173 |
|
160 | 174 |
|
161 | 175 |
#path_assessment <- NOT USED "/nobackupp6/aguzman4/climateLayers/out/reg4/assessment/output_reg4_1991" #PARAM 14a, arg 14 |
Also available in: Unified diff
adding all tested options from the command line for mosaicing stage 7