Project

General

Profile

« Previous | Next » 

Revision 5c03e335

Added by Benoit Parmentier almost 10 years ago

NEX global assessment run 10 1000x3000km tiles part1

View differences:

climate/research/oregon/interpolation/global_run_scalingup_assessment_part1.R
5 5
#Part 1 create summary tables and inputs for figure in part 2 and part 3.
6 6
#AUTHOR: Benoit Parmentier 
7 7
#CREATED ON: 03/23/2014  
8
#MODIFIED ON: 12/23/2014            
9
#Version: 3
8
#MODIFIED ON: 01/28/2015            
9
#Version: 4
10 10
#PROJECT: Environmental Layers project  
11 11
#TO DO:
12 12
# - generate delta and clim mosaic
13
# - generate monthly inputs data_month
14
# - generate table of number of observations per tile for use in map part 2
15
# - generate data_s and data_v inputs as giant table
16
# - generate accuracy for mosaic (part 2 and part3)
17 13
# - clean up
18 14

  
19 15
#First source file:
......
468 464

  
469 465
#reg1 (North Am), reg2(Europe),reg3(Asia), reg4 (South Am), reg5 (Africa), reg6 (Australia-Asia)
470 466
#master directory containing the definition of tile size and tiles predicted
471
in_dir1 <- "/nobackupp4/aguzman4/climateLayers/output1000x3000_km/"
467
in_dir1 <- "/nobackupp6/aguzman4/climateLayers/output1500x4500_km/"
472 468

  
473
region_names <- c("reg2","reg6") #selected region names
469
region_names <- c("reg1") #selected region names
474 470

  
475 471
in_dir_list <- list.dirs(path=in_dir1,recursive=FALSE) #get the list regions processed for this run
476 472
#basename(in_dir_list)
......
499 495

  
500 496
y_var_name <- "dailyTmax"
501 497
interpolation_method <- c("gam_CAI")
502
out_prefix<-"run10_global_analyses_12232014"
498
out_prefix<-"run10_global_analyses_01282015"
503 499

  
504 500
#out_dir<-"/data/project/layers/commons/NEX_data/" #On NCEAS Atlas
505 501
out_dir <- "/nobackup/bparmen1/" #on NEX
502
#out_dir <- "/nobackupp8/bparmen1/" #
506 503
#out_dir <-paste(out_dir,"_",out_prefix,sep="")
507 504
create_out_dir_param <- TRUE
508 505

  
......
743 740
y_var_name <- "dailyTmax" #set up in parameters of this script
744 741
interpolation_method <- c("gam_CAI") #set up in parameters of the script
745 742
name_method <- paste(interpolation_method,"_",y_var_name,"_",sep="")
746
#make it general using nb_mod!!
747
#could be set up at the begining?
748

  
749
mod_id <- c(1:(nb_mod-1),"_kr")
750
pred_pattern_str <- paste(".*predicted_mod",mod_id,"_0_1.*",sep="")
751
#,".*predicted_mod2_0_1.*",".*predicted_mod3_0_1.*",".*predicted_mod_kr_0_1.*")
752
#l_pattern_models <- lapply(c(".*predicted_mod1_0_1.*",".*predicted_mod2_0_1.*",".*predicted_mod3_0_1.*",".*predicted_mod_kr_0_1.*"),
753
#                           FUN=function(x){paste(x,dates_l,".*.tif",sep="")})
754
l_pattern_models <- lapply(pred_pattern_str,
755
                           FUN=function(x){paste(x,dates_l,".*.tif",sep="")})
