Revision 230fd40a
Added by Benoit Parmentier over 8 years ago
climate/research/oregon/interpolation/global_product_assessment_part1.R | ||
---|---|---|
80 | 80 |
source(file.path(script_path,function_assessment_part3)) #source all functions used in this script |
81 | 81 |
|
82 | 82 |
#Product assessment |
83 |
function_product_assessment_part1_functions <- "global_product_assessment_part1_functions_05242016b.R"
|
|
83 |
function_product_assessment_part1_functions <- "global_product_assessment_part1_functions_06142016.R"
|
|
84 | 84 |
source(file.path(script_path,function_product_assessment_part1_functions)) #source all functions used in this script |
85 | 85 |
|
86 | 86 |
############################### |
... | ... | |
713 | 713 |
#2) Compute temporal autocorrelation by station and profile |
714 | 714 |
#3) |
715 | 715 |
|
716 |
#### PLOT ACCURACY METRICS: First test #### |
|
717 |
##this will be cleaned up later: |
|
718 |
|
|
719 |
dir_ac_mosaics <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg4/mosaic/output_reg4_1999" |
|
720 |
lf_tmp <-list.files(path=dir_ac_mosaics,pattern="r_m_use_edge_weights_weighted_mean_mask_gam_CAI_.*.ac.*._reg4_1999.tif") |
|
721 |
|
|
722 |
#lf_tmp1 <- lf_tmp[21:24] |
|
723 |
#list_param_plot_raster_mosaic |
|
724 |
lf_tmp <-list.files(path=dir_ac_mosaics,pattern="r_m_use_edge_weights_weighted_mean_mask_gam_CAI_.*.ac.*._reg4_1999.tif",full.names=T) |
|
725 |
#Product assessment |
|
726 |
function_product_assessment_part1_functions <- "global_product_assessment_part1_functions_06142016b.R" |
|
727 |
source(file.path(script_path,function_product_assessment_part1_functions)) #source all functions used in this script |
|
728 |
|
|
729 |
r_mosaiced_ac <- stack(lf_tmp) |
|
730 |
l_dates <- unlist(lapply(1:length(lf_tmp),FUN=extract_date,x=basename(lf_tmp),item_no=14)) |
|
731 |
variable_name |
|
732 |
zlim_val <- NULL |
|
733 |
list_param_plot_raster_mosaic <- list(l_dates,r_mosaiced_ac,NA_flag_val_mosaic,out_dir,out_suffix, |
|
734 |
region_name,variable_name, zlim_val) |
|
735 |
names(list_param_plot_raster_mosaic) <- c("l_dates","r_mosaiced_scaled","NA_flag_val_mosaic","out_dir","out_suffix", |
|
736 |
"region_name","variable_name","zlim_val") |
|
737 |
debug(plot_raster_mosaic) |
|
738 |
plot_raster_mosaic(1,list_param_plot_raster_mosaic) |
|
739 |
lf_mosaic_plot_fig <- mclapply(1:length(lf_tmp), |
|
740 |
FUN=plot_raster_mosaic, |
|
741 |
list_param=list_param_plot_raster_mosaic, |
|
742 |
mc.preschedule=FALSE, |
|
743 |
mc.cores = num_cores) |
|
744 |
|
|
745 |
|
|
746 |
plot_raster_mosaic <- function(i,list_param){ |
|
747 |
#Function to plot mosaic for poster |
|
748 |
# |
|
749 |
l_dates <- list_param$l_dates |
|
750 |
r_mosaiced_scaled <- list_param$r_mosaiced_scaled |
|
751 |
NA_flag_val <- list_param$NA_flag_val |
|
752 |
out_dir <- list_param$out_dir |
|
753 |
out_suffix <- list_param$out_suffix |
|
754 |
region_name <- list_param$region_name |
|
755 |
variable_name <- list_param$variable_name |
|
756 |
zlim_val <- list_param$zlim_val |
|
716 | 757 |
|
717 | 758 |
############################ END OF SCRIPT ################################## |
Also available in: Unified diff
global assessment product part 1, plotting mosaic