Project

General

Profile

« Previous | Next » 

Revision 711d0229

Added by Benoit Parmentier over 9 years ago

adding figures with difference for all methods

View differences:

climate/research/oregon/interpolation/global_run_scalingup_mosaicing.R
433 433
list_edge_r_weights <- lapply(1:length(use_edge_weights_obj_list), FUN=function(i,x){x[[i]]$r_weights},x=use_edge_weights_obj_list)
434 434
list_edge_r_weights_prod <- lapply(1:length(use_edge_weights_obj_list), FUN=function(i,x){x[[i]]$r_weights_prod},x=use_edge_weights_obj_list)
435 435

  
436
#r_test <- raster(list_edge_r_weights[[1]])
437

  
436 438
### Third use sine weights
437 439
method <- "use_sine_weights"
438 440
#df_points <- df_centroids
......
468 470

  
469 471
## Rasters tiles vary slightly in resolution, they need to be matched for the mosaic. Resolve issue in the 
470 472
#mosaic funciton using gdal_merge to compute a reference image to mach.
471
#outrastnames <- "reg1_mosaic_weights.tif"
472
#list_param_mosaic <- list(list_r_weights,out_dir,outrastnames,file_format,NA_flag_val,out_suffix)
473
#r1_projected <- projectRaster(raster(list_r_weights[[1]]),r)
474 473

  
475 474
cmd_str <- paste("python","/usr/bin/gdal_merge.py","-o avg.tif",paste(lf_mosaic,collapse=" ")) 
476 475
system(cmd_str)
......
481 480
r_ref <- raster(rast_ref)
482 481
plot(r_ref)
483 482

  
484
### First match weights from linear option
485
lf_files <- unlist(list_linear_r_weights)
486

  
487
list_param_raster_match <- list(lf_files,rast_ref,file_format,out_suffix,out_dir)
488
names(list_param_raster_match) <- c("lf_files","rast_ref","file_format","out_suffix","out_dir_str")
489

  
490
#debug(raster_match)
491
#r_test <- raster(raster_match(1,list_param_raster_match))
492

  
493
list_linear_weights_m <- mclapply(1:length(lf_files),FUN=raster_match,list_param=list_param_raster_match,mc.preschedule=FALSE,mc.cores = num_cores)                           
494

  
495
lf_files <- unlist(list_linear_r_weights_prod)
496
list_param_raster_match <- list(lf_files,rast_ref,file_format,out_suffix,out_dir)
497
names(list_param_raster_match) <- c("lf_files","rast_ref","file_format","out_suffix","out_dir_str")
498

  
499
num_cores <-11
500
list_linear_weights_prod_m <- mclapply(1:length(lf_files),FUN=raster_match,list_param=list_param_raster_match,mc.preschedule=FALSE,mc.cores = num_cores)                           
501

  
502
#### Second use use edge (dist) images
503

  
504
lf_files <- unlist(list_edge_r_weights)
505

  
506
list_param_raster_match <- list(lf_files,rast_ref,file_format,out_suffix,out_dir)
507
names(list_param_raster_match) <- c("lf_files","rast_ref","file_format","out_suffix","out_dir_str")
508

  
509
#debug(raster_match)
510
#r_test <- raster(raster_match(1,list_param_raster_match))
511

  
512
list_edge_weights_m <- mclapply(1:length(lf_files),FUN=raster_match,list_param=list_param_raster_match,mc.preschedule=FALSE,mc.cores = num_cores)                           
513

  
514
lf_files <- unlist(list_edge_r_weights_prod)
515
list_param_raster_match <- list(lf_files,rast_ref,file_format,out_suffix,out_dir)
516
names(list_param_raster_match) <- c("lf_files","rast_ref","file_format","out_suffix","out_dir_str")
517

  
518
num_cores <-11
519
list_edge_weights_prod_m <- mclapply(1:length(lf_files),FUN=raster_match,list_param=list_param_raster_match,mc.preschedule=FALSE,mc.cores = num_cores)                           
520

  
521

  
522
### third match wegihts from sine option
523

  
524
lf_files <- unlist(list_sine_r_weights)
525

  
526
list_param_raster_match <- list(lf_files,rast_ref,file_format,out_suffix,out_dir)
527
names(list_param_raster_match) <- c("lf_files","rast_ref","file_format","out_suffix","out_dir_str")
528

  
529
#debug(raster_match)
530
#r_test <- raster(raster_match(1,list_param_raster_match))
531

  
532
list_sine_weights_m <- mclapply(1:length(lf_files),FUN=raster_match,list_param=list_param_raster_match,mc.preschedule=FALSE,mc.cores = num_cores)                           
533

  
534
lf_files <- unlist(list_sine_r_weights_prod)
535
list_param_raster_match <- list(lf_files,rast_ref,file_format,out_suffix,out_dir)
536
names(list_param_raster_match) <- c("lf_files","rast_ref","file_format","out_suffix","out_dir_str")
537

  
538
num_cores <-11
539
list_sine_weights_prod_m <- mclapply(1:length(lf_files),FUN=raster_match,list_param=list_param_raster_match,mc.preschedule=FALSE,mc.cores = num_cores)                           
540

  
541 483
#### Fourth use original images
542 484
#macth file to mosaic extent using the original predictions
543 485
lf_files <- lf_mosaic
......
588 530

  
589 531
list_mosaiced_files <- list.files(pattern="r_m.*._weighted_mean_.*.tif")
590 532

  
591
#get the list of weights into raster objects
592
list_args_linear_weights <- list_linear_weights_m
593
#list_args_weights <- (mixedsort(list.files(pattern="r_weights_m_.*.tif")))
594
list_args_linear_weights <- lapply(1:length(list_args_linear_weights), FUN=function(i,x){raster(x[[i]])},x=list_args_linear_weights)
595

  
596
#get the list of weights product into raster objects
597
list_args_linear_weights_prod <- list_linear_weights_prod_m
598
#list_args_weights_prod <- (mixedsort(list.files(pattern="r_weights_prod_m_.*.tif")))
599
list_args_linear_weights_prod <- lapply(1:length(list_args_linear_weights_prod), FUN=function(i,x){raster(x[[i]])},x=list_args_linear_weights_prod)
600

  
601
###
602
#get the list of edge weights into raster objects
603
list_args_edge_weights <- list_linear_weights_m
604
#list_args_weights <- (mixedsort(list.files(pattern="r_weights_m_.*.tif")))
605
list_args_edge_weights <- lapply(1:length(list_args_edge_weights), FUN=function(i,x){raster(x[[i]])},x=list_args_linear_weights)
606

  
607
#get the list of weights product into raster objects
608
list_args_linear_weights_prod <- list_linear_weights_prod_m
609
#list_args_weights_prod <- (mixedsort(list.files(pattern="r_weights_prod_m_.*.tif")))
610
list_args_linear_weights_prod <- lapply(1:length(list_args_linear_weights_prod), FUN=function(i,x){raster(x[[i]])},x=list_args_linear_weights_prod)
611

  
612

  
613

  
614
#get the list of sine weights into raster objects
615
list_args_sine_weights <- list_sine_weights_m
616
#list_args_weights <- (mixedsort(list.files(pattern="r_weights_m_.*.tif")))
617
list_args_sine_weights <- lapply(1:length(list_args_sine_weights), FUN=function(i,x){raster(x[[i]])},x=list_args_sine_weights)
618

  
619
#get the list of weights product into raster objects
620
list_args_sine_weights_prod <- list_sine_weights_prod_m
621
#list_args_weights_prod <- (mixedsort(list.files(pattern="r_weights_prod_m_.*.tif")))
622
list_args_sine_weights_prod <- lapply(1:length(list_args_sine_weights_prod), FUN=function(i,x){raster(x[[i]])},x=list_args_sine_weights_prod)
533
names(list_mosaiced_files) <- c("edge","linear","sine")
534
  