756
#gam_CAI_dailyTmax_predicted_mod_kr_0_1_20101231_30_145.0_-120.0.tif
757
#gam_CAI_dailyTmax_predicted_mod_kr_0_1_20101231_30_145.0_-120.0.tif                    
758

  
759
##Get list of predicted tif across all tiles, models and dates...
760
#this takes time, use mclapply!!
761
lf_pred_tif <- vector("list",length=length(l_pattern_models)) #number of models is 3
762
for (i in 1:length(l_pattern_models)){
763
  l_pattern_mod <- l_pattern_models[[i]] #365 dates
764
  #list_tif_files_dates <-lapply(1:length(l_pattern_mod),FUN=list_tif_fun, 
765
  #                            in_dir_list=in_dir_list,pattern_str=l_pattern_models[[i]])
766
  list_tif_files_dates <-mclapply(1:length(l_pattern_mod),FUN=list_tif_fun, 
767
                              in_dir_list=in_dir_list,pattern_str=l_pattern_models[[i]],mc.preschedule=FALSE,mc.cores = 6)
768
  
769
  lf_pred_tif[[i]] <- list_tif_files_dates
770
}
771

  
772
#Need to check how many dates were predicted (have tif) !!! make a table with that!! 
773

  
774
#Now get the clim surfaces:
775
month_l <- paste("clim_month_",1:12,sep="")
776
#l_pattern_models <- lapply(c("_mod1_0_1.*","_mod2_0_1.*","_mod3_0_1.*","_mod_kr_0_1.*"),
777
#                           FUN=function(x){paste("*.",month_l,x,".*.tif",sep="")})
778
#generate this automatically!!!
779
l_pattern_models <- lapply(c("_mod1_0_1.*","_mod2_0_1.*","_mod_kr_0_1.*"),
780
                           FUN=function(x){paste("*.",month_l,x,".*.tif",sep="")})
781

  
782

  
783
#"CAI_TMAX_clim_month_11_mod2_0_145.0_-120.0.tif"
784
lf_clim_tif <- vector("list",length=nb_mod) #number of models is 3
785
for (i in 1:length(l_pattern_models)){
786
  l_pattern_mod <- l_pattern_models[[i]] #12 dates
787
  list_tif_files_dates <- mclapply(1:length(l_pattern_mod),FUN=list_tif_fun, 
788
                              in_dir_list=in_dir_list,pattern_str=l_pattern_models[[i]],mc.preschedule=FALSE,mc.cores = 6)
789
  lf_clim_tif[[i]] <- list_tif_files_dates
790
}
791

  
792
#Now get delta surfaces:
793

  
794
#mod_id <- c(1:(nb_mod-1),"_kr")
795
#pred_pattern_str <- paste(".*predicted_mod",mod_id,"_0_1.*",sep="")
796
#,".*predicted_mod2_0_1.*",".*predicted_mod3_0_1.*",".*predicted_mod_kr_0_1.*")
797
#l_pattern_models <- lapply(c(".*predicted_mod1_0_1.*",".*predicted_mod2_0_1.*",".*predicted_mod3_0_1.*",".*predicted_mod_kr_0_1.*"),
798
#                           FUN=function(x){paste(x,dates_l,".*.tif",sep="")})
799
#l_pattern_models <- lapply(pred_pattern_str,
800
#                           FUN=function(x){paste(x,dates_l,".*.tif",sep="")})
801

  
802
#date_l# <- paste("clim_month_",1:12,sep="")
803
#l_pattern_models <- lapply(c("_mod1_0_1.*","_mod2_0_1.*","_mod3_0_1.*","_mod_kr_0_1.*"),
804
#                           FUN=function(x){paste("*.",month_l,x,".*.tif",sep="")})
805
#l_pattern_models <- lapply(c(".*delta_dailyTmax_mod1_del_0_1.*",".*delta_dailyTmax_mod2_del_0_1.*",".*delta_dailyTmax_mod3_del_0_1.*",".*delta_dailyTmax_mod_kr_del_0_1.*"),
806
#                           FUN=function(x){paste(x,dates_l,".*.tif",sep="")})
807
l_pattern_models <- lapply(c(".*delta_dailyTmax_mod1_del_0_1.*",".*delta_dailyTmax_mod2_del_0_1.*",".*delta_dailyTmax_mod_kr_del_0_1.*"),
808
                           FUN=function(x){paste(x,dates_l,".*.tif",sep="")})
