Project

General

Profile

« Previous | Next » 

Revision 75dffb8e

Added by Benoit Parmentier almost 9 years ago

modifying assessment script part2 figures creation

View differences:

climate/research/oregon/interpolation/global_run_scalingup_assessment_part2.R
5 5
#Analyses, figures, tables and data are also produced in the script.
6 6
#AUTHOR: Benoit Parmentier 
7 7
#CREATED ON: 03/23/2014  
8
#MODIFIED ON: 02/03/2016            
8
#MODIFIED ON: 02/01/2016            
9 9
#Version: 5
10 10
#PROJECT: Environmental Layers project     
11 11
#COMMENTS: analyses for run 10 global analyses,all regions 1500x4500km with additional tiles to increase overlap 
......
164 164
  year_predicted <- list_param_run_assessment_plotting$year_predicted
165 165
 
166 166
  NA_value <- NA_flag_val 
167
  metric_name <- "rmse" #to be added to the code later...
168
  
167

  
169 168
  ##################### START SCRIPT #################
170 169
  
171 170
  ####### PART 1: Read in data ########
......
179 178

  
180 179
  setwd(out_dir)
181 180
  
182
  list_outfiles <- vector("list", length=25) #collect names of output files
183
  list_outfiles_names <- vector("list", length=25) #collect names of output files
181
  list_outfiles <- vector("list", length=23) #collect names of output files
182
  list_outfiles_names <- vector("list", length=23) #collect names of output files
184 183
  counter_fig <- 0 #index of figure to collect outputs
185 184
  
186 185
  #i <- year_predicted
......
330 329
  #unique(summaty_metrics$tile_id)
331 330
  #text(lat-shp,)
332 331
  #union(list_shp_reg_files[[1]],list_shp_reg_files[[2]])
333
  #Row used in constructing output table...
334

  
335 332
  list_outfiles[[counter_fig+1]] <- paste("Figure1_tile_processed_region_",region_name,"_",out_suffix,".png",sep="")
336 333
  counter_fig <- counter_fig+1
337
  #this will be changed to be added to data.frame on the fly
338
  r1 <-c("figure_1","Tiles processed for the region",NA,NA,region_name,year_predicted,list_outfiles[[1]]) 
339 334
  
340 335
  ###############
341 336
  ### Figure 2: boxplot of average accuracy by model and by tiles
......
360 355
    list_outfiles[[counter_fig+i]] <- fig_filename
361 356
  }
362 357
  counter_fig <- counter_fig + length(model_name)
363
  
364
  r2 <-c("figure_2a","Boxplot of accuracy with outliers by tiles","mod1",metric_name,region_name,year_predicted,list_outfiles[[2]]) 
365
  r3 <-c("figure_2a","boxplot of accuracy with outliers by tiles","mod_kr",metric_name,region_name,year_predicted,list_outfiles[[3]])
366
  
367 358
  ## Figure 2b
368 359
  #with ylim and removing trailing...
369 360
  for(i in  1:length(model_name)){ #there are two models!!
......
385 376
  }
386 377
  counter_fig <- counter_fig + length(model_name)
387 378
  #bwplot(rmse~tile_id, data=subset(tb,tb$pred_mod=="mod1"))
388
  r4 <-c("figure_2b","Boxplot of accuracy with scaling by tiles","mod1",metric_name,region_name,year_predicted,list_outfiles[[4]])  
389
  r5 <-c("figure_2b","Boxplot of accuracy with scaling by tiles","mod_kr",metric_name,region_name,year_predicted,list_outfiles[[5]])  
390

  
379
 
391 380
  ###############
392 381
  ### Figure 3: boxplot of average RMSE by model acrosss all tiles
393 382
  
......
418 407
    list_outfiles[[counter_fig+2]] <- paste("Figure3b_boxplot_overall_region_scaling_",model_name[i],"_",out_suffix,".png",sep="")
419 408
  }
420 409
  counter_fig <- counter_fig + length(model_name)
421
  r6 <-c("figure_3a","Boxplot overall accuracy with outliers","mod1",metric_name,region_name,year_predicted,list_outfiles[[6]])  
