Project

General

Profile

« Previous | Next » 

Revision f4973dbe

Added by Benoit Parmentier over 8 years ago

saving figures for temporal time series profiles from raster stack for NASA conference

View differences:

climate/research/oregon/interpolation/NASA2016_conference_temperature_predictions.R
277 277
min(d_z_tmp$ID_8)
278 278
max(d_z_tmp$ID_8)
279 279

  
280
plot(d_z_tmp)
280
plot(d_z_tmp) #this is the whole time series
281 281

  
282 282
day_start <- "1986-01-01" #PARAM 12 arg 12
283 283
day_end <- "1998-12-31" #PARAM 13 arg 13
......
290 290
d_z <- window(d_z_tmp,start=start_date,end=end_date)
291 291
#d_z2 <- window(d_z_tmp2,start=start_date,end=end_date)
292 292

  
293
res_pix <- 1000
294
#res_pix <- 480
295
col_mfrow <- 2
296
row_mfrow <- 1
297
  
298
png_filename <-  file.path(out_dir,paste("Figure5a_time_series_profile_",region_name,"_",out_suffix,".png",sep =""))
293 299
title_str <- paste("Predicted daily ",variable_name," for the ", start_year,"-",end_year," time period",sep="")
294
plot(d_z,ylab="tmax in deg C",xlab="daily time steps",
295
     main=title_str,
300
  
301
png(filename=png_filename,width = col_mfrow * res_pix,height = row_mfrow * res_pix)
302

  
303
plot(d_z,ylab="tmax in deg C",xlab="Daily time steps",
304
     main=title_str,cex=3,font=2,
305
     cex.main=1.5,cex.lab=1.5,font.lab=2,
306
     lty=3)
307

  
308
dev.off()
309

  
310
#### Subset for 5b
311

  
312
day_start <- "1991-01-01" #PARAM 12 arg 12
313
day_end <- "1992-12-31" #PARAM 13 arg 13
314

  
315
start_date <- as.Date(day_start)
316
end_date <- as.Date(day_end)
317
start_year <- year(start_date)
318
end_year <- year(end_date)
319
d_z <- window(d_z_tmp,start=start_date,end=end_date)
320
#d_z2 <- window(d_z_tmp2,start=start_date,end=end_date)
321

  
322
res_pix <- 1000
323
#res_pix <- 480
324
col_mfrow <- 2
325
row_mfrow <- 1
326
  
327
png_filename <-  file.path(out_dir,paste("Figure5b_subset_time_series_profile_",region_name,"_",out_suffix,".png",sep =""))
328
title_str <- paste("Predicted daily ",variable_name," for the ", start_year,"-",end_year," time period",sep="")
329
  
330
png(filename=png_filename,width = col_mfrow * res_pix,height = row_mfrow * res_pix)
331

  
332
plot(d_z,ylab="tmax in deg C",xlab="Daily time steps",
333
     main=title_str,cex=3,font=2,
334
     cex.main=1.5,cex.lab=1.5,font.lab=2,
296 335
     lty=3)
297 336

  
337
dev.off()
298 338

  
299 339
#data_pixel <- data_df[id_selected,]
300 340
#data_pixel$rainfall <- as.numeric(data_pixel$rainfall)

Also available in: Unified diff