809

  
810
lf_delta_tif <- vector("list",length=nb_mod) #number of models is 3
811
for (i in 1:length(l_pattern_models)){
812
  l_pattern_mod <- l_pattern_models[[i]]
813
  list_tif_files_dates <- mclapply(1:length(l_pattern_mod),FUN=list_tif_fun, 
814
                              in_dir_list=in_dir_list,pattern_str=l_pattern_models[[i]],mc.preschedule=FALSE,mc.cores = 6)
815
  lf_delta_tif[[i]] <- list_tif_files_dates
816
}
817

  
743
##Use python code written by Alberto Guzman
818 744

  
819
#### NOW create mosaic images for daily prediction
745
#system("MODULEPATH=$MODULEPATH:/nex/modules/files")
746
#system("module load /nex/modules/files/pythonkits/gdal_1.10.0_python_2.7.3_nex")
820 747

  
821
#out_prefix_s <- paste(name_method,c("predicted_mod1_0_01","predicted_mod2_0_01","predicted_mod3_0_01","predicted_mod_kr_0_1"),sep="")
822
out_prefix_s <- paste(name_method,c("predicted_mod1_0_01","predicted_mod2_0_01","predicted_mod_kr_0_1"),sep="")
748
module_path <- ""
749
module_path <- "/nobackupp6/aguzman4/climateLayers/sharedCode/"
823 750

  
824
dates_l #list of predicted dates
825
#l_out_rastnames_var <- paste(name_method,"predicted_mod1_0_01_",dates_l,sep="")
826
l_out_rastnames_var <- lapply(out_prefix_s,
827
                              FUN=function(x){paste(x,"_",dates_l,sep="")})