422
  r7 <-c("figure_3b","Boxplot overall accuracy with scaling","mod1",metric_name,region_name,year_predicted,list_outfiles[[7]])  
423
  r8 <-c("figure_3a","Boxplot overall accuracy with outliers","mod_kr",metric_name,region_name,year_predicted,list_outfiles[[8]])
424
  r9 <-c("figure_3b","Boxplot overall accuracy with scaling","mod_kr",metric_name,region_name,year_predicted,list_outfiles[[9]])  
425 410

  
426 411
  ################ 
427 412
  ### Figure 4: plot predicted tiff for specific date per model
......
491 476
  }
492 477
  
493 478
  counter_fig <- counter_fig + length(model_name)
494
  
495
  r10 <-c("figure_5","Barplot of accuracy metrics ranked by tiles","mod1",metric_name,region_name,year_predicted,list_outfiles[[8]])
496
  r11 <-c("figure_5","Barplot of accuracy metrics ranked by tiles","mod_kr",metric_name,region_name,year_predicted,list_outfiles[[9]])  
497 479

  
498 480
  ######################
499 481
  ### Figure 6: plot map of average RMSE per tile at centroids
......
501 483
  ### Without 
502 484
  
503 485
  #list_df_ac_mod <- vector("list",length=length(lf_pred_list))
504
  list_df_ac_mod <- vector("list",length=length(model_name))
486
  list_df_ac_mod <- vector("list",length=2)
505 487
  
506 488
  for (i in 1:length(model_name)){
507 489
    
......
536 518
  }
537 519
  counter_fig <- counter_fig+length(model_name)
538 520

  
539
  r12 <-c("figure_6","Average accuracy metrics map at centroids","mod1",metric_name,region_name,year_predicted,list_outfiles[[8]])
540
  r13 <-c("figure_6","Average accuracy metrics map at centroids","mod_kr",metric_name,region_name,year_predicted,list_outfiles[[9]])  
541

  
521
  
542 522
  ######################
543 523
  ### Figure 7: Number of predictions: daily and monthly
544 524
  
......
567 547
   #Error in grid.Call.graphics(L_setviewport, pvp, TRUE) : 
568 548
  #non-finite location and/or size for viewport
569 549

  
570
  j<-1 #for model name 1,mod1
550
  j<-1 #for model name 1
571 551
  for(i in 1:length(threshold_missing_day)){
572 552
    
573 553
    #summary_metrics_v$n_missing <- summary_metrics_v$n == 365
......
584 564
      res_pix <- 960
585 565
      col_mfrow <- 1
586 566
      row_mfrow <- 1
587
      #only mod1 right now
588 567
      png(filename=paste("Figure7a_ac_metrics_map_centroids_tile_",model_name[j],"_","missing_day_",threshold_missing_day[i],
589 568
                       "_",out_suffix,".png",sep=""),
590 569
        width=col_mfrow*res_pix,height=row_mfrow*res_pix)
......
605 584
  }
606 585
  counter_fig <- counter_fig+length(threshold_missing_day) #currently 4 days...
607 586

  
608
  r14 <-c("figure_7","Number of missing days threshold1 map at centroids","mod1",metric_name,region_name,year_predicted,list_outfiles[[8]])
609
  r15 <-c("figure_7","Number of missing days threshold2 map at centroids","mod1",metric_name,region_name,year_predicted,list_outfiles[[9]])  
610
  r16 <-c("figure_7","Number of missing days threshold3 map at centroids","mod1",metric_name,region_name,year_predicted,list_outfiles[[8]])
611
  r17 <-c("figure_7","Number of missing days threshold4 map at centroids","mod1",metric_name,region_name,year_predicted,list_outfiles[[9]])  
612

  
613 587
  ### Potential
614 588
  png(filename=paste("Figure7b_number_daily_predictions_per_models","_",out_suffix,".png",sep=""),
615 589
      width=col_mfrow*res_pix,height=row_mfrow*res_pix)
......
620 594
  
621 595
  list_outfiles[[counter_fig+1]] <- paste("Figure7b_number_daily_predictions_per_models","_",out_suffix,".png",sep="")
622 596
  counter_fig <- counter_fig + 1
