Revision 9cc34b01
Added by Benoit Parmentier about 8 years ago
climate/research/oregon/interpolation/global_product_assessment_part2.R | ||
---|---|---|
4 | 4 |
#This part 2 of the assessment focuses on graphics to explore the spatial patterns of raster times series as figures and movie |
5 | 5 |
#AUTHOR: Benoit Parmentier |
6 | 6 |
#CREATED ON: 10/03/2016 |
7 |
#MODIFIED ON: 10/20/2016
|
|
7 |
#MODIFIED ON: 10/21/2016
|
|
8 | 8 |
#Version: 1 |
9 | 9 |
#PROJECT: Environmental Layers project |
10 | 10 |
#COMMENTS: Initial commit, script based on part NASA biodiversity conferenc |
... | ... | |
126 | 126 |
#master directory containing the definition of tile size and tiles predicted |
127 | 127 |
#in_dir <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg5/assessment" |
128 | 128 |
#in_dir_mosaic <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg5/mosaic/mosaic" |
129 |
in_dir <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg6/assessment"
|
|
129 |
in_dir <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg5/assessment"
|
|
130 | 130 |
#in_dir_mosaic <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg6/mosaics/mosaic" #predicted mosaic |
131 |
in_dir_mosaic <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg4/mosaic/mosaic"
|
|
132 |
|
|
133 |
region_name <- c("reg4") #param 6, arg 3
|
|
134 |
out_suffix <- "global_assessment_reg4_10102016"
|
|
131 |
in_dir_mosaic <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg5/mosaics/mosaic"
|
|
132 |
in_dir_mosaic <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg5/mosaics/mosaic" |
|
133 |
region_name <- c("reg5") #param 6, arg 3
|
|
134 |
out_suffix <- "global_assessment_reg5_10102016"
|
|
135 | 135 |
|
136 | 136 |
create_out_dir_param <- TRUE #param 9, arg 6 |
137 | 137 |
|
138 | 138 |
|
139 |
out_dir <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg4/assessment"
|
|
139 |
out_dir <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg5/assessment"
|
|
140 | 140 |
|
141 | 141 |
#run_figure_by_year <- TRUE # param 10, arg 7 |
142 | 142 |
|
... | ... | |
155 | 155 |
#date_end <- day_end |
156 | 156 |
|
157 | 157 |
#infile_mask <- "/nobackupp8/bparmen1/NEX_data/regions_input_files/r_mask_LST_reg4.tif" |
158 |
#infile_mask <- "/data/project/layers/commons/NEX_data/regions_input_files/r_mask_LST_reg5.tif"
|
|
159 |
infile_mask <- "/data/project/layers/commons/NEX_data/regions_input_files/r_mask_LST_reg4.tif" |
|
158 |
infile_mask <- "/data/project/layers/commons/NEX_data/regions_input_files/r_mask_LST_reg5.tif" |
|
159 |
#infile_mask <- "/data/project/layers/commons/NEX_data/regions_input_files/r_mask_LST_reg4.tif"
|
|
160 | 160 |
|
161 | 161 |
#run_figure_by_year <- TRUE # param 10, arg 7 |
162 | 162 |
list_year_predicted <- "1984,2014" |
163 | 163 |
scaling <- 0.01 #was scaled on 100 |
164 | 164 |
#if scaling is null then perform no scaling!! |
165 | 165 |
|
166 |
df_centroids_fname <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg4/mosaic/output_reg4_1999/df_centroids_19990701_reg4_1999.txt" |
|
166 |
df_centroids_fname <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg5/mosaic/output_reg5_1999/df_centroids_19990701_reg5_1999.txt" |
|
167 |
#df_centroids_fname <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg4/mosaic/output_reg4_1999/df_centroids_19990701_reg4_1999.txt" |
|
167 | 168 |
#df_centroids_fname <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg6/mosaic/output_reg6_1984/df_centroids_19840101_reg6_1984.txt" |
168 | 169 |
#/nobackupp6/aguzman4/climateLayers/out/reg1/assessment//output_reg1_1984/df_assessment_files_reg1_1984_reg1_1984.txt |
169 | 170 |
|
... | ... | |
201 | 202 |
############ Using predicting first ########## |
202 | 203 |
|
203 | 204 |
## using predictions |
204 |
if(is.null(lf_raster)){ |
|
205 |
|
|
206 |
#pattern_str <- ".*.tif" |
|
207 |
pattern_str <-"*.tif" |
|
208 |
lf_raster <- list.files(path=in_dir_mosaic,pattern=pattern_str,recursive=F,full.names=T) |
|
209 |
r_stack <- stack(lf_raster,quick=T) #this is very fast now with the quick option! |
|
210 |
#save(r_mosaic,file="r_mosaic.RData") |
|
211 |
|
|
212 |
}else{ |
|
213 |
r_stack <- stack(lf_raster,quick=T) #this is very fast now with the quick option! |
|
214 |
} |
|
205 |
#pattern_str <- ".*.tif" |
|
206 |
pattern_str <-"*.tif" |
|
207 |
lf_raster <- list.files(path=in_dir_mosaic,pattern=pattern_str,recursive=F,full.names=T) |
|
208 |
r_stack <- stack(lf_raster,quick=T) #this is very fast now with the quick option! |
|
209 |
#save(r_mosaic,file="r_mosaic.RData") |
|
215 | 210 |
|
216 | 211 |
#### check for missing dates from list of tif |
217 | 212 |
|
Also available in: Unified diff
more testing of function for reg5 missing mosaics