535
#### NOW unweighted mean mosaic
623 536

  
624 537
#get the original predicted image to raster (matched previously to the mosaic extent)
625 538
list_args_pred_m <- list_pred_m
626 539
#list_args_pred_m <- (mixedsort(list.files(pattern="^gam_CAI.*.m_mosaic_run10_1500x4500_global_analyses_03252015.tif")))
627 540
list_args_pred_m <- lapply(1:length(list_args_pred_m), FUN=function(i,x){raster(x[[i]])},x=list_args_pred_m)
628 541

  
629
list_args_linear_weights$fun <- "sum" #we want the sum to compute the weighted mean
630
list_args_linear_weights$na.rm <- TRUE
631

  
632
list_args_linear_weights_prod$fun <- "sum"
633
list_args_linear_weights_prod$na.rm <- TRUE
634

  
635
list_args_sine_weights$fun <- "sum" #we want the sum to compute the weighted mean
636
list_args_sine_weights$na.rm <- TRUE
637

  
638
list_args_sine_weights_prod$fun <- "sum"
639
list_args_sine_weights_prod$na.rm <- TRUE
640

  
641 542
list_args_pred_m$fun <- "mean"
642 543
list_args_pred_m$na.rm <- TRUE
643 544

  
644 545
#Mosaic files
645
r_linear_weights_sum <- do.call(mosaic,list_args_linear_weights) #weights sum image mosaiced
646
r_linear_prod_sum <- do.call(mosaic,list_args_linear_weights_prod) #weights sum product image mosacied
647

  
648
r_m_linear_weighted_mean <- r_linear_prod_sum/r_linear_weights_sum #this is the mosaic using weighted mean...
649

  
650
r_sine_weights_sum <- do.call(mosaic,list_args_sine_weights) #weights sum image mosaiced
651
r_sine_prod_sum <- do.call(mosaic,list_args_sine_weights_prod) #weights sum product image mosacied
652

  
653
r_m_sine_weighted_mean <- r_sine_prod_sum/r_sine_weights_sum #this is the mosaic using weighted mean...
654

  
655
raster_name <- file.path(out_dir,paste("r_m_linear_weighted_mean_",out_suffix,".tif",sep=""))
656
writeRaster(r_m_linear_weighted_mean, NAflag=NA_flag_val,filename=raster_name,overwrite=TRUE)  
657

  
658
raster_name <- file.path(out_dir,paste("r_m_sine_weighted_mean_",out_suffix,".tif",sep=""))
659
writeRaster(r_m_sine_weighted_mean, NAflag=NA_flag_val,filename=raster_name,overwrite=TRUE)  
660

  
661 546
r_m_mean <- do.call(mosaic,list_args_pred_m) #this is unweighted mean from the predicted raster
662 547

  
663 548
raster_name <- file.path(out_dir,paste("r_m_mean_",out_suffix,".tif",sep=""))
664 549
writeRaster(r_m_mean, NAflag=NA_flag_val,filename=raster_name,overwrite=TRUE)  #unweighted mean
665 550

  
666
r_diff_weighted_mean <- r_m_linear_weighted_mean - r_m_sine_weighted_mean
667
#r_diff_weighted_mean<-r_diff_weighted_meam
668

  
669
r_diff_mean_linear <- r_m_mean - r_m_linear_weighted_mean 
670
r_diff_mean_sine <- r_m_mean - r_m_sine_weighted_mean 
671

  
672
r_m_mean_terrain <- terrain(r_m_mean,opt=c("slope","aspect"),unit="degrees")
673
r_m_sine_weighted_mean_terrain <- terrain(r_m_sine_weighted_mean,opt=c("slope","aspect"),unit="degrees")
674
r_m_linear_weighted_mean_terrain <- terrain(r_m_linear_weighted_mean,opt=c("slope","aspect"),unit="degrees")
551
r_m_mean_unweighted <- paste("r_m_mean_",out_suffix,".tif",sep="")
675 552

  
676 553
#####################
677 554
###### PART 5: Now plot of the weighted mean and unweighted mean with the mosaic function #####
678 555

  
679
res_pix <- 1200
680
col_mfrow <- 1 
681
row_mfrow <- 0.8
556
#### compute and aspect and slope with figures
682 557

  
683
png(filename=paste("Figure2_mean_for_region_",region_name,"_",out_suffix,".png",sep=""),
684
    width=col_mfrow*res_pix,height=row_mfrow*res_pix)