623
  r18 <-c("figure_7b","Number of daily predictions per_models","mod1",metric_name,region_name,year_predicted,list_outfiles[[9]])  
624 597
  
625 598
  table(tb$pred_mod)
626 599
  table(tb$index_d)
......
648 621
  
649 622
  list_outfiles[[counter_fig+1]] <- paste("Figure7c_histogram_number_daily_predictions_per_models","_",out_suffix,".png",sep="")
650 623
  counter_fig <- counter_fig + 1
651
  r19 <-c("figure_7c","Histogram number daily predictions per models","mod1",metric_name,region_name,year_predicted,list_outfiles[[9]])  
652 624

  
653
  
654 625
  #table(tb)
655 626
  ## Figure 7b
656 627
  #png(filename=paste("Figure7b_number_daily_predictions_per_models","_",out_suffix,".png",sep=""),
......
669 640
  ##### Figure 8: Breaking down accuracy by regions!! #####
670 641
  
671 642
  #summary_metrics_v <- merge(summary_metrics_v,df_tile_processed,by="tile_id")
672
  
673
  ##################
674 643
  ##First plot with all models together
675 644
  
676 645
  ## Figure 8a
......
686 655
  print(p)
687 656
  dev.off()
688 657
  
689
  list_outfiles[[counter_fig+1]] <- paste("Figure8a_boxplot_overall_accuracy_by_model_separated_by_region_with_oultiers_",out_suffix,".png",sep="")
658
  list_outfiles[[counter_fig+1]] <- paste("Figure8a_boxplot_overall_separated_by_region_with_oultiers_",out_suffix,".png",sep="")
690 659
  counter_fig <- counter_fig + 1
691 660
  
692 661
  ## Figure 8b
......
700 669
  print(p)
701 670
  dev.off()
702 671
  
703
  list_outfiles[[counter_fig+1]] <- paste("Figure8b_boxplot_overall_accuracy_by_model_separated_by_region_scaling_",out_suffix,".png",sep="")
672
  list_outfiles[[counter_fig+1]] <- paste("Figure8b_boxplot_overall_separated_by_region_scaling_",model_name[i],"_",out_suffix,".png",sep="")
704 673
  counter_fig <- counter_fig + 1
705 674
  
706
  
707
  r20 <-c("figure 8a","Boxplot overall accuracy by model separated by region with outliers",NA,metric_name,region_name,year_predicted,list_outfiles[[20]])  
708
  r21 <-c("figure 8b","Boxplot overall accuracy by model separated by region with scaling",NA,metric_name,region_name,year_predicted,list_outfiles[[21]])  
709

  
710
  #######
711 675
  ##Second, plot for each model separately
712 676
  
713 677
  for(i in 1:length(model_name)){
......
719 683
    col_mfrow <- 1
720 684
    row_mfrow <- 1
721 685
  
722
    fig_filename <- paste("Figure8c_boxplot_overall_accuracy_separated_by_region_with_outliers_",model_name[i],"_",out_suffix,".png",sep="")
686
    fig_filename <- paste("Figure8c_boxplot_overall_separated_by_region_with_oultiers_",model_name[i],"_",out_suffix,".png",sep="")
723 687
    png(filename=fig_filename,
724 688
      width=col_mfrow*res_pix,height=row_mfrow*res_pix)
725 689
  
......
732 696
    counter_fig <- counter_fig + 1
733 697
  
734 698
    ## Figure 8d
735
    fig_filename <- paste("Figure8d_boxplot_overall_accuracy_separated_by_region_scaling_",model_name[i],"_",out_suffix,".png",sep="")
699
    fig_filename <- paste("Figure8d_boxplot_overall_separated_by_region_scaling_",model_name[i],"_",out_suffix,".png",sep="")
736 700
    png(filename=fig_filename,
737 701
      width=col_mfrow*res_pix,height=row_mfrow*res_pix)
738 702
  
......
747 711
    counter_fig <- counter_fig + 1
748 712

  
749 713
  }
750
  
751
  r22 <-c("figure 8c","Boxplot overall accuracy separated by region with outliers","mod1",metric_name,region_name,year_predicted,list_outfiles[[20]])  
