-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.r
59 lines (51 loc) · 1.54 KB
/
main.r
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
################################################################
# Project: AWAP_GRIDS
# Author: ivanhanigan
# Maintainer: Who to complain to <ivan.hanigan@gmail.com>
# This is the main file for the project
# It should do very little except call the other files
####################
### Set the working directory
if(exists('workdir')){
workdir <- workdir
} else {
workdir <- "~/data/AWAP_GRIDS"
}
setwd(workdir)
####################
# Functions for the project
if (!require(ProjectTemplate)) install.packages('ProjectTemplate', repos='http://cran.csiro.au'); require(ProjectTemplate)
load.project()
####################
# user definitions, or setup interactively
destination_server <- "tern5.qern.qcif.edu.au"
source_server <- "115.146.92.162"
fresh <- FALSE
startdate <- '1980-01-01'
enddate <- '1980-02-01' #Sys.Date()-2
checkDates <- TRUE
interactively <- FALSE
variablenames <- 'maxave,minave,totals,vprph09,vprph15' #,solarave
aggregation_factor <- 3
if(length(grep('linux',sessionInfo()[[1]]$os)) == 1)
{
os <- 'linux'
} else {
os <- 'windows'
}
#os <- 'linux' # only linux and windoze supported
pgisutils <- "/usr/pgsql-9.1/bin/"
#"\"C:\\pgutils\\postgis-pg92-binaries-2.0.2w64\\bin\\"
pgutils <- "\"C:\\pgutils\\pgsql\\bin\\"
####################
# run the project (alternately do this from Kepler)
source(file.path(workdir, "src/scoping.r"))
if(fresh == TRUE)
{
source(file.path(workdir, "src/load.r"))
} else {
source(file.path(workdir, "src/load_mirrored_grids.r"))
}
# source("src/load.r")
# source("src/clean.r")
# source("src/do.r")