751
#l_dates <- paste(day_to_mosaic,collapse=",",sep=" ")
752
l_dates <- paste(day_to_mosaic,collapse=",")
753
## use region 2 first
828 754

  
829
#nb_mod <- 4 #this is set up earlier
830
##Add option to specify wich dates to mosaic??
831
day_to_mosaic <- c("20100101","20100901")
832
if (!is.null(day_to_mosaic)){
833
  list_days <-match(day_to_mosaic,dates_l)
834
}else{
835
  list_days <- 1:365 #should check for year in case it has 366, add later!!
836
}
755
#make this a function later...with following param
756
#input:
757
#region_names
758
#in_dir1
759
##out_dir , not ehta out_dir moasic s can be created in rhe future function
760
#mod_str
761
#For the time being use mean,median from python function by Alberto...
837 762

  
838
##Use python code written by Alberto Guzman
763
for (i in 1:length(region_names)){
764
  in_dir_mosaics <- file.path(in_dir1,region_names[i])
765
  #out_dir_mosaics <- "/nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg5/mosaicsMean"
766
  #Can be changed to have mosaics in different dir..
767
  out_dir_mosaics <- out_dir
768
  #prefix_str <- "reg4_1500x4500"
769
  #tile_size <- basename(dirname(in_dir[[i]]))
770
  tile_size <- basename(in_dir1)
839 771

  
840
system("MODULEPATH=$MODULEPATH:/nex/modules/files")
841
system("module load /nex/modules/files/pythonkits/gdal_1.10.0_python_2.7.3_nex")
772
  prefix_str <- paste(region_names[i],"_",tile_size,sep="")
842 773

  
843
module_path <- ""
844
module_path <- "/nobackupp6/aguzman4/climateLayers/sharedCode/"
845
in_dir_mosaics <- "/nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg2/"
846
out_dir_mosaics <- "/nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg2/mosaics"
774
  mod_str <- "mod1" #use mod2 which corresponds to model with LST and elev
847 775

  
848
l_dates <- "20100101,20100102"
849
cmd_str <- paste("python", file.path(module_path,"mosaicUsingGdalMerge.py"),
776
  cmd_str <- paste("python", file.path(module_path,"mosaicUsingGdalMerge.py"),
850 777
                 in_dir_mosaics,
851 778
                 out_dir_mosaics,
779
                 prefix_str,
780
                 "--mods", mod_str,
852 781
                 "--date", l_dates,sep=" ")
853
system(cmd_str)
782
  system(cmd_str)
783

  
784
}
854 785

  
855 786
### Now find out how many files were predicted
856 787
# will be useful later on
......
871 802

  
872 803
names(data_month) #this contains LST means (mm_1, mm_2 etc.) as well as TMax and other info
873 804

  
874
#problem with tile 12...the raster ojbect has missing sub object
875
#data_month_list <- lapply(1:length(list_raster_obj_files),x=list_raster_obj_files,
876
#                          FUN=function(i,x){x<-load_obj(x[[i]]);
877
#                                            extract_from_list_obj(x$validation_mod_month_obj,"data_s")})                           
878

  
879
### make this part a function:
880

  
881
#create a table for every month, day and tiles...
882
# data_month_list <- lapply(1:length(list_raster_obj_files),x=list_raster_obj_files,
883
#                           FUN=function(i,x){x<-load_obj(x[[i]]);
884
#                                             extract_from_list_obj(x$clim_method_mod_obj,"data_month")})                           
885
# 
886
# names(data_month_list) <- paste("tile","_",1:length(data_month_list),sep="")
887
# 
888
# #names(data_month_list) <- basename(in_dir_list) #use folder id instead
889
# 
890
# list_names_tile_id <- paste("tile",1:length(list_raster_obj_files),sep="_")
891
# 
892
# #tile_id <- lapply(1:length(data_month_list),
893
# #                  FUN=function(i,x){rep(names(x)[i],nrow(x[[i]]))},x=data_month_list)
894
# 
895
# data_month_NAM <- do.call(rbind.fill,data_month_list) #combined data_month for "NAM" North America
896
# data_month_NAM$tile_id <- unlist(tile_id)
897
# 
898
# names(robj1$validation_mod_day_obj[[1]]$data_s) # daily for January with predictions
899
# dim(robj1$validation_mod_month_obj[[1]]$data_s) # daily for January with predictions
900
# 
901

  
902 805
use_day=TRUE
903 806
use_month=TRUE
904 807
 
......
937 840
#for i in 1:length(df_tiled_processed$tile_coord)
938 841
#output_atlas_dir <- "/data/project/layers/commons/NEX_data/output_run3_global_analyses_06192014/output10Deg/reg1"
939 842
#output_atlas_dir <- "/data/project/layers/commons/NEX_data/output_run5_global_analyses_08252014/output20Deg"
940
output_atlas_dir <- "/data/project/layers/commons/NEX_data/output_run10_global_analyses_12152014"
843
output_atlas_dir <- file.path("/data/project/layers/commons/NEX_data/",out_dir)
941 844
#Make directories on ATLAS
942 845
#for (i in 1:length(df_tile_processed$tile_coord)){
943 846
#  create_dir_fun(file.path(output_atlas_dir,as.character(df_tile_processed$tile_coord[i])),out_suffix=NULL)
......
948 851
#  create_dir_fun(file.path(output_atlas_dir,as.character(df_tile_processed$tile_coord[i]),"/shapefiles"),out_suffix=NULL)
949 852
#}  
950 853

  
951

  
952
#Copy summary textfiles and mosaic back to atlas
854
#Copy summary textfiles back to atlas
953 855

  
954 856
Atlas_dir <- file.path("/data/project/layers/commons/NEX_data/",basename(out_dir))#,"output/subset/shapefiles")
955 857
Atlas_hostname <- "parmentier@atlas.nceas.ucsb.edu"
956
lf_cp_f <- list.files(out_dir,full.names=T)#copy all files can filter later
858
lf_cp_f <- list.files(out_dir,full.names=T,pattern="*.txt")#copy all files can filter later
957 859
filenames_NEX <- paste(lf_cp_f,collapse=" ")  #copy raster prediction object
958 860
cmd_str <- paste("scp -p",filenames_NEX,paste(Atlas_hostname,Atlas_dir,sep=":"), sep=" ")
959 861
system(cmd_str)
......
979 881

  
980 882
###### COPY MOSAIC files
981 883

  
982
#> system("ls -ltr /nobackupp6/aguzman4/climateLayers/output1500x4500_km/reg5")
983
#Copy all mosaics related files in one unique directory called mosaics on Atlas
884
#Copy region mosaics back to atlas
984 885

  
985 886
Atlas_dir <- file.path("/data/project/layers/commons/NEX_data/",basename(out_dir),"mosaics")
986 887
Atlas_hostname <- "parmentier@atlas.nceas.ucsb.edu"
987
#lf_reg4 <- list.files(path=file.path(dirname(in_dir_list[[2]]),"mosaics"),full.names=T)
988
#lf_reg5 <- list.files(path=file.path(dirname(in_dir_list[[20]]),"mosaics"),full.names=T)
989
lf_reg2 <- list.files(path=file.path("/nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg2","mosaics"),
990
                      full.names=T)
991

  
992
#lf_cp_mosaics <- c(lf_reg4,lf_reg5)
993
#filenames_NEX <- paste(lf_cp_mosaics,collapse=" ")  #copy raster prediction object
994
#cmd_str <- paste("scp -p",filenames_NEX,paste(Atlas_hostname,Atlas_dir,sep=":"), sep=" ")
995
#system(cmd_str)
996

  
997
#since they have the same  name, must place them in separate dir...
998
filenames_NEX <- paste(lf_reg2,collapse=" ")  #copy raster prediction object
999
cmd_str <- paste("scp -p",filenames_NEX,paste(Atlas_hostname,file.path(Atlas_dir,"reg2"),sep=":"), sep=" ")
1000
system(cmd_str)
1001

  
1002
############# COPY FILES USED FOR DIFFERENCES OF IMAGES
1003
#copy mosaics from other tiles of 1,500x4,500
1004

  
1005

  
1006
lf_reg4_1500x4500 <- list.files(path="/nobackup/bparmen1//output_run10_global_analyses_12152014/mosaics/reg4_1500x4500/",full.names=T)
1007
lf_reg5_1500x4500 <- list.files(path="/nobackup/bparmen1//output_run10_global_analyses_12152014/mosaics/reg5_1500x4500/",full.names=T)
1008
lf_reg4_1000x3000 <- list.files(path="/nobackup/bparmen1//output_run10_global_analyses_12152014/mosaics/reg4_1000x3000/",full.names=T)
1009
lf_reg5_1000x3000 <- list.files(path="/nobackup/bparmen1//output_run10_global_analyses_12152014/mosaics/reg5_1000x3000/",full.names=T)
1010

  
1011
Atlas_dir <- file.path("/data/project/layers/commons/NEX_data/",basename(out_dir),"mosaics")
1012
Atlas_hostname <- "parmentier@atlas.nceas.ucsb.edu"
1013
#lf_reg4 <- list.files(path=file.path(dirname(in_dir_list[[2]]),"mosaics"),full.names=T)
1014

  
1015
#copy reg5_1000x3000
1016
filenames_NEX <- paste(lf_reg5_1000x3000,collapse=" ")  #copy raster prediction object
1017
cmd_str <- paste("scp -p",filenames_NEX,paste(Atlas_hostname,file.path(Atlas_dir,"reg5_1000x3000"),sep=":"), sep=" ")
1018
system(cmd_str)
1019

  
1020
#copy reg4_1000x3000
1021
filenames_NEX <- paste(lf_reg4_1000x3000,collapse=" ")  #copy raster prediction object
1022
cmd_str <- paste("scp -p",filenames_NEX,paste(Atlas_hostname,file.path(Atlas_dir,"reg4_1000x3000"),sep=":"), sep=" ")
1023
system(cmd_str)
1024

  
1025
#copy reg4_1500x4500
1026
filenames_NEX <- paste(lf_reg4_1500x4500,collapse=" ")  #copy raster prediction object
1027
cmd_str <- paste("scp -p",filenames_NEX,paste(Atlas_hostname,file.path(Atlas_dir,"reg4_1500x4500"),sep=":"), sep=" ")
1028
system(cmd_str)
1029

  
1030
#copy reg5_1500x4500
1031
filenames_NEX <- paste(lf_reg5_1500x4500,collapse=" ")  #copy raster prediction object
1032
cmd_str <- paste("scp -p",filenames_NEX,paste(Atlas_hostname,file.path(Atlas_dir,"reg5_1500x4500"),sep=":"), sep=" ")
888
lf_cp_f <- list.files(out_dir,full.names=T,pattern="*.tif")#copy all files can filter later
889
filenames_NEX <- paste(lf_cp_f,collapse=" ")  #copy raster prediction object
890
cmd_str <- paste("scp -p",filenames_NEX,paste(Atlas_hostname,Atlas_dir,sep=":"), sep=" ")
1033 891
system(cmd_str)
1034 892

  
1035

  
1036 893
##################### END OF SCRIPT ######################
1037 894

  
1038

  
1039 895
###Mosaic ...
1040 896
#python mosaicUsingGdalMerge.py /nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg5/ /nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg5/mosaics/
1041 897
#specify which month you want to process with the '-m' option. 
......
1046 902
#python /nobackupp6/aguzman4/climateLayers/sharedCode/mosaicUsingGdalMerge.py /nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg2/ /nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg2/mosaics/ --date 20100101,20100102,20100103,20100104
1047 903
#python /nobackupp6/aguzman4/climateLayers/sharedCode/mosaicUsingGdalMerge.py /nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg2/ /nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg2/mosaics/ --m 1"
1048 904

  
1049
# cmd_str <- paste("python", module_path,"mosaicUsingGdalMerge.py",
1050
#                  "/nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg5/"
1051
#                  "/nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg5/mosaics/"
1052
#                  "--date 20100101,20100102,20100103,20100104",sep=" ")
1053
# cmd_str <- paste("python", module_path,"mosaicUsingGdalMerge.py",
1054
#                  "/nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg5/"
1055
#                  "/nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg5/mosaics/"
1056
#                  "--date 20100101,20100102,20100103,20100104",sep=" ")
1057
# 
1058
# system("MODULEPATH=$MODULEPATH:/nex/modules/files")
1059
# system("module load /nex/modules/files/pythonkits/gdal_1.10.0_python_2.7.3_nex")
1060
# 
1061
# module_path <- ""
1062
#module_path <- "/nobackupp6/aguzman4/climateLayers/sharedCode/"
1063
#in_dir_mosaics <- "/nobackupp6/aguzman4/climateLayers/output1500x4500_km/reg5/"
1064
#out_dir_mosaics <- "/nobackupp6/aguzman4/climateLayers/output1500x4500_km/reg5/mosaics"
1065
#l_dates <- "20100101,20100102,20100103,20100104,20100901,20100902,20100903,20100904"
1066
#cmd_str <- paste("python", file.path(module_path,"mosaicUsingGdalMerge.py"),
1067
#                  in_dir_mosaics,
1068
#                  out_dir_mosaics,
1069
#                  "--date", l_dates,sep=" ")
1070
#system(cmd_str)
1071

  
1072
#module_path <- "/nobackupp6/aguzman4/climateLayers/sharedCode/"
1073
#in_dir_mosaics <- "/nobackupp6/aguzman4/climateLayers/output1500x4500_km/reg4/"
1074
#out_dir_mosaics <- "/nobackupp6/aguzman4/climateLayers/output1500x4500_km/reg4/mosaics"
1075
#l_dates <- "20100101,20100102,20100103,20100104,20100901,20100902,20100903,20100904"
1076
#cmd_str <- paste("python", file.path(module_path,"mosaicUsingGdalMerge.py"),
1077
#                  in_dir_mosaics,
1078
#                  out_dir_mosaics,
1079
#                  "--date", l_dates,sep=" ")
1080

  
1081
system("MODULEPATH=$MODULEPATH:/nex/modules/files")
1082
system("module load /nex/modules/files/pythonkits/gdal_1.10.0_python_2.7.3_nex")
1083

  
1084
module_path <- ""
1085
module_path <- "/nobackupp6/aguzman4/climateLayers/sharedCode/"
1086
in_dir_mosaics <- "/nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg4/"
1087
out_dir_mosaics <- "/nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg4/mosaicsMean"
1088
out_dir_mosaics <- "/nobackup/bparmen1//output_run10_global_analyses_12152014/mosaics/reg4_1000x3000"
1089
#/nobackup/bparmen1//output_run10_global_analyses_12152014
1090
prefix_str <- "reg4_1000x300"
1091

  
1092
#l_dates <- "20100101,20100102"
1093
l_dates <- "20100101,20100102,20100103,20100104,20100301,20100501,20100701,20100901,20100902,20100903,20100904"
1094
cmd_str <- paste("python", file.path(module_path,"mosaicUsingGdalMerge.py"),
1095
                 in_dir_mosaics,
1096
                 out_dir_mosaics,
1097
                 prefix_str,
1098
                 "--date", l_dates,sep=" ")
1099
system(cmd_str)
1100

  
1101
#reg5 100x3000
1102

  
1103
system("MODULEPATH=$MODULEPATH:/nex/modules/files")
1104
system("module load /nex/modules/files/pythonkits/gdal_1.10.0_python_2.7.3_nex")
1105

  
1106
module_path <- ""
1107
module_path <- "/nobackupp6/aguzman4/climateLayers/sharedCode/"
1108
in_dir_mosaics <- "/nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg5/"
1109
#out_dir_mosaics <- "/nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg5/mosaicsMean"
1110
out_dir_mosaics <- "/nobackup/bparmen1//output_run10_global_analyses_12152014/mosaics/reg5_1000x3000"
1111
#/nobackup/bparmen1//output_run10_global_analyses_12152014
1112
prefix_str <- "reg5_1000x300"
1113

  
1114
#l_dates <- "20100101,20100102"
1115
l_dates <- "20100101,20100102,20100103,20100104,20100301,20100501,20100701,20100901,20100902,20100903,20100904"
1116
cmd_str <- paste("python", file.path(module_path,"mosaicUsingGdalMerge.py"),
1117
                 in_dir_mosaics,
1118
                 out_dir_mosaics,
1119
                 prefix_str,
1120
                 "--date", l_dates,sep=" ")
1121
system(cmd_str)
1122

  
1123
#reg5 1500x4500
1124

  
1125
#system("MODULEPATH=$MODULEPATH:/nex/modules/files")
1126
#system("module load /nex/modules/files/pythonkits/gdal_1.10.0_python_2.7.3_nex")
1127

  
1128
module_path <- ""
1129
module_path <- "/nobackupp6/aguzman4/climateLayers/sharedCode/"
1130
in_dir_mosaics <- "/nobackupp6/aguzman4/climateLayers/output1500x4500_km/reg5/"
1131
#out_dir_mosaics <- "/nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg5/mosaicsMean"
1132
out_dir_mosaics <- "/nobackup/bparmen1//output_run10_global_analyses_12152014/mosaics/reg5_1500x4500"
1133
#/nobackup/bparmen1//output_run10_global_analyses_12152014
1134
prefix_str <- "reg5_1500x4500"
1135

  
1136
#l_dates <- "20100101,20100102"
1137
l_dates <- "20100101,20100102,20100103,20100104,20100301,20100501,20100701,20100901,20100902,20100903,20100904"
1138
cmd_str <- paste("python", file.path(module_path,"mosaicUsingGdalMerge.py"),
1139
                 in_dir_mosaics,
1140
                 out_dir_mosaics,
1141
                 prefix_str,
1142
                 "--date", l_dates,sep=" ")
1143
system(cmd_str)
1144

  
1145
#####
1146
#reg4 1500x4500: NEED TO USE MOD2!!! in this specific case...
1147

  
1148
#system("MODULEPATH=$MODULEPATH:/nex/modules/files")
1149
#system("module load /nex/modules/files/pythonkits/gdal_1.10.0_python_2.7.3_nex")
1150

  
1151
module_path <- ""
1152
module_path <- "/nobackupp6/aguzman4/climateLayers/sharedCode/"
1153
in_dir_mosaics <- "/nobackupp6/aguzman4/climateLayers/output1500x4500_km/reg4/"
1154
#out_dir_mosaics <- "/nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg5/mosaicsMean"
1155
out_dir_mosaics <- "/nobackup/bparmen1//output_run10_global_analyses_12152014/mosaics/reg4_1500x4500"
1156
#/nobackup/bparmen1//output_run10_global_analyses_12152014
1157
prefix_str <- "reg4_1500x4500"
1158
mod_str <- "mod2" #use mod2 which corresponds to model with LST and elev
1159

  
1160
#l_dates <- "20100101,20100102"
1161
l_dates <- "20100101,20100102,20100103,20100104,20100301,20100501,20100701,20100901,20100902,20100903,20100904"
1162
cmd_str <- paste("python", file.path(module_path,"mosaicUsingGdalMerge.py"),
1163
                 in_dir_mosaics,
1164
                 out_dir_mosaics,
1165
                 prefix_str,
1166
                 "--mods", mod_str,
1167
                 "--date", l_dates,sep=" ")
1168
system(cmd_str)
1169

  
1170
###copy folder in mosaics...

Also available in: Unified diff