752
  r23 <-c("figure 8d","Boxplot overall accuracy separated by region with scaling","mod1",metric_name,region_name,year_predicted,list_outfiles[[21]])  
753
  r24 <-c("figure 8c","Boxplot overall accuracy separated by region with outliers","mod_kr",metric_name,region_name,year_predicted,list_outfiles[[20]])  
754
  r25 <-c("figure 8d","Boxplot overall accuracy separated by region with scaling","mod_kr",metric_name,region_name,year_predicted,list_outfiles[[21]])  
755

  
714
 
756 715
  #####################################################
757 716
  #### Figure 9: plotting boxplot by year and regions ###########
758 717
  
......
788 747
  ############## Collect information from assessment ##########
789 748
  
790 749
  # This is hard coded and can be improved later on for flexibility. It works for now...                                                                 
791
  #This data.frame contains all the files from the assessment
750
  comments_str <- 
751
c("tile processed for the region",
752
  "boxplot with outliers",                                                          
753
  "boxplot with outliers",
754
  "boxplot scaling by tiles",
755
  "boxplot scaling by tiles",
756
  "boxplot overall region with outliers",
757
  "boxplot overall region with scaling",
758
  "boxplot overall region with outliers",
759
  "boxplot overall region with scaling",
760
  "Barplot of accuracy metrics ranked by tile",
761
  "Barplot of accuracy metrics ranked by tile",
762
  "Average accuracy metrics map at centroids",
763
  "Average accuracy metrics map at centroids",
764
  "Number of missing day threshold1 map centroids",
765
  "Number of missing day threshold2 map centroids",
766
  "Number of missing day threshold3 map centroids",
767
  "Number of missing day threshold4 map centroids",
768
  "number_daily_predictions_per_model",
769
  "histogram number_daily_predictions_per_models",
770
  "boxplot overall separated by region with_outliers",
771
  "boxplot overall separated by region with_scaling",
772
  "boxplot overall separated by region with_outliers",
773
  "boxplot overall separated by region with_scaling")
792 774

  
775
                                            model_name=col_model_name,
776
                                            reg=col_reg,
777
                                            year_predicted=col_year_predicted,
778
                                            filename=unlist(list_outfiles))
779
    comments_str <- 
793 780
  #Should have this at the location of the figures!!! will be done later?    
794
  #r1 <-c("figure_1","Tiles processed for the region",NA,NA,region_name,year_predicted,list_outfiles[[1]])
795
  #r2 <-c("figure_2a","Boxplot of accuracy with outliers by tiles","mod1",metric_name,region_name,year_predicted,list_outfiles[[2]]) 
796
  #r3 <-c("figure_2a","boxplot of accuracy with outliers by tiles","mod_kr",metric_name,region_name,year_predicted,list_outfiles[[3]])
797
  #r4 <-c("figure_2b","Boxplot of accuracy with scaling by tiles","mod1",metric_name,region_name,year_predicted,list_outfiles[[4]])  
798
  #r5 <-c("figure_2b","Boxplot of accuracy with scaling by tiles","mod_kr",metric_name,region_name,year_predicted,list_outfiles[[5]])  
799
  #r6 <-c("figure_3a","Boxplot overall accuracy with outliers","mod1",metric_name,region_name,year_predicted,list_outfiles[[6]])  
800
  #r7 <-c("figure_3b","Boxplot overall accuracy with scaling","mod1",metric_name,region_name,year_predicted,list_outfiles[[7]])  
801
  #r8 <-c("figure_3a","Boxplot overall accuracy with outliers","mod_kr",metric_name,region_name,year_predicted,list_outfiles[[8]])
802
  #r9 <-c("figure_3b","Boxplot overall accuracy with scaling","mod_kr",metric_name,region_name,year_predicted,list_outfiles[[9]])  
803
  #r10 <-c("figure_5","Barplot of accuracy metrics ranked by tiles","mod1",metric_name,region_name,year_predicted,list_outfiles[[10]])
804
  #r11 <-c("figure_5","Barplot of accuracy metrics ranked by tiles","mod_kr",metric_name,region_name,year_predicted,list_outfiles[[11]])  
805
  #r12 <-c("figure_6","Average accuracy metrics map at centroids","mod1",metric_name,region_name,year_predicted,list_outfiles[[12]])
