Project

General

Profile

« Previous | Next » 

Revision ca012182

Added by Benoit Parmentier about 8 years ago

checking missing files for region 5 with check_missing function

View differences:

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/19/2016            
7
#MODIFIED ON: 10/20/2016            
8 8
#Version: 1
9 9
#PROJECT: Environmental Layers project     
10 10
#COMMENTS: Initial commit, script based on part NASA biodiversity conferenc 
......
18 18
#source /nobackupp6/aguzman4/climateLayers/sharedModules2/etc/environ.sh 
19 19
#
20 20
#setfacl -Rm u:aguzman4:rwx /nobackupp6/aguzman4/climateLayers/LST_tempSpline/
21
#COMMIT: moving check missing function and testing it
21
#COMMIT: checking missing files for region 5 with check_missing function 
22 22

  
23 23
#################################################################################################
24 24

  
......
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 129
in_dir <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg6/assessment"
130
in_dir_mosaic <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg6/mosaics/mosaic" #predicted mosaic
131
#/data/project/layers/commons/NEX_data/climateLayers/out/reg4/mosaic/mosaic
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 132

  
133
region_name <- c("reg6") #param 6, arg 3
134
out_suffix <- "global_assessment_reg6_10102016"
133
region_name <- c("reg4") #param 6, arg 3
134
out_suffix <- "global_assessment_reg4_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/reg6/assessment"
139
out_dir <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg4/assessment"
140 140

  
141 141
#run_figure_by_year <- TRUE # param 10, arg 7
142 142

  
......
156 156

  
157 157
#infile_mask <- "/nobackupp8/bparmen1/NEX_data/regions_input_files/r_mask_LST_reg4.tif"
158 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_reg6.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_reg5_1999/df_centroids_19990701_reg5_1999.txt"
167
df_centroids_fname <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg6/mosaic/output_reg6_1984/df_centroids_19840101_reg6_1984.txt"
166
df_centroids_fname <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg4/mosaic/output_reg4_1999/df_centroids_19990701_reg4_1999.txt"
167
#df_centroids_fname <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg6/mosaic/output_reg6_1984/df_centroids_19840101_reg6_1984.txt"
168 168
#/nobackupp6/aguzman4/climateLayers/out/reg1/assessment//output_reg1_1984/df_assessment_files_reg1_1984_reg1_1984.txt
169 169

  
170 170
#dates to plot and analyze
......
233 233
function_product_assessment_part2_functions <- "global_product_assessment_part2_functions_10192016b.R"
234 234
source(file.path(script_path,function_product_assessment_part2_functions)) #source all functions used in this script 
235 235

  
236
#Using default values for parameters
237
debug(check_missing)
236
#Using default values for parameters exectpt for num_cores=11 instead of 1
237
#debug(check_missing)
238 238
test_missing <- check_missing(lf=lf_raster, 
239 239
                              pattern_str=NULL,
240
                              in_dir=".",
240
                              in_dir=".", #this is not used if lf is given
241 241
                              date_start="1984101",
242 242
                              date_end="20141231",
243 243
                              item_no=13,
244 244
                              out_suffix="",
245
                              num_cores=1,
245
                              num_cores=num_cores,
246 246
                              out_dir=".")
247 247
  
248 248
##Run this on reg4 and reg5 after
249
#Add report by year in text file?
249 250
#Using specified values for parameters
250 251
test_missing <- check_missing(lf=lf_raster, 
251 252
                              pattern_str=NULL,
252
                              in_dir=".",
253
                              in_dir=in_dir_mosaic,
253 254
                              date_start="1984101",
254 255
                              date_end="20141231",
255 256
                              item_no=13,
256
                              out_suffix="")
257
                              out_suffix=out_suffix,
258
                              num_cores=num_cores,
259
                              out_dir=".")
260

  
261
df_time_series <- test_missing$df_time_series
262
head(df_time_series)
263

  
264
table(df_time_series$missing)
265
table(df_time_series$year)
257 266

  
258 267
#############################
259 268
##### Creating animation based on prediction

Also available in: Unified diff