558
list_mosaiced_files2 <- c(list_mosaiced_files,r_m_mean_unweighted)
559
names(list_mosaiced_files2) <- c(names(list_mosaiced_files),"unweighted")
685 560

  
686
plot(r_m_mean)
561
for(k in 1:length(list_mosaiced_files)){
562
  
563
  method_str <- names(list_mosaiced_files)[k]
564
  r_mosaic <- raster(list_mosaiced_files[k])
687 565

  
688
dev.off()
566
  r_mosaic_terrain <- terrain(r_mosaic,opt=c("slope","aspect"),unit="degrees")
689 567

  
690
res_pix <- 1200
691
col_mfrow <- 1 
692
row_mfrow <- 0.8
568
  res_pix <- 1200
569
  col_mfrow <- 1 
570
  row_mfrow <- 0.8
693 571

  
694
png(filename=paste("Figure2_linear_weigthed_mean_for_region_",region_name,"_",out_suffix,".png",sep=""),
572
  png(filename=paste("Figure2_mosaic_mean_",method_str,region_name,"_",out_suffix,".png",sep=""),
695 573
    width=col_mfrow*res_pix,height=row_mfrow*res_pix)
696 574

  
697
plot(r_m_linear_weighted_mean )
575
  plot(r_mosaic,main=paste("mosaic mean ",method_str,sep=""))
698 576

  
699
dev.off()
700

  
701
res_pix <- 1200
702
col_mfrow <- 1 
703
row_mfrow <- 0.8
577
  dev.off()
578
  
579
  #### plot terrain to emphasize possible edges..
580
  res_pix <- 1200
581
  col_mfrow <- 1 
582
  row_mfrow <- 0.8
704 583

  
705
png(filename=paste("Figure2_sine_weigthed_mean_for_region_",region_name,"_",out_suffix,".png",sep=""),
584
  png(filename=paste("Figure2_slope_mean_",method_str,region_name,"_",out_suffix,".png",sep=""),
706 585
    width=col_mfrow*res_pix,height=row_mfrow*res_pix)
707 586

  
708
plot(r_m_sine_weighted_mean)
587
  plot(r_mosaic_terrain,y=1,main=paste("slope mosaic mean ",method_str,sep=""))
709 588

  
710
dev.off()
589
  dev.off()
711 590

  
712
res_pix <- 1200
713
col_mfrow <- 1 
714
row_mfrow <- 0.8
715

  
716
png(filename=paste("Figure2_diff_linear_sine_weigthed_mean_for_region_",region_name,"_",out_suffix,".png",sep=""),
591
  png(filename=paste("Figure2_aspect_mean_",method_str,region_name,"_",out_suffix,".png",sep=""),
717 592
    width=col_mfrow*res_pix,height=row_mfrow*res_pix)
718 593

  
719
plot(r_diff_weighted_mean)
594
  plot(r_mosaic_terrain,y=2,main=paste("aspect mean ",method_str,sep=""))
720 595

  
721
dev.off()
596
  dev.off()
597
}
598

  
599
####################
600
#### Now difference figures...
601
r_m_edge_weighted_mean <- raster(list_mosaiced_files2[1])#edge
602
r_m_linear_weighted_mean <- raster(list_mosaiced_files2[2])#linear
603
r_m_sine_weighted_mean <- raster(list_mosaiced_files2[3])#sine  
604
r_m_unweighted_mean <- raster(list_mosaiced_files2[4])#unweighted
605

  
606
r_diff_linear_sine_weighted_mean <- r_m_linear_weighted_mean - r_m_sine_weighted_mean
722 607

  
723 608
res_pix <- 1200
724 609
col_mfrow <- 1 
725 610
row_mfrow <- 0.8
726 611

  
727
png(filename=paste("Figure2_diff_mean_linear_for_region_",region_name,"_",out_suffix,".png",sep=""),
612
png(filename=paste("Figure2_diff_linear_sine_weigthed_mean_for_region_",region_name,"_",out_suffix,".png",sep=""),
728 613
    width=col_mfrow*res_pix,height=row_mfrow*res_pix)
729 614

  
730
plot(r_diff_mean_linear)
615
plot(r_diff_linear_sine_weighted_mean)
731 616

  
732 617
dev.off()
733 618

  
734
res_pix <- 1200
735
col_mfrow <- 1 
736
row_mfrow <- 0.8
619
r_diff_linear_edge_weighted_mean <- r_m_linear_weighted_mean - r_m_edge_weighted_mean
737 620

  
738
png(filename=paste("Figure2_diff_mean_sine_for_region_",region_name,"_",out_suffix,".png",sep=""),
621
png(filename=paste("Figure2_diff_linear_edge_weigthed_mean_for_region_",region_name,"_",out_suffix,".png",sep=""),
739 622
    width=col_mfrow*res_pix,height=row_mfrow*res_pix)
740 623

  
741
plot(r_diff_mean_sine)
624
plot(r_diff_linear_edge_weighted_mean)
742 625

  
743 626
dev.off()
744 627

  
745 628

  
746
#### plot terrain to emphasize possible edges..
747
res_pix <- 1200
748
col_mfrow <- 1 
749
row_mfrow <- 0.8
629
#r_diff_linear_edge_weighted_mean <- r_m_linear_weighted_mean - r_m_edge_weighted_mean
630
r_diff_edge_sine_weighted_mean <- r_m_edge_weighted_mean - r_m_sine_weighted_mean
750 631

  
751
png(filename=paste("Figure2_slope_mean_linear_for_region_",region_name,"_",out_suffix,".png",sep=""),
632
png(filename=paste("Figure2_diff_edge_sine_weigthed_mean_for_region_",region_name,"_",out_suffix,".png",sep=""),
752 633
    width=col_mfrow*res_pix,height=row_mfrow*res_pix)
753 634

  
754
plot(r_m_linear_weighted_mean_terrain,y=1)
635
plot(r_diff_edge_sine_weighted_mean)
755 636

  
756 637
dev.off()
757 638

  
758
png(filename=paste("Figure2_aspect_mean_linear_for_region_",region_name,"_",out_suffix,".png",sep=""),
759
    width=col_mfrow*res_pix,height=row_mfrow*res_pix)
760

  
761
plot(r_m_linear_weighted_mean_terrain,y=2)
639
###############
640
##### Now compare to unweighted values
762 641

  
763
dev.off()
642
r_diff_unweighted_linear_weighted_mean <- r_m_mean - r_m_linear_weighted_mean 
643
r_diff_unweighted_sine_weighted_mean <- r_m_mean - r_m_sine_weighted_mean 
644
r_diff_unweighted_edge_weighted_mean <- r_m_mean - r_m_edge_weighted_mean 
764 645

  
765
png(filename=paste("Figure2_slope_mean_sine_for_region_",region_name,"_",out_suffix,".png",sep=""),
646
png(filename=paste("Figure2_diff_unweighted_edge_weigthed_mean_for_region_",region_name,"_",out_suffix,".png",sep=""),
766 647
    width=col_mfrow*res_pix,height=row_mfrow*res_pix)
767 648

  
768
plot(r_m_sine_weighted_mean_terrain,y=1)
649
plot(r_diff_unweighted_edge_weighted_mean)
769 650

  
770 651
dev.off()
771 652

  
772
png(filename=paste("Figure2_aspect_mean_sine_for_region_",region_name,"_",out_suffix,".png",sep=""),
653
png(filename=paste("Figure2_diff_unweighted_linear_weighted_mean_for_region_",region_name,"_",out_suffix,".png",sep=""),
773 654
    width=col_mfrow*res_pix,height=row_mfrow*res_pix)
774 655

  
775
plot(r_m_sine_weighted_mean_terrain,y=2)
656
plot(r_diff_unweighted_linear_weighted_mean)
776 657

  
777 658
dev.off()
778 659

  
779
png(filename=paste("Figure2_slope_mean_for_region_",region_name,"_",out_suffix,".png",sep=""),
660
png(filename=paste("Figure2_diff_unweighted_sine_weigthed_mean_for_region_",region_name,"_",out_suffix,".png",sep=""),
780 661
    width=col_mfrow*res_pix,height=row_mfrow*res_pix)
781 662

  
782
plot(r_m_mean_terrain,y=1)
663
plot(r_diff_unweighted_sine_weighted_mean)
783 664

  
784 665
dev.off()
785 666

  
786
png(filename=paste("Figure2_aspect_mean_for_region_",region_name,"_",out_suffix,".png",sep=""),
787
    width=col_mfrow*res_pix,height=row_mfrow*res_pix)
788

  
789
plot(r_m_mean_terrain,y=2)
790 667

  
791
dev.off()
792 668

  
793 669
##################### END OF SCRIPT ######################
794 670

  
795
#################################################
796
#Ok testing on fake data to experiment and check methods:
797

  
798
##Quick function to generate test dataset
799
# make_raster_from_lf <- function(i,list_lf,r_ref){
800
#   vect_val <- list_lf[[i]]
801
#   r <-  r_ref
802
#   values(r) <-vect_val
803
#   #writeRaster...
804
#   return(r)
805
# }
806
# 
807
# vect_pred1 <- c(9,4,1,3,5,9,9,9,2)
808
# vect_pred2 <- c(10,3,1,2,4,8,7,8,2)
809
# vect_pred3 <- c(10,NA,NA,3,5,9,8,9,2)
810
# vect_pred4 <- c(9,3,2,NA,5,8,9,9,2)
811
# lf_vect_pred <- list(vect_pred1,vect_pred2,vect_pred3,vect_pred4)
812
# 
813
# vect_w1 <- c(0.2,0.5,0.1,0.3,0.4,0.5,0.5,0.3,0.2)
814
# vect_w2 <- c(0.3,0.4,0.1,0.3,0.4,0.5,0.7,0.1,0.2)
815
# vect_w3 <- c(0.5,0.3,0.2,0.2,0.3,0.6,0.7,0.3,0.2)
816
# vect_w4 <- c(0.2,0.5,0.3,0.3,0.4,0.5,0.5,0.2,0.2)
817
# lf_vect_w <- list(vect_w1,vect_w2,vect_w3,vect_w4)
818
# df_vect_w <-do.call(cbind,lf_vect_w)
819
# df_vect_pred <-do.call(cbind,lf_vect_pred)
820
# 
821
# tr_ref <- raster(nrows=3,ncols=3)
822
# 
823
# r_pred_l <- lapply(1:length(lf_vect_pred),FUN=make_raster_from_lf,list_lf=lf_vect_pred,r_ref=r_ref)
824
# r_w_l <- lapply(1:length(lf_vect_w),FUN=make_raster_from_lf,list_lf=lf_vect_w,r_ref=r_ref)
825
# 
826
# #r_w1<- make_raster_from_lf(2,list_lf=lf_vect_w,r_ref)
827
# 
828
# list_args_pred <- r_pred_l
829
# list_args_pred$fun <- "sum"
830
# 
831
# list_args_w <- r_w_l
832
# list_args_w$fun <- prod
833
# 
834
# r_test_val <-do.call(overlay,list_args) #sum
835
# r_test_w <-do.call(overlay,list_args_w) #prod
836
# 
837
# #need to do sumprod
838
# r1<- r_w_l[[1]]*r_pred_l[[1]]
839
# r2<- r_w_l[[2]]*r_pred_l[[2]]
840
# r3<- r_w_l[[3]]*r_pred_l[[3]]
841
# r4<- r_w_l[[4]]*r_pred_l[[4]]
842
# 
843
# r_pred <- stack(r_pred_l)
844
# r_w <- stack(r_w_l)
845
# 
846
# list_args_pred <- r_pred_l
847
# list_args_pred$fun <- mean
848
# list_args_pred$na.rm <- TRUE
849
# #r_sum_pred <-do.call(overlay,list_args_pred) #prod
850
# 
851
# #r_sum_pred <-do.call(mean,list_args_pred) #prod
852
# r_sum_pred <-do.call(mosaic,list_args_pred) #prod
853
# 
854
# list_args_pred$na.rm <- FALSE
855
# r_sum_pred <-do.call(overlay,list_args_pred) #prod
856
# 
857
# r_sum_pred <-do.call(overlay,list_args_w) #prod
858
# 
859
# list_args_w$fun <- sum
860
# r_sum_w <-do.call(overlay,list_args_w) #prod
861
# 
862
# r_m_w <- ((r1+r2+r3+r4)/(r_sum_w)) #mean weiated
863
#n33e to check the result!! especially the nubmer of valid pix val
864

  
865
#r_test_val <-do.call(overlay,list_args) #sum
866

  
867
#can do mosaic with sum?? for both weighted sum and val
868
#
869
#can use gdal calc...
870

  
871
#r_m <- r1 + r2
872
#name_method <- paste(interpolation_method,"_",y_var_name,"_",sep="")
873
##Use python code written by Alberto Guzman
874

  
875
#system("MODULEPATH=$MODULEPATH:/nex/modules/files")
876
#system("module load /nex/modules/files/pythonkits/gdal_1.10.0_python_2.7.3_nex")
877
#lf1 <- lf_world_pred_1000x3000
878
#lf2 <- lf_world_pred_1500x4500
879

  
880
#module_path <- ""
881
#module_path <- "/nobackupp6/aguzman4/climateLayers/sharedCode/"
882
#sh /nobackupp6/aguzman4/climateLayers/sharedCode/gdalCalDiff.sh file1.tif file2.tif output.tif
883
#/nobackupp6/aguzman4/climateLayers/sharedCode/mosaicUsingGdalMerge.py
884
#l_dates <- paste(day_to_mosaic,collapse=",",sep=" ")
885
#l_dates <- paste(day_to_mosaic,collapse=",")
886
## use region 2 first
887
#lf_out <- paste("diff_world_","1000_3000","by1500_4500_","mod1","_",l_dates,out_suffix,"_",file_format,sep="")
888

  
889

  
890
#for (i in 1:length(lf_out)){
891
#  out_file <- lf_out[i]
892
#  in_file1 <- lf1[i]
893
#  in_file2 <- lf2[i]
894
#    
895
#  cmd_str <- paste("sh", file.path(module_path,"gdalCalDiff.sh"),
896
#                 in_file1,
897
#                 in_file2,
898
#                 out_file,sep=" ")
899
#  system(cmd_str)
900
#
901
#}

Also available in: Unified diff