806
  #r13 <-c("figure_6","Average accuracy metrics map at centroids","mod_kr",metric_name,region_name,year_predicted,list_outfiles[[13]])  
807
  #r14 <-c("figure_7","Number of missing days threshold1 map at centroids","mod1",metric_name,region_name,year_predicted,list_outfiles[[14]])
808
  #r15 <-c("figure_7","Number of missing days threshold2 map at centroids","mod1",metric_name,region_name,year_predicted,list_outfiles[[15]])  
809
  #r16 <-c("figure_7","Number of missing days threshold3 map at centroids","mod1",metric_name,region_name,year_predicted,list_outfiles[[16]])
810
  #r17 <-c("figure_7","Number of missing days threshold4 map at centroids","mod1",metric_name,region_name,year_predicted,list_outfiles[[17]])  
811
  #r18 <-c("figure_7b","Number of daily predictions per_models","mod1",metric_name,region_name,year_predicted,list_outfiles[[18]])  
812
  #r19 <-c("figure_7c","Histogram number daily predictions per models","mod1",metric_name,region_name,year_predicted,list_outfiles[[19]])  
813
  #r20 <-c("figure 8a","Boxplot overall accuracy by model separated by region with outliers",NA,metric_name,region_name,year_predicted,list_outfiles[[20]])  
814
  #r21 <-c("figure 8b","Boxplot overall accuracy by model separated by region with scaling",NA,metric_name,region_name,year_predicted,list_outfiles[[21]])  
815
  #r22 <-c("figure 8c","Boxplot overall accuracy separated by region with outliers","mod1",metric_name,region_name,year_predicted,list_outfiles[[22]])  
816
  #r23 <-c("figure 8d","Boxplot overall accuracy separated by region with scaling","mod1",metric_name,region_name,year_predicted,list_outfiles[[23]])  
817
  #r24 <-c("figure 8c","Boxplot overall accuracy separated by region with outliers","mod_kr",metric_name,region_name,year_predicted,list_outfiles[[24]])  
818
  #r25 <-c("figure 8d","Boxplot overall accuracy separated by region with scaling","mod_kr",metric_name,region_name,year_predicted,list_outfiles[[25]])  
819

  
820
  #Assemble all the figures description and information in a data.frame for later use
821
  list_rows <-list(r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14,r15,r16,r17,r18,r19,r20,r21,r22,r23,r24,r25)
822
  df_assessment_figures_files <- as.data.frame(do.call(rbind,list_rows))
823
  names(df_assessment_figures_files) <- c("figure_no","comment","model_name","reg","metric_name","year_predicted","filename")
781
  r1 <-c("figure_1","tile processed for the region",NA,region_name,year_predicted,list_outfiles[[1]])
782
  r2 <-c("figure_2a","boxplot with outliers","mod1",region_name,year_predicted,list_outfiles[[2]])  
783
  r3 <-c("figure_2a","boxplot scaling by tiles","mod_kr",region_name,year_predicted,list_outfiles[[3]])  
784
  r4 <-c("figure_2b","boxplot scaling by tiles","mod1",region_name,year_predicted,list_outfiles[[4]])  
785
  r5 <-c("figure_2b","boxplot scaling by tiles","mod_kr",region_name,year_predicted,list_outfiles[[5]])  
786
  r6 <-c("figure_3a","boxplot scaling by tiles","mod1",region_name,year_predicted,list_outfiles[[6]])  
787
  r7 <-c("figure_3b","boxplot scaling by tiles","mod1",region_name,year_predicted,list_outfiles[[7]])  
788
  r8 <-c("figure_3a","boxplot scaling by tiles","mod_kr",region_name,year_predicted,list_outfiles[[8]])
789
  r9 <-c("figure_3b","boxplot scaling by tiles","mod_kr",region_name,year_predicted,list_outfiles[[9]])  
790

  
791
  NA,"mod1","mod_kr","mod1","mod_kr","mod1","mod_1","mod_kr","mod_kr",
792

  
793
  
