Revision 4155cd78
Added by Benoit Parmentier about 8 years ago
climate/research/oregon/interpolation/global_product_assessment_part2.R | ||
---|---|---|
119 | 119 |
CRS_interp <- "+proj=longlat +ellps=WGS84 +datum=WGS84 +towgs84=0,0,0" #param 3 |
120 | 120 |
#CRS_interp <-"+proj=lcc +lat_1=43 +lat_2=45.5 +lat_0=41.75 +lon_0=-120.5 +x_0=400000 +y_0=0 +ellps=GRS80 +units=m +no_defs"; |
121 | 121 |
|
122 |
out_region_name<-"" |
|
123 |
list_models<-c("y_var ~ s(lat,lon,k=5) + s(elev_s,k=3) + s(LST,k=3)") #param 4 |
|
122 |
#out_region_name<-"" |
|
123 |
#list_models<-c("y_var ~ s(lat,lon,k=5) + s(elev_s,k=3) + s(LST,k=3)") #param 4 |
|
124 |
metric_name <- "var_pred" #use RMSE if accuracy |
|
124 | 125 |
|
125 | 126 |
#reg1 (North Am), reg2(Europe),reg3(Asia), reg4 (South Am), reg5 (Africa), reg6 (Australia-Asia) |
126 | 127 |
#master directory containing the definition of tile size and tiles predicted |
127 | 128 |
#in_dir <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg5/assessment" |
128 | 129 |
#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/reg4/assessment"
|
|
130 |
#in_dir_mosaic <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg6/mosaics/mosaic" #predicted mosaic
|
|
130 |
in_dir <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg6/assessment"
|
|
131 |
in_dir_mosaic <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg6/mosaics/mosaic" #predicted mosaic |
|
131 | 132 |
#in_dir_mosaic <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg1/mosaics/mosaic" |
132 | 133 |
#in_dir_mosaic <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg5/mosaics/mosaic" |
133 |
in_dir_mosaic <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg4/mosaic/mosaic" #note dropped the s in mosaics |
|
134 |
#in_dir_mosaic <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg4/mosaic/mosaic" #note dropped the s in mosaics
|
|
134 | 135 |
|
135 |
region_name <- c("reg4") #param 6, arg 3
|
|
136 |
out_suffix <- "global_assessment_reg4_10232016"
|
|
136 |
region_name <- c("reg6") #param 6, arg 3
|
|
137 |
out_suffix <- "global_assessment_reg6_10232016"
|
|
137 | 138 |
|
138 | 139 |
create_out_dir_param <- TRUE #param 9, arg 6 |
139 | 140 |
|
140 | 141 |
|
141 |
out_dir <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg4/assessment"
|
|
142 |
out_dir <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg6/assessment"
|
|
142 | 143 |
|
143 | 144 |
#run_figure_by_year <- TRUE # param 10, arg 7 |
144 | 145 |
|
... | ... | |
158 | 159 |
|
159 | 160 |
#infile_mask <- "/nobackupp8/bparmen1/NEX_data/regions_input_files/r_mask_LST_reg4.tif" |
160 | 161 |
#infile_mask <- "/data/project/layers/commons/NEX_data/regions_input_files/r_mask_LST_reg5.tif" |
161 |
infile_mask <- "/data/project/layers/commons/NEX_data/regions_input_files/r_mask_LST_reg4.tif" |
|
162 |
#infile_mask <- "/data/project/layers/commons/NEX_data/regions_input_files/r_mask_LST_reg4.tif" |
|
163 |
#infile_mask <- "/data/project/layers/commons/NEX_data/regions_input_files/r_mask_LST_reg6.tif" |
|
162 | 164 |
|
163 | 165 |
#run_figure_by_year <- TRUE # param 10, arg 7 |
164 |
list_year_predicted <- "1984,2014" |
|
166 |
#list_year_predicted <- "1984,2014"
|
|
165 | 167 |
scaling <- 0.01 #was scaled on 100 |
166 | 168 |
#if scaling is null then perform no scaling!! |
167 | 169 |
|
168 | 170 |
#df_centroids_fname <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg5/mosaic/output_reg5_1999/df_centroids_19990701_reg5_1999.txt" |
169 |
df_centroids_fname <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg4/mosaic/output_reg4_1999/df_centroids_19990701_reg4_1999.txt" |
|
171 |
#df_centroids_fname <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg4/mosaic/output_reg4_1999/df_centroids_19990701_reg4_1999.txt"
|
|
170 | 172 |
#df_centroids_fname <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg6/mosaic/output_reg6_1984/df_centroids_19840101_reg6_1984.txt" |
171 | 173 |
#/nobackupp6/aguzman4/climateLayers/out/reg1/assessment//output_reg1_1984/df_assessment_files_reg1_1984_reg1_1984.txt |
172 | 174 |
|
... | ... | |
175 | 177 |
#l_dates <- c("19990101","19990102","19990103","19990701","19990702","19990703") |
176 | 178 |
#l_dates <- c("19990101","19990102","19990103","19990104","19990105") |
177 | 179 |
#df_points_extracted_fname <- "/data/project/layers/commons/NEX_data/climateLayers/out/reg5/mosaic/int_mosaics/data_points_extracted.txt" |
178 |
df_points_extracted_fname <- NULL #if null extract on the fly |
|
180 |
#df_points_extracted_fname <- NULL #if null extract on the fly
|
|
179 | 181 |
#r_mosaic_fname <- "r_mosaic.RData" |
180 |
r_mosaic_fname <- NULL #if null create a stack from input dir |
|
182 |
#r_mosaic_fname <- NULL #if null create a stack from input dir
|
|
181 | 183 |
|
182 | 184 |
#NA_flag_val_mosaic <- -3399999901438340239948148078125514752.000 |
183 | 185 |
NA_flag_val_mosaic <- -32768 |
... | ... | |
269 | 271 |
|
270 | 272 |
#debug(plot_and_animate_raster_time_series) |
271 | 273 |
|
272 |
metric_name <- "var_pred" #use RMSE if accuracy |
|
274 |
#metric_name <- "var_pred" #use RMSE if accuracy
|
|
273 | 275 |
#df_raster <- read.table("df_raster_global_assessment_reg6_10102016.txt",sep=",",header=T) |
274 | 276 |
#plot_figure <- |
275 | 277 |
#function_product_assessment_part2_functions <- "global_product_assessment_part2_functions_10222016.R" |
... | ... | |
319 | 321 |
out_suffix=out_suffix_str, |
320 | 322 |
out_dir=out_dir) |
321 | 323 |
|
324 |
#ffmpeg -i yeay.gif outyeay.mp4 |
|
325 |
|
|
326 |
#/Applications/ffmpeg -r 25 -i input%3d.png -vcodec libx264 -x264opts keyint=25 -pix_fmt yuv420p -r 25 ../output.mp4 |
|
327 |
|
|
328 |
#ffmpeg -f gif -i file.gif -c:v libx264 outfile.mp4 |
|
329 |
|
|
330 |
#ffmpeg -i animation_frame_60_-2500_6000_.gif animation_frame_60_-2500_6000_.mp4 |
|
331 |
|
|
332 |
#ffmpeg -i animation_frame_60_-2500_6000_.gif animation_frame_60_-2500_6000_.mp4 |
|
333 |
|
|
334 |
#ffmpeg -f gif -i animation_frame_60_-2500_6000_.gif -vcodec libx264 -x264opts keyint=25 -pix_fmt yuv420p -r 25 outfile.mp4 |
|
335 |
#ffmpeg -f gif -i animation_frame_60_-2500_6000_.gif -vcodec libx264 -x264opts keyint=11 -pix_fmt yuv420p -r 11 outfile.mp4 |
|
336 |
|
|
337 |
#ffmpeg -r 10 -i animation_frame_60_-2500_6000_.gif animation.avi |
|
338 |
|
|
339 |
#ffmpeg -f gif -i animation_frame_60_-2500_6000_.gif -vcodec libx264 -x264opts -pix_fmt yuv420p outfile.mp4 |
|
340 |
|
|
341 |
|
|
322 | 342 |
|
323 | 343 |
############################ END OF SCRIPT ################################## |
Also available in: Unified diff
experimenting with ffmpeg to generate movie from gif