Project

General

Profile

« Previous | Next » 

Revision 3fdb7f06

Added by Benoit Parmentier almost 9 years ago

adding accuracy metric function to main script and testing

View differences:

climate/research/oregon/interpolation/global_run_scalingup_mosaicing.R
5 5
#Analyses, figures, tables and data are also produced in the script.
6 6
#AUTHOR: Benoit Parmentier 
7 7
#CREATED ON: 04/14/2015  
8
#MODIFIED ON: 11/19/2015            
8
#MODIFIED ON: 12/02/2015            
9 9
#Version: 5
10 10
#PROJECT: Environmental Layers project     
11 11
#COMMENTS: analyses run for reg4 1992 for test of mosaicing using 1500x4500km and other tiles
......
58 58

  
59 59
#### FUNCTION USED IN SCRIPT
60 60

  
61
function_mosaicing <-"global_run_scalingup_mosaicing_function_11192015.R"
61
function_mosaicing <-"global_run_scalingup_mosaicing_function_12022015.R"
62 62

  
63 63
#in_dir_script <-"/home/parmentier/Data/IPLANT_project/env_layers_scripts" #NCEAS UCSB
64 64
in_dir_script <- "/nobackupp8/bparmen1/env_layers_scripts" #NASA NEX
......
122 122
algorithm <- "python" #if R use mosaic function for R, if python use modified gdalmerge script from Alberto Guzmann
123 123
#algorithm <- "R" #if R use mosaic function for R, if python use modified gdalmerge script from Alberto Guzmann
124 124
 
125
match_extent <- "TRUE"
125
match_extent <- "TRUE" #try without matching!!!
126 126

  
127 127
########################## START SCRIPT ##############################
128 128

  
......
167 167
out_suffix_str <- out_suffix
168 168

  
169 169
#Improve by adding multicores option
170
num_cores_tmp <- 6
170 171
list_param_accuracy_metric_raster <- list(lf,tb,metric_name,pred_mod_name,y_var_name,interpolation_method,
171
                    days_to_process,NA_flag_val,file_format,out_dir_str,out_suffix_str) 
172
                    days_to_process,num_cores_tmp,NA_flag_val,file_format,out_dir_str,out_suffix_str) 
172 173
names(list_param_accuracy_metric_raster) <- c("lf","tb","metric_name","pred_mod_name","y_var_name","interpolation_method",
173
                       "days_to_process","NA_flag_val","file_format","out_dir_str","out_suffix_str") 
174
                       "days_to_process","num_cores","NA_flag_val","file_format","out_dir_str","out_suffix_str") 
174 175
list_raster_created_obj <- lapply(1:length(day_to_mosaic),FUN=create_accuracy_metric_raster,
175 176
                                  list_param=list_param_accuracy_metric_raster)
176 177
#debug(create_accuracy_metric_raster)
......
202 203
  
203 204
  mosaic_method <- "use_edge_weights" #this is distance from edge
204 205
  out_suffix_tmp <- paste(interpolation_method,y_var_name,day_to_mosaic[i],out_suffix,sep="_")
205
  #debug(mosaicFiles)
206
  debug(mosaicFiles)
206 207
  #can also loop through methods!!!
207 208
  #python_bin <- "/usr/bin/" #python gdal bin, on Atlas NCEAS
208 209
  #python_bin <- "/nobackupp6/aguzman4/climateLayers/sharedModules/bin" #on NEX
......
280 281
                               out_dir_str=out_dir,
281 282
                               out_prefix_str <- "dailyTmax_",
282 283
                               out_suffix_str=out_suffix)
283
#plot_screen_raster_val(3,list_param_plot_mosaic)
284
#debug(plot_screen_raster_val)
284
debug(plot_screen_raster_val)
285
plot_screen_raster_val(1,list_param_plot_mosaic)
285 286

  
286
num_cores <- 1
287

  
288
num_cores <- 2
287 289
l_png_files <- mclapply(1:length(unlist(lf_mean_mosaic)[1:2]),FUN=plot_screen_raster_val,
288 290
                        list_param= list_param_plot_mosaic,
289 291
                        mc.preschedule=FALSE,mc.cores = num_cores)

Also available in: Unified diff