Revision 0b9087fb
Added by Benoit Parmentier about 9 years ago
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: 10/10/2015
|
|
8 |
#MODIFIED ON: 10/23/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 |
12 | 12 |
#TODO: |
13 | 13 |
#1) Make this is a script/function callable from the shell/bash |
14 |
#2) generalize to run dates and region fast |
|
14 |
#2) generalize to run dates and region fast (use python mosaic Alberto code) |
|
15 |
#3) clean up temporary files, it builds currently on the disk |
|
16 |
#4) fix output folder for some of output files |
|
17 |
# |
|
15 | 18 |
|
16 | 19 |
################################################################################################# |
17 | 20 |
|
... | ... | |
46 | 49 |
|
47 | 50 |
#### FUNCTION USED IN SCRIPT |
48 | 51 |
|
49 |
function_mosaicing <-"global_run_scalingup_mosaicing_function_10102015.R"
|
|
52 |
function_mosaicing <-"global_run_scalingup_mosaicing_function_10232015.R"
|
|
50 | 53 |
|
51 | 54 |
in_dir_script <-"/home/parmentier/Data/IPLANT_project/env_layers_scripts" |
52 | 55 |
source(file.path(in_dir_script,function_mosaicing)) |
... | ... | |
90 | 93 |
|
91 | 94 |
num_cores <- 6 #PARAM 12 |
92 | 95 |
|
96 |
infile_mask <- "/data/project/layers/commons/NEX_data/output_run10_1500x4500_global_analyses_pred_1992_10052015/r_mask_reg4.tif" |
|
97 |
|
|
93 | 98 |
########################## START SCRIPT ############################## |
94 | 99 |
|
95 | 100 |
|
... | ... | |
152 | 157 |
|
153 | 158 |
plot(r1) |
154 | 159 |
#plot(r2) |
160 |
r1_ac <- raster(lf_accuracy_raster[1]) |
|
161 |
plot(r1_ac) |
|
155 | 162 |
|
156 | 163 |
################################# |
157 | 164 |
#### Second mosaic tiles for the variable and accuracy metrid |
... | ... | |
167 | 174 |
out_suffix_str <- paste(interpolation_method,y_var_name,day_to_mosaic[i],out_suffix,sep="_") |
168 | 175 |
#debug(mosaicFiles) |
169 | 176 |
#can also loop through methods!!! |
170 |
python_bin <- "/usr/bin/" #python gdal bin |
|
171 |
mosaic_edge_obj_prediction <- mosaicFiles(lf_mosaic1,mosaic_method="use_edge_weights", |
|
177 |
python_bin <- "/usr/bin/" #python gdal bin, this may change on NEX! |
|
178 |
mosaic_edge_obj_prediction <- mosaicFiles(lf_mosaic1, |
|
179 |
mosaic_method="use_edge_weights", |
|
172 | 180 |
num_cores=num_cores, |
181 |
r_mask_raster_name=infile_mask, |
|
173 | 182 |
python_bin=python_bin, |
174 | 183 |
df_points=NULL,NA_flag=NA_flag_val, |
175 | 184 |
file_format=file_format,out_suffix=out_suffix_str, |
... | ... | |
180 | 189 |
|
181 | 190 |
#debug(mosaicFiles) |
182 | 191 |
#can also loop through methods!!! |
183 |
mosaic_edge_obj_accuracy <- mosaicFiles(lf_accuracy_raster,mosaic_method="use_edge_weights", |
|
192 |
mosaic_edge_obj_accuracy <- mosaicFiles(lf_accuracy_raster, |
|
193 |
mosaic_method="use_edge_weights", |
|
184 | 194 |
num_cores=num_cores, |
195 |
r_mask_raster_name=infile_mask, |
|
185 | 196 |
python_bin=python_bin, |
186 | 197 |
df_points=NULL,NA_flag=NA_flag_val, |
187 | 198 |
file_format=file_format,out_suffix=out_suffix_str, |
Also available in: Unified diff
testing code on NEX with python mosaicing script from Alberto