Project

General

Profile

« Previous | Next » 

Revision bf44ca64

Added by Benoit Parmentier over 9 years ago

global scaling up part 2, generating figures for the additional tiles for region 5 Africa for year 2003 predictions

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: 04/27/2015            
8
#MODIFIED ON: 05/13/2015            
9 9
#Version: 4
10 10
#PROJECT: Environmental Layers project     
11 11
#COMMENTS: analyses for run 10 global analyses,all regions 1500x4500km with additional tiles to increase overlap 
......
381 381
interpolation_method <- c("gam_CAI") #PARAM2
382 382
#out_suffix<-"run10_global_analyses_01282015"
383 383
#out_suffix <- "output_run10_1000x3000_global_analyses_02102015"
384
out_suffix <- "run10_1500x4500_global_analyses_04172015" #PARAM3
385
out_dir <- "/data/project/layers/commons/NEX_data/output_run10_1500x4500_global_analyses_04172015" #PARAM4
384
out_suffix <- "run10_1500x4500_global_analyses_pred_2003_05122015" #PARAM3
385
out_dir <- "/data/project/layers/commons/NEX_data/output_run10_1500x4500_global_analyses_pred_2003_05122015" #PARAM4
386 386
create_out_dir_param <- FALSE #PARAM 5
387 387

  
388 388
mosaic_plot <- FALSE #PARAM6
389 389

  
390 390
#if daily mosaics NULL then mosaicas all days of the year
391 391

  
392
day_to_mosaic <- c("20100101","20100102","20100103","20100104","20100105",
393
                   "20100301","20100302","20100303","20100304","20100305",
394
                   "20100501","20100502","20100503","20100504","20100505",
395
                   "20100701","20100702","20100703","20100704","20100705",
396
                   "20100901","20100902","20100903","20100904","20100905",
397
                   "20101101","20101102","20101103","20101104","20101105") #PARAM7
392
day_to_mosaic <- c("20030101","20030102","20030103","20030104","20030105",
393
                   "20030301","20030302","20030303","20030304","20030305",
394
                   "20030501","20030502","20030503","20030504","20030505",
395
                   "20030701","20030702","20030703","20030704","20030705",
396
                   "20030901","20030902","20030903","20030904","20030905",
397
                   "20031101","20031102","20031103","20031104","20031105") #PARAM7
398 398

  
399 399
  
400 400
#CRS_locs_WGS84 <- CRS("+proj=longlat +ellps=WGS84 +datum=WGS84 +towgs84=0,0,0") #Station coords WGS84
......
413 413
plot_region <- TRUE
414 414
num_cores <- 10 #PARAM 14
415 415
reg_modified <- TRUE
416
region <- c("reg5") #reference region to merge if necessary #PARAM 16
416 417

  
417 418
########################## START SCRIPT ##############################
418 419

  
......
439 440

  
440 441
tb_month_s <- read.table(file=file.path(out_dir,paste("tb_month_diagnostic_s_NA","_",out_suffix,".txt",sep="")),sep=",")
441 442
pred_data_month_info <- read.table(file=file.path(out_dir,paste("pred_data_month_info_",out_suffix,".txt",sep="")),sep=",")
442
#pred_data_day_info <- read.table(file=file.path(out_dir,paste("pred_data_day_info_",out_suffix,".txt",sep="")),sep=",")
443
pred_data_day_info <- read.table(file=file.path(out_dir,paste("pred_data_day_info_",out_suffix,".txt",sep="")),sep=",")
443 444
df_tile_processed <- read.table(file=file.path(out_dir,paste("df_tile_processed_",out_suffix,".txt",sep="")),sep=",")
444 445

  
445 446
#add column for tile size later on!!!
......
473 474
if(reg_modified==T){
474 475
  
475 476
  summary_metrics_v_tmp <- summary_metrics_v
476
  summary_metrics_v_tmp$reg[summary_metrics_v_tmp$reg=="reg_1b"] <- "reg1"
477
  summary_metrics_v_tmp$reg[summary_metrics_v_tmp$reg=="reg_1c"] <- "reg1"
478
  summary_metrics_v_tmp$reg[summary_metrics_v_tmp$reg=="reg_3b"] <- "reg3"
477
  #summary_metrics_v_tmp$reg[summary_metrics_v_tmp$reg=="reg_1b"] <- "reg1"
478
  #summary_metrics_v_tmp$reg[summary_metrics_v_tmp$reg=="reg_1c"] <- "reg1"
479
  #summary_metrics_v_tmp$reg[summary_metrics_v_tmp$reg=="reg_3b"] <- "reg3"
480
  summary_metrics_v_tmp$reg[summary_metrics_v_tmp$reg=="reg5b"] <- "reg5"
481

  
479 482
  summary_metrics_v_tmp$reg_all <- summary_metrics_v$reg
480 483
  ###
481 484
  summary_metrics_v<- summary_metrics_v_tmp
482 485
  
483 486
  ###
484 487
  tb_tmp <- tb
485
  tb_tmp$reg[tb_tmp$reg=="reg_1b"] <- "reg1"
486
  tb_tmp$reg[tb_tmp$reg=="reg_1c"] <- "reg1"
487
  tb_tmp$reg[tb_tmp$reg=="reg_3b"] <- "reg3"
488
  #tb_tmp$reg[tb_tmp$reg=="reg_1b"] <- "reg1"
489
  #tb_tmp$reg[tb_tmp$reg=="reg_1c"] <- "reg1"
490
  #tb_tmp$reg[tb_tmp$reg=="reg_3b"] <- "reg3"
491
  tb_tmp$reg[tb_tmp$reg=="reg5b"] <- "reg5"
492

  
488 493
  ###
489 494
  tb <- tb_tmp
490 495
}
......
981 986
  
982 987
  #get the files
983 988
  l_reg_name <- unique(df_tile_processed$reg)
989
  l_reg_name <- c("reg5")
984 990
  #lf_mosaics_reg5 <- mixedsort(list.files(path="/data/project/layers/commons/NEX_data/output_run10_global_analyses_11302014/mosaics/reg5",
985 991
  #           pattern="CAI_TMAX_clim_month_.*_mod1_all.tif", full.names=T))
986 992
  lf_mosaics_reg <- vector("list",length=length(l_reg_name))
......
1061 1067

  
1062 1068
################## PLOTTING WORLD MOSAICS ################
1063 1069

  
1064
lf_world_pred <-list.files(path=file.path(out_dir,"mosaics"),    
1065
           pattern=paste("^world_mosaics.*.tif$",sep=""),full.names=T) 
1070
#lf_world_pred <-list.files(path=file.path(out_dir,"mosaics"),    
1071
#           pattern=paste("^world_mosaics.*.tif$",sep=""),full.names=T) 
1066 1072

  
1073
lf_world_pred <-list.files(path=file.path(out_dir,"mosaics"),    
1074
           pattern=paste("^reg5.*.",out_suffix,".tif$",sep=""),full.names=T) 
1067 1075

  
1068 1076
#mosaic_list_mean <- test_list 
1069 1077
#out_rastnames <- "world_test_mosaic_20100101"

Also available in: Unified diff