Revision fb72a262
Added by Benoit Parmentier over 8 years ago
climate/research/oregon/interpolation/global_product_assessment_part1_functions.R | ||
---|---|---|
70 | 70 |
infile_mask <- list_param$infile_mask |
71 | 71 |
scaling <- list_param$scaling |
72 | 72 |
mask_pred <- list_param$mask_pred |
73 |
matching <- list_param$matching |
|
73 | 74 |
NA_flag_val <- list_param$NA_flag_val |
74 | 75 |
out_suffix <- list_param$out_suffix |
75 | 76 |
out_dir <- list_param$out_dir |
... | ... | |
77 | 78 |
raster_name_in <- lf[i] |
78 | 79 |
|
79 | 80 |
#Step 1: match extent and resolution |
80 |
|
|
81 |
lf_files <- c(raster_name_in) #match to mask |
|
82 |
rast_ref <- infile_mask |
|
83 |
##Maching resolution is probably only necessary for the r mosaic function |
|
84 |
#Modify later to take into account option R or python... |
|
85 |
list_param_raster_match <- list(lf_files,rast_ref,file_format,python_bin,out_suffix,out_dir) |
|
86 |
names(list_param_raster_match) <- c("lf_files","rast_ref","file_format","python_bin","out_suffix","out_dir_str") |
|
87 |
r_pred_matched <- raster_match(1,list_param_raster_match) |
|
88 |
raster_name_in <- c(r_pred_matched) |
|
81 |
if(matching==TRUE){ |
|
82 |
lf_files <- c(raster_name_in) #match to mask |
|
83 |
rast_ref <- infile_mask |
|
84 |
##Maching resolution is probably only necessary for the r mosaic function |
|
85 |
#Modify later to take into account option R or python... |
|
86 |
list_param_raster_match <- list(lf_files,rast_ref,file_format,python_bin,out_suffix,out_dir) |
|
87 |
names(list_param_raster_match) <- c("lf_files","rast_ref","file_format","python_bin","out_suffix","out_dir_str") |
|
88 |
r_pred_matched <- raster_match(1,list_param_raster_match) |
|
89 |
raster_name_in <- c(r_pred_matched) |
|
90 |
} |
|
89 | 91 |
|
90 | 92 |
#Step 2: mask |
91 | 93 |
if(mask_pred==TRUE){ |
Also available in: Unified diff
pre process mosaicing, adding function for not matching extent