Revision d183bd8b
Added by Benoit Parmentier about 10 years ago
climate/research/oregon/interpolation/global_run_scalingup_assessment_part1.R | ||
---|---|---|
18 | 18 |
|
19 | 19 |
#First source file: |
20 | 20 |
#source /nobackupp4/aguzman4/climateLayers/sharedModules/etc/environ.sh |
21 |
#MODULEPATH=$MODULEPATH:/nex/modules/files |
|
22 |
#module load /nex/modules/files/pythonkits/gdal_1.10.0_python_2.7.3_nex |
|
23 |
|
|
21 | 24 |
################################################################################################# |
22 | 25 |
|
23 | 26 |
### Loading R library and packages |
... | ... | |
832 | 835 |
}else{ |
833 | 836 |
list_days <- 1:365 #should check for year in case it has 366, add later!! |
834 | 837 |
} |
835 |
###Make this a function later?? |
|
836 |
for (i in 1:nb_mod){ |
|
837 |
|
|
838 |
list_tif_files_dates <- lf_pred_tif[[i]] |
|
839 | 838 |
|
840 |
mosaic_list_var <- list_tif_files_dates |
|
841 |
out_rastnames_var <- l_out_rastnames_var[[i]] |
|
839 |
##Use python code written by Alberto Guzman |
|
842 | 840 |
|
843 |
file_format <- ".tif"
|
|
844 |
NA_flag_val <- -9999
|
|
841 |
system("MODULEPATH=$MODULEPATH:/nex/modules/files")
|
|
842 |
system("module load /nex/modules/files/pythonkits/gdal_1.10.0_python_2.7.3_nex")
|
|
845 | 843 |
|
846 |
j<-1 #date index for loop |
|
847 |
list_param_mosaic<-list(j,mosaic_list_var,out_rastnames_var,out_dir,file_format,NA_flag_val) |
|
848 |
names(list_param_mosaic)<-c("j","mosaic_list","out_rastnames","out_path","file_format","NA_flag_val") |
|
849 |
#list_var_mosaiced <- mclapply(1:2,FUN=mosaic_m_raster_list,list_param=list_param_mosaic,mc.preschedule=FALSE,mc.cores = 2) |
|
850 |
list_var_mosaiced <- mclapply(list_days,FUN=mosaic_m_raster_list,list_param=list_param_mosaic,mc.preschedule=FALSE,mc.cores = 2) |
|
851 |
#list_var_mosaiced <- mclapply(1:1,FUN=mosaic_m_raster_list,list_param=list_param_mosaic,mc.preschedule=FALSE,mc.cores = 1) |
|
852 |
#list_var_mosaiced <- mclapply(1:365,FUN=mosaic_m_raster_list,list_param=list_param_mosaic,mc.preschedule=FALSE,mc.cores = 2) |
|
853 |
|
|
854 |
#mosaic for delt sufaces? |
|
855 |
#mosoaic for clim months? |
|
856 |
|
|
857 |
} |
|
858 |
|
|
859 |
###################### |
|
860 |
### mosaic clim monthly data...this will be a function later... |
|
861 |
|
|
862 |
#Now get the clim surfaces: |
|
863 |
month_l <- paste("clim_month_",1:12,sep="") |
|
864 |
#l_pattern_models <- lapply(c("_mod1_0_1","_mod2_0_1","_mod3_0_1","_mod_kr_0_1"), |
|
865 |
# FUN=function(x){paste(x,"_",month_l,sep="")}) |
|
866 |
|
|
867 |
out_prefix_s <- paste(name_method,c("_mod1_0_01","_mod2_0_01","_mod3_0_01","_mod_kr_0_1"),sep="") |
|
868 |
dates_l #list of predicted dates |
|
869 |
#l_out_rastnames_var <- paste(name_method,"predicted_mod1_0_01_",dates_l,sep="") |
|
870 |
l_out_rastnames_var <- lapply(out_prefix_s, |
|
871 |
FUN=function(x){paste(x,"_",month_l,sep="")}) |
|
872 |
|
|
873 |
for (i in 1:nb_mod){ |
|
874 |
|
|
875 |
#this should be the input param for the new function generated automatically... |
|
876 |
list_tif_files_dates <- lf_clim_tif[[i]] |
|
877 |
mosaic_list_var <- list_tif_files_dates |
|
878 |
out_rastnames_var <- l_out_rastnames_var[[i]] |
|
879 |
#file_format <- ".tif" |
|
880 |
#NA_flag_val <- -9999 |
|
881 |
|
|
882 |
j<-1 #date index for loop |
|
883 |
list_param_mosaic<-list(j,mosaic_list_var,out_rastnames_var,out_dir,file_format,NA_flag_val) |
|
884 |
names(list_param_mosaic)<-c("j","mosaic_list","out_rastnames","out_path","file_format","NA_flag_val") |
|
885 |
#list_var_mosaiced <- mclapply(1:2,FUN=mosaic_m_raster_list,list_param=list_param_mosaic,mc.preschedule=FALSE,mc.cores = 2) |
|
886 |
list_var_mosaiced <- mclapply(1:12,FUN=mosaic_m_raster_list,list_param=list_param_mosaic,mc.preschedule=FALSE,mc.cores = 4) |
|
887 |
} |
|
844 |
module_path <- "" |
|
845 |
module_path <- "/nobackupp6/aguzman4/climateLayers/sharedCode/" |
|
846 |
in_dir_mosaics <- "/nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg2/" |
|
847 |
out_dir_mosaics <- "/nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg2/mosaics" |
|
888 | 848 |
|
889 |
###################### |
|
890 |
#### NOW create mosaic images for daily delta prediction |
|
891 |
#This should be a function!!! |
|
892 |
date_l# <- paste("clim_month_",1:12,sep="") |
|
893 |
#l_pattern_models <- lapply(c("_mod1_0_1.*","_mod2_0_1.*","_mod3_0_1.*","_mod_kr_0_1.*"), |
|
894 |
# FUN=function(x){paste("*.",month_l,x,".*.tif",sep="")}) |
|
895 |
#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.*"), |
|
896 |
# FUN=function(x){paste(x,dates_l,".*.tif",sep="")}) |
|
897 |
|
|
898 |
out_prefix_s <- paste(name_method,c("delta_mod1_0_01","delta_mod2_0_01","delta_mod3_0_01","delta_mod_kr_0_1"),sep="") |
|
899 |
dates_l #list of predicted dates |
|
900 |
#l_out_rastnames_var <- paste(name_method,"predicted_mod1_0_01_",dates_l,sep="") |
|
901 |
l_out_rastnames_var <- lapply(out_prefix_s, |
|
902 |
FUN=function(x){paste(x,"_",dates_l,sep="")}) |
|
903 |
|
|
904 |
#nb_mod <- 4 #this is set up earlier |
|
905 |
##Add option to specify wich dates to mosaic?? |
|
906 |
day_to_mosaic <- c("20100101","20100901") |
|
907 |
if (!is.null(day_to_mosaic)){ |
|
908 |
list_days <-match(day_to_mosaic,dates_l) |
|
909 |
}else{ |
|
910 |
list_days <- 1:365 #should check for year in case it has 366, add later!! |
|
911 |
} |
|
912 |
###Make this a function later?? |
|
913 |
for (i in 1:nb_mod){ |
|
914 |
|
|
915 |
list_tif_files_dates <- lf_pred_tif[[i]] |
|
916 |
mosaic_list_var <- list_tif_files_dates |
|
917 |
out_rastnames_var <- l_out_rastnames_var[[i]] |
|
918 |
#this is be set up earlier... |
|
919 |
#file_format <- ".tif" |
|
920 |
#NA_flag_val <- -9999 |
|
921 |
|
|
922 |
j<-1 #date index for loop |
|
923 |
list_param_mosaic<-list(j,mosaic_list_var,out_rastnames_var,out_dir,file_format,NA_flag_val) |
|
924 |
names(list_param_mosaic)<-c("j","mosaic_list","out_rastnames","out_path","file_format","NA_flag_val") |
|
925 |
#list_var_mosaiced <- mclapply(1:2,FUN=mosaic_m_raster_list,list_param=list_param_mosaic,mc.preschedule=FALSE,mc.cores = 2) |
|
926 |
list_var_mosaiced <- mclapply(list_days,FUN=mosaic_m_raster_list,list_param=list_param_mosaic,mc.preschedule=FALSE,mc.cores = 2) |
|
927 |
} |
|
849 |
l_dates <- "20100101,20100102" |
|
850 |
cmd_str <- paste("python", file.path(module_path,"mosaicUsingGdalMerge.py"), |
|
851 |
in_dir_mosaics, |
|
852 |
out_dir_mosaics, |
|
853 |
"--date", l_dates,sep=" ") |
|
854 |
system(cmd_str) |
|
928 | 855 |
|
929 | 856 |
### Now find out how many files were predicted |
930 |
|
|
857 |
# will be useful later on |
|
931 | 858 |
|
932 | 859 |
###################################################### |
933 | 860 |
####### PART 3: EXAMINE STATIONS AND MODEL FITTING ### |
... | ... | |
1058 | 985 |
|
1059 | 986 |
Atlas_dir <- file.path("/data/project/layers/commons/NEX_data/",basename(out_dir),"mosaics") |
1060 | 987 |
Atlas_hostname <- "parmentier@atlas.nceas.ucsb.edu" |
1061 |
lf_reg4 <- list.files(path=file.path(dirname(in_dir_list[[2]]),"mosaics"),full.names=T) |
|
1062 |
lf_reg5 <- list.files(path=file.path(dirname(in_dir_list[[20]]),"mosaics"),full.names=T) |
|
988 |
#lf_reg4 <- list.files(path=file.path(dirname(in_dir_list[[2]]),"mosaics"),full.names=T) |
|
989 |
#lf_reg5 <- list.files(path=file.path(dirname(in_dir_list[[20]]),"mosaics"),full.names=T) |
|
990 |
lf_reg2 <- list.files(path=file.path("/nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg2","mosaics"), |
|
991 |
full.names=T) |
|
1063 | 992 |
|
1064 | 993 |
#lf_cp_mosaics <- c(lf_reg4,lf_reg5) |
1065 |
filenames_NEX <- paste(lf_cp_mosaics,collapse=" ") #copy raster prediction object |
|
1066 |
cmd_str <- paste("scp -p",filenames_NEX,paste(Atlas_hostname,Atlas_dir,sep=":"), sep=" ") |
|
1067 |
system(cmd_str) |
|
994 |
#filenames_NEX <- paste(lf_cp_mosaics,collapse=" ") #copy raster prediction object
|
|
995 |
#cmd_str <- paste("scp -p",filenames_NEX,paste(Atlas_hostname,Atlas_dir,sep=":"), sep=" ")
|
|
996 |
#system(cmd_str)
|
|
1068 | 997 |
|
1069 | 998 |
#since they have the same name, must place them in separate dir... |
1070 |
filenames_NEX <- paste(lf_reg4,collapse=" ") #copy raster prediction object
|
|
1071 |
cmd_str <- paste("scp -p",filenames_NEX,paste(Atlas_hostname,file.path(Atlas_dir,"reg4"),sep=":"), sep=" ")
|
|
999 |
filenames_NEX <- paste(lf_reg2,collapse=" ") #copy raster prediction object
|
|
1000 |
cmd_str <- paste("scp -p",filenames_NEX,paste(Atlas_hostname,file.path(Atlas_dir,"reg2"),sep=":"), sep=" ")
|
|
1072 | 1001 |
system(cmd_str) |
1073 | 1002 |
|
1074 |
filenames_NEX <- paste(lf_reg5,collapse=" ") #copy raster prediction object |
|
1075 |
cmd_str <- paste("scp -p",filenames_NEX,paste(Atlas_hostname,file.path(Atlas_dir,"reg5"),sep=":"), sep=" ") |
|
1003 |
############# COPY FILES USED FOR DIFFERENCES OF IMAGES |
|
1004 |
#copy mosaics from other tiles of 1,500x4,500 |
|
1005 |
|
|
1006 |
|
|
1007 |
lf_reg4_1500x4500 <- list.files(path="/nobackup/bparmen1//output_run10_global_analyses_12152014/mosaics/reg4_1500x4500/",full.names=T) |
|
1008 |
lf_reg5_1500x4500 <- list.files(path="/nobackup/bparmen1//output_run10_global_analyses_12152014/mosaics/reg5_1500x4500/",full.names=T) |
|
1009 |
lf_reg4_1000x3000 <- list.files(path="/nobackup/bparmen1//output_run10_global_analyses_12152014/mosaics/reg4_1000x3000/",full.names=T) |
|
1010 |
lf_reg5_1000x3000 <- list.files(path="/nobackup/bparmen1//output_run10_global_analyses_12152014/mosaics/reg5_1000x3000/",full.names=T) |
|
1011 |
|
|
1012 |
Atlas_dir <- file.path("/data/project/layers/commons/NEX_data/",basename(out_dir),"mosaics") |
|
1013 |
Atlas_hostname <- "parmentier@atlas.nceas.ucsb.edu" |
|
1014 |
#lf_reg4 <- list.files(path=file.path(dirname(in_dir_list[[2]]),"mosaics"),full.names=T) |
|
1015 |
|
|
1016 |
#copy reg5_1000x3000 |
|
1017 |
filenames_NEX <- paste(lf_reg5_1000x3000,collapse=" ") #copy raster prediction object |
|
1018 |
cmd_str <- paste("scp -p",filenames_NEX,paste(Atlas_hostname,file.path(Atlas_dir,"reg5_1000x3000"),sep=":"), sep=" ") |
|
1019 |
system(cmd_str) |
|
1020 |
|
|
1021 |
#copy reg4_1000x3000 |
|
1022 |
filenames_NEX <- paste(lf_reg4_1000x3000,collapse=" ") #copy raster prediction object |
|
1023 |
cmd_str <- paste("scp -p",filenames_NEX,paste(Atlas_hostname,file.path(Atlas_dir,"reg4_1000x3000"),sep=":"), sep=" ") |
|
1024 |
system(cmd_str) |
|
1025 |
|
|
1026 |
#copy reg4_1500x4500 |
|
1027 |
filenames_NEX <- paste(lf_reg4_1500x4500,collapse=" ") #copy raster prediction object |
|
1028 |
cmd_str <- paste("scp -p",filenames_NEX,paste(Atlas_hostname,file.path(Atlas_dir,"reg4_1500x4500"),sep=":"), sep=" ") |
|
1029 |
system(cmd_str) |
|
1030 |
|
|
1031 |
#copy reg5_1500x4500 |
|
1032 |
filenames_NEX <- paste(lf_reg5_1500x4500,collapse=" ") #copy raster prediction object |
|
1033 |
cmd_str <- paste("scp -p",filenames_NEX,paste(Atlas_hostname,file.path(Atlas_dir,"reg5_1500x4500"),sep=":"), sep=" ") |
|
1076 | 1034 |
system(cmd_str) |
1077 | 1035 |
|
1078 |
###Copy shapefiles in the separate directories? |
|
1079 |
#lf_cp_shp <- list.files(in_dir_shp, ".shp",full.names=T) |
|
1080 |
#list_tile_scp <- 1:6 |
|
1081 |
|
|
1082 |
#for (j in 1:length(list_tile_scp)){ |
|
1083 |
# tile_nb <- list_tile_scp[j] |
|
1084 |
# |
|
1085 |
# in_dir_tile <-dirname(df_tile_processed$shp_files[tile_nb]) |
|
1086 |
# #/data/project/layers/commons/NEX_data/output_run2_05122014/output |
|
1087 |
# #output_atlas_dir |
|
1088 |
# #Atlas_dir <- file.path(file.path("/data/project/layers/commons/NEX_data/",basename(out_dir),"output"),in_dir_tile) |
|
1089 |
# Atlas_dir <- file.path(output_atlas_dir,as.character(df_tile_processed$tile_coord[j]),"/shapefiles") |
|
1090 |
|
|
1091 |
# Atlas_hostname <- "parmentier@atlas.nceas.ucsb.edu" |
|
1092 |
# |
|
1093 |
# lf_cp_shp_pattern <- gsub(".shp","*",lf_cp_shp) |
|
1094 |
|
|
1095 |
#filenames_NEX <- paste(lf_cp_shp,collapse=" ") #copy raster prediction object |
|
1096 |
# filenames_NEX <- paste(lf_cp_shp_pattern,collapse=" ") #copy raster prediction object |
|
1097 |
|
|
1098 |
# cmd_str <- paste("scp -p",filenames_NEX,paste(Atlas_hostname,Atlas_dir,sep=":"), sep=" ") |
|
1099 |
# system(cmd_str) |
|
1100 |
#} |
|
1101 |
|
|
1102 |
#### FIRST COPY DATA FOR SPECIFIC TILES ##### |
|
1103 |
#Copy specific tiles info back...This assumes that the tree structre |
|
1104 |
#has been created on ATLAS: |
|
1105 |
#../$out_dir/ouput/tile_coord |
|
1106 |
|
|
1107 |
#list_tile_scp <- c(1,2) |
|
1108 |
list_tile_scp <- 1:6 |
|
1109 |
|
|
1110 |
for (j in 1:length(list_tile_scp)){ |
|
1111 |
tile_nb <- list_tile_scp[j] |
|
1112 |
#nb_mod <- 3+1 #set up earlier |
|
1113 |
date_selected <- c("20100101","20100102","20100103","20100103","20100901","20100902","20100903") #should be set up earlier |
|
1114 |
date_index <- c(1,2,3,244,245,246) #list_day?? |
|
1115 |
#tile_nb <- 1 |
|
1116 |
|
|
1117 |
in_dir_tile <- basename(df_tile_processed$path_NEX[tile_nb]) |
|
1118 |
#/data/project/layers/commons/NEX_data/output_run2_05122014/output |
|
1119 |
#output_atlas_dir |
|
1120 |
#Atlas_dir <- file.path(file.path("/data/project/layers/commons/NEX_data/",basename(out_dir),"output"),in_dir_tile) |
|
1121 |
Atlas_dir <- file.path(output_atlas_dir,in_dir_tile) |
|
1122 |
Atlas_hostname <- "parmentier@atlas.nceas.ucsb.edu" |
|
1123 |
#filenames_NEX <- list_raster_obj_files[tile_nb] #copy raster prediction object |
|
1124 |
#cmd_str <- paste("scp -p",filenames_NEX,paste(Atlas_hostname,Atlas_dir,sep=":"), sep=" ") |
|
1125 |
#system(cmd_str) |
|
1126 |
|
|
1127 |
#Now copy back tif for specific dates and tile (date 1 and date 244) |
|
1128 |
#nb_mod <- 3+1 |
|
1129 |
lf_cp_day <- vector("list",length=length(date_selected)) |
|
1130 |
#Get relevant daily info |
|
1131 |
for(i in 1:length(date_selected)){ |
|
1132 |
#d |
|
1133 |
index <- date_index[i] |
|
1134 |
#get all predicted tmax files for all models and specific date, tile |
|
1135 |
lf_cp_pred_tif <- unlist(lapply(1:nb_mod,FUN=function(x){lf_pred_tif[[x]][[index]][[tile_nb]]})) |
|
1136 |
lf_cp_delta_tif <- unlist(lapply(1:nb_mod,FUN=function(x){lf_delta_tif[[x]][[index]][[tile_nb]]})) |
|
1137 |
lf_cp_day[[i]] <- unlist(c(unlist(lf_cp_pred_tif),unlist(lf_cp_delta_tif))) |
|
1138 |
} |
|
1139 |
#get the monthly info... |
|
1140 |
month_index <- 1:12 #can subset |
|
1141 |
#month_index <- c(1,9) #can subset |
|
1142 |
lf_cp_month <- vector("list",length=length(month_index)) |
|
1143 |
|
|
1144 |
for(i in 1:length(month_index)){ |
|
1145 |
#d |
|
1146 |
index <- month_index[i] |
|
1147 |
#get all predicted tmax files for all models and specific date, tile |
|
1148 |
lf_cp_month[[i]] <- unlist(lapply(1:nb_mod,FUN=function(x){lf_clim_tif[[x]][[index]][[tile_nb]]})) |
|
1149 |
} |
|
1150 |
##Add RData object for specified tile... |
|
1151 |
lf_cp_RData_tif <- c(lf_covar_obj[tile_nb],lf_covar_tif[tile_nb],list_raster_obj_files[[tile_nb]],lf_diagnostic_obj[[tile_nb]]) |
|
1152 |
#unlist(lf_cp_RData_tif) |
|
1153 |
lf_cp <- unlist(c(lf_cp_day,lf_cp_month,lf_cp_RData_tif)) |
|
1154 |
#lf_cp <- c(unlist(c(lf_cp_day,lf_cp_month)),list_raster_obj_files[tile_nb]) |
|
1155 |
filenames_NEX <- paste(lf_cp,collapse=" ") |
|
1156 |
#filenames_NEX <- paste(list_tif_files_dates[[1]][[6]],list_tif_files_dates[[244]][[6]],lf_covar_tif[6]) #to get first date and tile 6 prediction mod1 |
|
1157 |
cmd_str <- paste("scp -p",filenames_NEX,paste(Atlas_hostname,Atlas_dir,sep=":"), sep=" ") |
|
1158 |
system(cmd_str) |
|
1159 |
} |
|
1160 | 1036 |
|
1161 | 1037 |
##################### END OF SCRIPT ###################### |
1162 | 1038 |
|
1163 | 1039 |
|
1164 | 1040 |
###Mosaic ... |
1165 |
#MODULEPATH=$MODULEPATH:/nex/modules/files |
|
1166 |
#module load pythonkits/gdal_1.10.0_python_2.7.3_nex |
|
1041 |
#python mosaicUsingGdalMerge.py /nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg5/ /nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg5/mosaics/ |
|
1042 |
#specify which month you want to process with the '-m' option. |
|
1043 |
#To do select dates you can use the '--date' option and use the format YYYYMMDD, |
|
1044 |
#can do multiple dates at a time by separating them with a comma. |
|
1045 |
|
|
1046 |
#python mosaicUsingGdalMerge.py /nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg5/ /nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg5/mosaics/ --date 20100101,20100102,20100103,20100104 |
|
1047 |
#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 |
|
1048 |
#python /nobackupp6/aguzman4/climateLayers/sharedCode/mosaicUsingGdalMerge.py /nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg2/ /nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg2/mosaics/ --m 1" |
|
1049 |
|
|
1050 |
# cmd_str <- paste("python", module_path,"mosaicUsingGdalMerge.py", |
|
1051 |
# "/nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg5/" |
|
1052 |
# "/nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg5/mosaics/" |
|
1053 |
# "--date 20100101,20100102,20100103,20100104",sep=" ") |
|
1054 |
# cmd_str <- paste("python", module_path,"mosaicUsingGdalMerge.py", |
|
1055 |
# "/nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg5/" |
|
1056 |
# "/nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg5/mosaics/" |
|
1057 |
# "--date 20100101,20100102,20100103,20100104",sep=" ") |
|
1058 |
# |
|
1059 |
# system("MODULEPATH=$MODULEPATH:/nex/modules/files") |
|
1060 |
# system("module load /nex/modules/files/pythonkits/gdal_1.10.0_python_2.7.3_nex") |
|
1061 |
# |
|
1062 |
# module_path <- "" |
|
1063 |
#module_path <- "/nobackupp6/aguzman4/climateLayers/sharedCode/" |
|
1064 |
#in_dir_mosaics <- "/nobackupp6/aguzman4/climateLayers/output1500x4500_km/reg5/" |
|
1065 |
#out_dir_mosaics <- "/nobackupp6/aguzman4/climateLayers/output1500x4500_km/reg5/mosaics" |
|
1066 |
#l_dates <- "20100101,20100102,20100103,20100104,20100901,20100902,20100903,20100904" |
|
1067 |
#cmd_str <- paste("python", file.path(module_path,"mosaicUsingGdalMerge.py"), |
|
1068 |
# in_dir_mosaics, |
|
1069 |
# out_dir_mosaics, |
|
1070 |
# "--date", l_dates,sep=" ") |
|
1071 |
#system(cmd_str) |
|
1072 |
|
|
1073 |
#module_path <- "/nobackupp6/aguzman4/climateLayers/sharedCode/" |
|
1074 |
#in_dir_mosaics <- "/nobackupp6/aguzman4/climateLayers/output1500x4500_km/reg4/" |
|
1075 |
#out_dir_mosaics <- "/nobackupp6/aguzman4/climateLayers/output1500x4500_km/reg4/mosaics" |
|
1076 |
#l_dates <- "20100101,20100102,20100103,20100104,20100901,20100902,20100903,20100904" |
|
1077 |
#cmd_str <- paste("python", file.path(module_path,"mosaicUsingGdalMerge.py"), |
|
1078 |
# in_dir_mosaics, |
|
1079 |
# out_dir_mosaics, |
|
1080 |
# "--date", l_dates,sep=" ") |
|
1081 |
|
|
1082 |
system("MODULEPATH=$MODULEPATH:/nex/modules/files") |
|
1083 |
system("module load /nex/modules/files/pythonkits/gdal_1.10.0_python_2.7.3_nex") |
|
1084 |
|
|
1085 |
module_path <- "" |
|
1086 |
module_path <- "/nobackupp6/aguzman4/climateLayers/sharedCode/" |
|
1087 |
in_dir_mosaics <- "/nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg4/" |
|
1088 |
out_dir_mosaics <- "/nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg4/mosaicsMean" |
|
1089 |
out_dir_mosaics <- "/nobackup/bparmen1//output_run10_global_analyses_12152014/mosaics/reg4_1000x3000" |
|
1090 |
#/nobackup/bparmen1//output_run10_global_analyses_12152014 |
|
1091 |
prefix_str <- "reg4_1000x300" |
|
1092 |
|
|
1093 |
#l_dates <- "20100101,20100102" |
|
1094 |
l_dates <- "20100101,20100102,20100103,20100104,20100301,20100501,20100701,20100901,20100902,20100903,20100904" |
|
1095 |
cmd_str <- paste("python", file.path(module_path,"mosaicUsingGdalMerge.py"), |
|
1096 |
in_dir_mosaics, |
|
1097 |
out_dir_mosaics, |
|
1098 |
prefix_str, |
|
1099 |
"--date", l_dates,sep=" ") |
|
1100 |
system(cmd_str) |
|
1101 |
|
|
1102 |
#reg5 100x3000 |
|
1103 |
|
|
1104 |
system("MODULEPATH=$MODULEPATH:/nex/modules/files") |
|
1105 |
system("module load /nex/modules/files/pythonkits/gdal_1.10.0_python_2.7.3_nex") |
|
1106 |
|
|
1107 |
module_path <- "" |
|
1108 |
module_path <- "/nobackupp6/aguzman4/climateLayers/sharedCode/" |
|
1109 |
in_dir_mosaics <- "/nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg5/" |
|
1110 |
#out_dir_mosaics <- "/nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg5/mosaicsMean" |
|
1111 |
out_dir_mosaics <- "/nobackup/bparmen1//output_run10_global_analyses_12152014/mosaics/reg5_1000x3000" |
|
1112 |
#/nobackup/bparmen1//output_run10_global_analyses_12152014 |
|
1113 |
prefix_str <- "reg5_1000x300" |
|
1114 |
|
|
1115 |
#l_dates <- "20100101,20100102" |
|
1116 |
l_dates <- "20100101,20100102,20100103,20100104,20100301,20100501,20100701,20100901,20100902,20100903,20100904" |
|
1117 |
cmd_str <- paste("python", file.path(module_path,"mosaicUsingGdalMerge.py"), |
|
1118 |
in_dir_mosaics, |
|
1119 |
out_dir_mosaics, |
|
1120 |
prefix_str, |
|
1121 |
"--date", l_dates,sep=" ") |
|
1122 |
system(cmd_str) |
|
1123 |
|
|
1124 |
#reg5 1500x4500 |
|
1125 |
|
|
1126 |
#system("MODULEPATH=$MODULEPATH:/nex/modules/files") |
|
1127 |
#system("module load /nex/modules/files/pythonkits/gdal_1.10.0_python_2.7.3_nex") |
|
1128 |
|
|
1129 |
module_path <- "" |
|
1130 |
module_path <- "/nobackupp6/aguzman4/climateLayers/sharedCode/" |
|
1131 |
in_dir_mosaics <- "/nobackupp6/aguzman4/climateLayers/output1500x4500_km/reg5/" |
|
1132 |
#out_dir_mosaics <- "/nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg5/mosaicsMean" |
|
1133 |
out_dir_mosaics <- "/nobackup/bparmen1//output_run10_global_analyses_12152014/mosaics/reg5_1500x4500" |
|
1134 |
#/nobackup/bparmen1//output_run10_global_analyses_12152014 |
|
1135 |
prefix_str <- "reg5_1500x4500" |
|
1136 |
|
|
1137 |
#l_dates <- "20100101,20100102" |
|
1138 |
l_dates <- "20100101,20100102,20100103,20100104,20100301,20100501,20100701,20100901,20100902,20100903,20100904" |
|
1139 |
cmd_str <- paste("python", file.path(module_path,"mosaicUsingGdalMerge.py"), |
|
1140 |
in_dir_mosaics, |
|
1141 |
out_dir_mosaics, |
|
1142 |
prefix_str, |
|
1143 |
"--date", l_dates,sep=" ") |
|
1144 |
system(cmd_str) |
|
1167 | 1145 |
|
1146 |
##### |
|
1147 |
#reg4 1500x4500: NEED TO USE MOD2!!! in this specific case... |
|
1148 |
|
|
1149 |
#system("MODULEPATH=$MODULEPATH:/nex/modules/files") |
|
1150 |
#system("module load /nex/modules/files/pythonkits/gdal_1.10.0_python_2.7.3_nex") |
|
1151 |
|
|
1152 |
module_path <- "" |
|
1153 |
module_path <- "/nobackupp6/aguzman4/climateLayers/sharedCode/" |
|
1154 |
in_dir_mosaics <- "/nobackupp6/aguzman4/climateLayers/output1500x4500_km/reg4/" |
|
1155 |
#out_dir_mosaics <- "/nobackupp6/aguzman4/climateLayers/output1000x3000_km/reg5/mosaicsMean" |
|
1156 |
out_dir_mosaics <- "/nobackup/bparmen1//output_run10_global_analyses_12152014/mosaics/reg4_1500x4500" |
|
1157 |
#/nobackup/bparmen1//output_run10_global_analyses_12152014 |
|
1158 |
prefix_str <- "reg4_1500x4500" |
|
1159 |
mod_str <- "mod2" #use mod2 which corresponds to model with LST and elev |
|
1160 |
|
|
1161 |
#l_dates <- "20100101,20100102" |
|
1162 |
l_dates <- "20100101,20100102,20100103,20100104,20100301,20100501,20100701,20100901,20100902,20100903,20100904" |
|
1163 |
cmd_str <- paste("python", file.path(module_path,"mosaicUsingGdalMerge.py"), |
|
1164 |
in_dir_mosaics, |
|
1165 |
out_dir_mosaics, |
|
1166 |
prefix_str, |
|
1167 |
"--mods", mod_str, |
|
1168 |
"--date", l_dates,sep=" ") |
|
1169 |
system(cmd_str) |
|
1168 | 1170 |
|
1171 |
###copy folder in mosaics... |
Also available in: Unified diff
run 10 NEX assessement generation of mosaics images and automated copy back to server