794
  c("tile processed for the region",
795
  "boxplot with outliers",                                                          
796
  "boxplot with outliers",
797
  "boxplot scaling by tiles",
798
  "boxplot scaling by tiles",
799
  "boxplot overall region with outliers",
800
  "boxplot overall region with scaling",
801
  "boxplot overall region with outliers",
802
  "boxplot overall region with scaling",
803
  "Barplot of accuracy metrics ranked by tile",
804
  "Barplot of accuracy metrics ranked by tile",
805
  "Average accuracy metrics map at centroids",
806
  "Average accuracy metrics map at centroids",
807
  "Number of missing day threshold1 map centroids",
808
  "Number of missing day threshold2 map centroids",
809
  "Number of missing day threshold3 map centroids",
810
  "Number of missing day threshold4 map centroids",
811
  "number_daily_predictions_per_model",
812
  "histogram number_daily_predictions_per_models",
813
  "boxplot overall separated by region with_outliers",
814
  "boxplot overall separated by region with_scaling",
815
  "boxplot overall separated by region with_outliers",
816
  "boxplot overall separated by region with_scaling")
817

  
818

  
819
  figure_no <- c("figure_1","figure_2a","figure_2a","figure_2b","figure_2b","figure_3a","figure_3b","figure_3a","figure_3b",
820
                 "figure_5", "figure_5","figure_6","figure_6","Figure_7a","Figure_7a","Figure_7a","Figure_7a","Figure_7b",
821
                 "Figure_7c","Figure 8a","Figure 8b","Figure 8c","Figure 8d","Figure 8c","Figure 8d")
822

  
823
  col_model_name <- c(NA,"mod1","mod_kr","mod1","mod_kr","mod1","mod_1","mod_kr","mod_kr",
824
                      "mod1","mod_kr","mod1","mod_kr","mod1","mod1","mod1","mod1",NA,
825
                      NA,NA,NA,"mod1","mod1","mod_kr","mod_kr")
826
  
