Revision ef0bd361
Added by Benoit Parmentier about 8 years ago
climate/research/oregon/interpolation/global_product_assessment_part2_functions.R | ||
---|---|---|
20 | 20 |
# |
21 | 21 |
#setfacl -Rmd user:aguzman4:rwx /nobackupp8/bparmen1/output_run10_1500x4500_global_analyses_pred_1992_10052015 |
22 | 22 |
|
23 |
##COMMIT: modifying function to generate animation to accept list of files and additional documentation
|
|
23 |
##COMMIT: modifying function to check missing files and dates for predictions and others
|
|
24 | 24 |
|
25 | 25 |
################################################################################################# |
26 | 26 |
|
... | ... | |
251 | 251 |
return(missing_dates_obj) |
252 | 252 |
} |
253 | 253 |
|
254 |
check_missing <- function(lf, pattern_str=NULL,in_dir=".",date_start="1984101",date_end="20141231",item_no=13,out_suffix=""){ |
|
254 |
check_missing <- function(lf, pattern_str=NULL,in_dir=".",date_start="1984101",date_end="20141231",item_no=13,out_suffix="",num_cores=1,out_dir="."){
|
|
255 | 255 |
#Function to check for missing files such as mosaics or predictions for tiles etc. |
256 | 256 |
#The function assumes the name of the files contain "_". |
257 | 257 |
#INPUTS: |
258 |
#lf |
|
259 |
#pattern_str |
|
260 |
#in_dir |
|
261 |
#date_start |
|
262 |
#date_end |
|
263 |
#item_no |
|
264 |
#out_suffix |
|
258 |
#1) lf |
|
259 |
#2) pattern_str |
|
260 |
#3) in_dir |
|
261 |
#4) date_start |
|
262 |
#5) date_end |
|
263 |
#6) item_no |
|
264 |
#7) num_cores |
|
265 |
#8) out_suffix |
|
266 |
#9) out_dir |
|
265 | 267 |
#OUTPUTS |
266 | 268 |
# |
267 | 269 |
# |
... | ... | |
307 | 309 |
df_time_series_fname <- file.path(out_dir,paste0("df_time_series_",out_suffix,".txt")) #add the name of var later (tmax) |
308 | 310 |
write.table(df_time_series,file= df_time_series_fname,sep=",",row.names = F) |
309 | 311 |
|
310 |
df_time_series_obj <- list(df_raster_fname,df_time_series_fname,df_time_series)
|
|
311 |
names(df_time_series_obj) <- c("df_raster_fname","df_time_series_fname","df_time_series")
|
|
312 |
df_time_series_obj <- list(df_time_series_fname,df_time_series_fname,df_time_series)
|
|
313 |
names(df_time_series_obj) <- c("df_time_series_fname","df_time_series_fname","df_time_series")
|
|
312 | 314 |
|
313 | 315 |
## report in text file missing by year and list of dates missing in separate textfile!! |
314 | 316 |
return(df_time_series_obj) |
Also available in: Unified diff
modifying function to check missing files and dates for predictions and others