Revision 38bcd5cb
Added by Benoit Parmentier over 8 years ago
climate/research/oregon/interpolation/global_product_assessment_part1.R | ||
---|---|---|
723 | 723 |
#list_param_plot_raster_mosaic |
724 | 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 | 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 |
|
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 | 728 |
|
729 | 729 |
r_mosaiced_ac <- stack(lf_tmp) |
730 | 730 |
l_dates <- unlist(lapply(1:length(lf_tmp),FUN=extract_date,x=basename(lf_tmp),item_no=14)) |
... | ... | |
734 | 734 |
region_name,variable_name, zlim_val) |
735 | 735 |
names(list_param_plot_raster_mosaic) <- c("l_dates","r_mosaiced_scaled","NA_flag_val_mosaic","out_dir","out_suffix", |
736 | 736 |
"region_name","variable_name","zlim_val") |
737 |
debug(plot_raster_mosaic) |
|
737 |
#debug(plot_raster_mosaic)
|
|
738 | 738 |
plot_raster_mosaic(1,list_param_plot_raster_mosaic) |
739 | 739 |
lf_mosaic_plot_fig <- mclapply(1:length(lf_tmp), |
740 | 740 |
FUN=plot_raster_mosaic, |
... | ... | |
742 | 742 |
mc.preschedule=FALSE, |
743 | 743 |
mc.cores = num_cores) |
744 | 744 |
|
745 |
#### Now plot kriged residuals from mosaiced surfaces |
|
746 |
|
|
747 |
lf_tmp_res <-list.files(path=dir_ac_mosaics,pattern="r_m_use_edge_weights_weighted_mean_mask_gam_CAI_.*.residuals.*._reg4_1999.tif",full.names=T) |
|
748 |
|
|
749 |
l_dates <- unlist(lapply(1:length(lf_tmp_res),FUN=extract_date,x=basename(lf_tmp),item_no=14)) |
|
750 |
variable_name |
|
751 |
zlim_val <- NULL |
|
752 |
r_mosaiced_res <- stack(lf_tmp_res) |
|
753 |
list_param_plot_raster_mosaic <- list(l_dates,r_mosaiced_res,NA_flag_val_mosaic,out_dir,out_suffix, |
|
754 |
region_name,variable_name, zlim_val) |
|
755 |
names(list_param_plot_raster_mosaic) <- c("l_dates","r_mosaiced_scaled","NA_flag_val_mosaic","out_dir","out_suffix", |
|
756 |
"region_name","variable_name","zlim_val") |
|
757 |
#debug(plot_raster_mosaic) |
|
758 |
plot_raster_mosaic(1,list_param_plot_raster_mosaic) |
|
759 |
lf_mosaic_plot_fig_res <- mclapply(1:length(lf_tmp_res), |
|
760 |
FUN=plot_raster_mosaic, |
|
761 |
list_param=list_param_plot_raster_mosaic, |
|
762 |
mc.preschedule=FALSE, |
|
763 |
mc.cores = num_cores) |
|
764 |
|
|
765 |
### New plot of residuals surface with zlim |
|
766 |
zlim_val <- c(-60,60) |
|
767 |
#r_mosaiced_res <- stack(lf_tmp_res) |
|
768 |
list_param_plot_raster_mosaic <- list(l_dates,r_mosaiced_res,NA_flag_val_mosaic,out_dir,out_suffix, |
|
769 |
region_name,variable_name, zlim_val) |
|
770 |
names(list_param_plot_raster_mosaic) <- c("l_dates","r_mosaiced_scaled","NA_flag_val_mosaic","out_dir","out_suffix", |
|
771 |
"region_name","variable_name","zlim_val") |
|
772 |
#debug(plot_raster_mosaic) |
|
773 |
#plot_raster_mosaic(1,list_param_plot_raster_mosaic) |
|
774 |
lf_mosaic_plot_fig_res <- mclapply(1:length(lf_tmp_res), |
|
775 |
FUN=plot_raster_mosaic, |
|
776 |
list_param=list_param_plot_raster_mosaic, |
|
777 |
mc.preschedule=FALSE, |
|
778 |
mc.cores = num_cores) |
|
745 | 779 |
|
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 |
|
757 | 780 |
|
758 | 781 |
############################ END OF SCRIPT ################################## |
Also available in: Unified diff
global assessment product part 1, plotting mosaic with zlim option to see contrast in rmse layers