827
-rw-r--r-- 1 parmentier layers  14441 Feb  2 16:06 Figure2a_boxplot_with_oultiers_by_tiles_mod1_global_analyses_overall_assessment_reg4_01272016.png
828
-rw-r--r-- 1 parmentier layers  13617 Feb  2 16:06 Figure2a_boxplot_with_oultiers_by_tiles_mod_kr_global_analyses_overall_assessment_reg4_01272016.png
829
-rw-r--r-- 1 parmentier layers   9638 Feb  2 16:07 Figure2b_boxplot_scaling_by_tiles_mod1_global_analyses_overall_assessment_reg4_01272016.png
830
-rw-r--r-- 1 parmentier layers   9606 Feb  2 16:07 Figure2b_boxplot_scaling_by_tiles_mod_kr_global_analyses_overall_assessment_reg4_01272016.png
831
-rw-r--r-- 1 parmentier layers   4925 Feb  2 16:07 Figure3a_boxplot_overall_region_with_oultiers_mod1_global_analyses_overall_assessment_reg4_01272016.png
832
-rw-r--r-- 1 parmentier layers   4527 Feb  2 16:07 Figure3b_boxplot_overall_region_scaling_mod1_global_analyses_overall_assessment_reg4_01272016.png
833
-rw-r--r-- 1 parmentier layers   5193 Feb  2 16:07 Figure3a_boxplot_overall_region_with_oultiers_mod_kr_global_analyses_overall_assessment_reg4_01272016.png
834
-rw-r--r-- 1 parmentier layers   4522 Feb  2 16:07 Figure3b_boxplot_overall_region_scaling_mod_kr_global_analyses_overall_assessment_reg4_01272016.png
835
-rw-r--r-- 1 parmentier layers   6079 Feb  2 16:07 Figure5_ac_metrics_ranked_mod1_global_analyses_overall_assessment_reg4_01272016.png
836
-rw-r--r-- 1 parmentier layers   6251 Feb  2 16:07 Figure5_ac_metrics_ranked_mod_kr_global_analyses_overall_assessment_reg4_01272016.png
837
-rw-r--r-- 1 parmentier layers 120492 Feb  2 16:08 Figure6_ac_metrics_map_centroids_tile_mod1_global_analyses_overall_assessment_reg4_01272016.png
838
-rw-r--r-- 1 parmentier layers 120345 Feb  2 16:08 Figure6_ac_metrics_map_centroids_tile_mod_kr_global_analyses_overall_assessment_reg4_01272016.png
839
-rw-r--r-- 1 parmentier layers  88938 Feb  2 16:09 Figure7a_ac_metrics_map_centroids_tile_mod1_missing_day_367_global_analyses_overall_assessment_reg4_01272016.png
840
-rw-r--r-- 1 parmentier layers  89437 Feb  2 16:09 Figure7a_ac_metrics_map_centroids_tile_mod1_missing_day_365_global_analyses_overall_assessment_reg4_01272016.png
841
-rw-r--r-- 1 parmentier layers  89284 Feb  2 16:10 Figure7a_ac_metrics_map_centroids_tile_mod1_missing_day_300_global_analyses_overall_assessment_reg4_01272016.png
842
-rw-r--r-- 1 parmentier layers  32506 Feb  2 16:10 Figure7b_number_daily_predictions_per_models_global_analyses_overall_assessment_reg4_01272016.png
843
-rw-r--r-- 1 parmentier layers  13970 Feb  2 16:10 Figure7c_histogram_number_daily_predictions_per_models_global_analyses_overall_assessment_reg4_01272016.png
844
-rw-r--r-- 1 parmentier layers  12726 Feb  2 16:11 Figure8a_boxplot_overall_separated_by_region_with_oultiers__global_analyses_overall_assessment_reg4_01272016.png
845
-rw-r--r-- 1 parmentier layers  12061 Feb  2 16:11 Figure8b_boxplot_overall_separated_by_region_scaling__global_analyses_overall_assessment_reg4_01272016.png
846
-rw-r--r-- 1 parmentier layers  10851 Feb  2 16:11 Figure8c_boxplot_overall_separated_by_region_with_oultiers_mod1_global_analyses_overall_assessment_reg4_01272016.png
847
-rw-r--r-- 1 parmentier layers   9814 Feb  2 16:11 Figure8d_boxplot_overall_separated_by_region_scaling_mod1_global_analyses_overall_assessment_reg4_01272016.png
848
-rw-r--r-- 1 parmentier layers  11599 Feb  2 16:11 Figure8c_boxplot_overall_separated_by_region_with_oultiers_mod_kr_global_analyses_overall_assessment_reg4_01272016.png
849
-rw-r--r-- 1 parmentier layers   9597 Feb  2 16:11 Figure8d_boxplot_overall_separated_by_region_scaling_mod_kr_global_analyses_overall_assessment_reg4_01272016.png
850

  
851
  
852
  col_reg <- rep(region_name,length(list_outfiles))
853
  col_year_predicted <- rep(year_predicted,length(list_outfiles))
854
  
855
  #This data.frame contains all the files from the assessment
856
  df_assessment_figures_files <- data.frame(figure_no=figure_no,
857
                                            comment = comments_str,
858
                                            model_name=col_model_name,
859
                                            reg=col_reg,
860
                                            year_predicted=col_year_predicted,
861
                                            filename=unlist(list_outfiles))
824 862
  
825 863
  ###Prepare files for copying back?
826 864
  df_assessment_figures_files_names <- file.path(out_dir,paste("df_assessment_figures_files_",region_name,"_",year_predicted,"_",out_suffix,".txt",sep=""))
