Project

General

Profile

« Previous | Next » 

Revision 3756c22e

Added by Benoit Parmentier over 9 years ago

introduce plot function to assess mosaicing

View differences:

climate/research/oregon/interpolation/global_run_scalingup_mosaicing_function.R
512 512
  return(mosaic_obj)
513 513
}
514 514

  
515
plot_mosaic <- function(i,list_param){
516
  #Plot for mosaic list assess via slope as well
517
  #Inputs:
518
  #
519
  
520
  method_str <- list_param$method[i]
521
  f_mosaic <- list_param$lf_mosaic[i]
522
  out_suffix_str <- list_param$out_suffix[i]
523
  
524
  r_mosaic <- raster(f_mosaic)
525

  
526
  r_mosaic_terrain <- terrain(r_mosaic,opt=c("slope","aspect"),unit="degrees")
527

  
528
  res_pix <- 1200
529
  col_mfrow <- 1 
530
  row_mfrow <- 0.8
531
  
532
  out_file1 <- paste("Figure2_mosaic_mean_",method_str,"_",out_suffix_str,".png",sep="")
533
  png(filename= out_file1,
534
    width=col_mfrow*res_pix,height=row_mfrow*res_pix)
535

  
536
  plot(r_mosaic,main=paste("mosaic mean ",method_str,sep=""))
537

  
538
  dev.off()
539
  
540
  #### plot terrain to emphasize possible edges..
541
  res_pix <- 1200
542
  col_mfrow <- 1 
543
  row_mfrow <- 0.8
544

  
545
  out_file2 <- paste("Figure2_slope_mean_",method_str,"_",out_suffix_str,".png",sep="")
546
  png(filename= out_file2,
547
    width=col_mfrow*res_pix,height=row_mfrow*res_pix)
548

  
549
  plot(r_mosaic_terrain,y=1,main=paste("slope mosaic mean ",method_str,sep=""))
550

  
551
  dev.off()
552

  
553
  out_file3 <- paste("Figure2_aspect_mean_",method_str,"_",out_suffix_str,".png",sep="")
554
  png(filename= out_file3,
555
    width=col_mfrow*res_pix,height=row_mfrow*res_pix)
556

  
557
  plot(r_mosaic_terrain,y=2,main=paste("aspect mean ",method_str,sep=""))
558

  
559
  dev.off()
560
  
561
  l_out_files <- list(out_file1,out_file2,out_file3)
562
  return(l_out_files)
563
}
515 564

  
516 565
##################### END OF SCRIPT ######################
517 566

  

Also available in: Unified diff