......
965 1003

  
966 1004

  
967 1005

  
1006

  
1007

  
1008

  
1009

  
1010

  
1011

  
1012

  
1013

  
1014

  
1015

  
1016

  
1017

  
1018

  
1019

  
1020

  
1021

  
1022

  
1023

  
1024

  
1025

  
1026

  
1027

  
1028

  
1029

  
1030

  
1031

  
1032

  
1033

  
1034

  
1035
#### CURRENT ERROR ON NEX
1036

  
1037
# #comments                                                                     #figure_no    #region   #models       
1038
# tile processed for the region                                           figure_1           reg4        NA
1039
# boxplot with outlier                                                        figure_2a          reg4        mod1
1040
# boxplot with outlier                                                        figure_2a          reg4        mod_kr
1041
# boxplot scaling by tiles                                                   figure_2b          reg4        mod1
1042
# boxplot scaling by tiles                                                   figure_2b          reg4        mod_kr
1043
# boxplot overall region with outliers                              figure_3a          reg4        NA
1044
# boxplot overall region with scaling                               figure_3b          reg4        NA
1045
# Barplot of metrics ranked by tile                                  Figure_5            
1046
# boxplot overall region with scaling                               figure_3b          reg4        NA
1047
# Barplot of metrics ranked by tile                                  Figure_5            
1048
# Barplot of metrics ranked by tile                                  Figure_5
1049
# Average metrics map centroids                                  Figure_6
1050
# Average metrics map centroids                                  Figure_6
1051
# Number of missing day threshold1 map centroids                                    Figure_7a
1052
# Number of missing day threshold1 map centroids                                    Figure_7a
1053
# Number of missing day threshold1 map centroids                                    Figure_7a
1054
# Number of missing day threshold1 map centroids                                    Figure_7a
1055
# number_daily_predictions_per_model                                                        Figure_7b
1056
# histogram number_daily_predictions_per_models                                    Figure_7c
1057
# boxplot_overall_separated_by_region_with_oultiers_                              Figure 8a
1058
# boxplot_overall_separated_by_region_with_scaling                                 Figure 8b
1059

  
1060
# Browse[3]> c
1061
# Error in text.default(coordinates(pt)[1], coordinates(pt)[2], labels = i,  : 
1062
#                         X11 font -adobe-helvetica-%s-%s-*-*-%d-*-*-*-*-*-*-*, face 2 at size 16 could not be loaded
1063
#                       In addition: Warning message:
1064
#                         In polypath(x = mcrds[, 1], y = mcrds[, 2], border = border, col = col,  :
1065
#                                       Path drawing not available for this device
1066

  
1067

  
1068

  
1069
# Browse[2]>   for(i in 1:length(threshold_missing_day)){
1070
# +     
1071
# +     #summary_metrics_v$n_missing <- summary_metrics_v$n == 365
1072
# +     #summary_metrics_v$n_missing <- summary_metrics_v$n < 365
1073
# +     summary_metrics_v$n_missing <- summary_metrics_v$n < threshold_missing_day[i]
1074
# +     summary_metrics_v_subset <- subset(summary_metrics_v,model_name=="mod1")
1075
# +     
1076
# +     #res_pix <- 1200
1077
# +     res_pix <- 960
1078
# +     
1079
# +     col_mfrow <- 1
1080
# +     row_mfrow <- 1
1081
# +     fig_filename <- paste("Figure7a_ac_metrics_map_centroids_tile_",model_name[j],"_","missing_day_",threshold_missing_day[i],
1082
# +                        "_",out_suffix,".png",sep="")
1083
# +     png(filename=paste("Figure7a_ac_metrics_map_centroids_tile_",model_name[j],"_","missing_day_",threshold_missing_day[i],
1084
# +                        "_",out_suffix,".png",sep=""),
1085
# +         width=col_mfrow*res_pix,height=row_mfrow*res_pix)
1086
# +     
1087
# +     model_name[j]
1088
# +     
1089
# +     p_shp <- layer(sp.polygons(reg_layer, lwd=1, col='black'))
1090
# +     #title("(a) Mean for 1 January")
1091
# +     p <- bubble(summary_metrics_v_subset,"n_missing",main=paste("Missing per tile and by ",model_name[j]," for ",
1092
# +                                                                 threshold_missing_day[i]))
1093
# +     p1 <- p+p_shp
1094
# +     try(print(p1)) #error raised if number of missing values below a threshold does not exist
1095
# +     dev.off()
1096
# +     
1097
# +     list_outfiles[[counter_fig+i]] <- fig_filename
1098
# +   }
1099
# debug at /nobackupp8/bparmen1/env_layers_scripts/global_run_scalingup_assessment_part2_01042016.R#272: i
1100
# Browse[3]>   counter_fig <- counter_fig+length(threshold_missing_day) #currently 4 days...
1101
# Browse[3]> c
1102
# Error in grid.Call.graphics(L_setviewport, pvp, TRUE) : 
1103
#   non-finite location and/or size for viewport

Also available in: Unified diff