Revision f4b194a6
Added by Benoit Parmentier over 11 years ago
climate/research/oregon/interpolation/master_script_temp.R | ||
---|---|---|
10 | 10 |
#STAGE 5: Output analyses: assessment of results for specific dates... |
11 | 11 |
# |
12 | 12 |
#AUTHOR: Benoit Parmentier |
13 |
#DATE: 07/06/2013
|
|
13 |
#DATE: 07/09/2013
|
|
14 | 14 |
|
15 | 15 |
#PROJECT: NCEAS INPLANT: Environment and Organisms --TASK#363, TASK$568-- |
16 | 16 |
|
... | ... | |
46 | 46 |
|
47 | 47 |
##SCRIPT USED FOR THE PREDICTIONS: Source or list all scripts here to avoid confusion on versions being run!!!! |
48 | 48 |
|
49 |
#source(file.path(script_path,"master_script_temp_06272013.R")) #Master script can be run directly...
|
|
49 |
#source(file.path(script_path,"master_script_temp_07092013.R")) #Master script can be run directly...
|
|
50 | 50 |
|
51 | 51 |
#CALLED FROM MASTER SCRIPT: |
52 | 52 |
|
... | ... | |
71 | 71 |
stages_to_run<-c(0,2,3,4,5) #May decide on antoher strategy later on... |
72 | 72 |
|
73 | 73 |
var<-"TMAX" # variable being interpolated |
74 |
out_prefix<-"_365d_gam_day_lst_comb1_07062013" #User defined output prefix
|
|
75 |
out_suffix<-"_OR_07062013"
|
|
74 |
out_prefix<-"_365d_gam_day_lst_comb3_07092013" #User defined output prefix
|
|
75 |
out_suffix<-"_OR_07092013"
|
|
76 | 76 |
out_suffix_modis <-"_05302013" #use tiles produce previously |
77 | 77 |
|
78 | 78 |
#interpolation_method<-c("gam_fusion","gam_CAI","gam_daily") #other otpions to be added later |
... | ... | |
126 | 126 |
out_region_name<-"_oregon_region" #generated on the fly |
127 | 127 |
|
128 | 128 |
#The names of covariates can be changed...these names should be output/input from covar script!!! |
129 |
rnames<-c("x","y","lon","lat","N","E","N_w","E_w","elev_s","slope","aspect","CANHEIGHT","DISTOC")
|
|
129 |
rnames<-c("x","y","lon","lat","N","E","N_w","E_w","elev_s","slope","aspect","CANHGHT","DISTOC") |
|
130 | 130 |
lc_names<-c("LC1","LC2","LC3","LC4","LC5","LC6","LC7","LC8","LC9","LC10","LC11","LC12") |
131 | 131 |
#lc_names<-c("LC1","LC2","LC3","LC4","LC5","LC6","LC7","LC8","LC9","LC10") #use older version for continuity check to be changed |
132 | 132 |
lst_names<-c("mm_01","mm_02","mm_03","mm_04","mm_05","mm_06","mm_07","mm_08","mm_09","mm_10","mm_11","mm_12", |
... | ... | |
135 | 135 |
covar_names<-c(rnames,lc_names,lst_names) |
136 | 136 |
|
137 | 137 |
list_val_range <-c("lon,-180,180","lat,-90,90","N,-1,1","E,-1,1","N_w,-1,1","E_w,-1,1","elev_s,0,6000","slope,0,90", |
138 |
"aspect,0,360","DISTOC,-0,10000000","CANHEIGHT,0,255","LC2,0,100","LC6,0,100","mm_01,-15,50",
|
|
138 |
"aspect,0,360","DISTOC,-0,10000000","CANHGHT,0,255","LC1,0,100","LC5,0,100","mm_01,-15,50",
|
|
139 | 139 |
"mm_02,-15,50","mm_03,-15,50","mm_04,-15,50","mm_05,-15,50","mm_06,-15,50","mm_07,-15,50", |
140 | 140 |
"mm_08,-15,50","mm_09,-15,50","mm_10,-15,50","mm_11,-15,50","mm_12,-15,50") |
141 | 141 |
|
... | ... | |
234 | 234 |
prop_minmax<-c(0.3,0.3) #if prop_min=prop_max and step=0 then predicitons are done for the number of dates... |
235 | 235 |
#dates_selected<-c("20100101","20100102","20100103","20100901") # Note that the dates set must have a specific format: yyymmdd |
236 | 236 |
dates_selected<-"" # if empty string then predict for the full year specified earlier |
237 |
screen_data_training<-TRUE
|
|
237 |
screen_data_training<-FALSE
|
|
238 | 238 |
|
239 | 239 |
#Models to run...this can be change for each run |
240 |
|
|
241 |
#Combination 1 |
|
242 |
list_models<-c("y_var ~ s(elev_s)", |
|
243 |
"y_var ~ s(LST)", |
|
244 |
"y_var ~ s(elev_s,LST)", |
|
245 |
"y_var ~ s(lat) + s(lon)+ s(elev_s)", |
|
246 |
"y_var ~ s(lat,lon,elev_s)", |
|
247 |
"y_var ~ s(lat,lon) + s(elev_s) + s(N_w,E_w) + s(LST)", |
|
248 |
"y_var ~ s(lat,lon) + s(elev_s) + s(N_w,E_w) + s(LST) + s(LC6)", |
|
249 |
"y_var ~ s(lat,lon) + s(elev_s) + s(N_w,E_w) + s(LST) + ti(LC6,LST)", |
|
250 |
"y_var ~ s(lat,lon) + s(elev_s) + s(N_w,E_w) + s(LST) + s(DISTOC)") |
|
240 |
#LC1: Evergreen/deciduous needleleaf trees |
|
241 |
#Combination 3: for paper baseline=s(lat,lon)+s(elev) |
|
242 |
list_models<-c("y_var ~ s(lat,lon) + s(elev_s)", |
|
243 |
"y_var ~ s(lat,lon) + s(elev_s) + s(N_w)", |
|
244 |
"y_var ~ s(lat,lon) + s(elev_s) + s(E_w)", |
|
245 |
"y_var ~ s(lat,lon) + s(elev_s) + s(LST)", |
|
246 |
"y_var ~ s(lat,lon) + s(elev_s) + s(DISTOC)", |
|
247 |
"y_var ~ s(lat,lon) + s(elev_s) + s(LC1)", |
|
248 |
"y_var ~ s(lat,lon) + s(elev_s) + s(CANHGHT)", |
|
249 |
"y_var ~ s(lat,lon) + s(elev_s) + s(LST) + ti(LST,LC1)", |
|
250 |
"y_var ~ s(lat,lon) + s(elev_s) + s(LST) + ti(LST,CANHGHT)") |
|
251 |
|
|
252 |
# list_models<-c("y_var ~ s(elev_s)", |
|
253 |
# "y_var ~ s(LST)", |
|
254 |
# "y_var ~ s(elev_s,LST)", |
|
255 |
# "y_var ~ s(lat) + s(lon)+ s(elev_s)", |
|
256 |
# "y_var ~ s(lat,lon,elev_s)", |
|
257 |
# "y_var ~ s(lat,lon) + s(elev_s) + s(N_w,E_w) + s(LST)", |
|
258 |
# "y_var ~ s(lat,lon) + s(elev_s) + s(N_w,E_w) + s(LST) + s(LC6)", |
|
259 |
# "y_var ~ s(lat,lon) + s(elev_s) + s(N_w,E_w) + s(LST) + ti(LC6,LST)", |
|
260 |
# "y_var ~ s(lat,lon) + s(elev_s) + s(N_w,E_w) + s(LST) + s(DISTOC)") |
|
251 | 261 |
|
252 | 262 |
#testing new combinations and tensor for paper |
253 | 263 |
# list_models<-c("y_var ~ s(x,y)", |
... | ... | |
303 | 313 |
############### END OF SCRIPT ################### |
304 | 314 |
##################################################### |
305 | 315 |
|
316 |
# #LAND COVER INFORMATION |
|
317 |
# LC1: Evergreen/deciduous needleleaf trees |
|
318 |
# LC2: Evergreen broadleaf trees |
|
319 |
# LC3: Deciduous broadleaf trees |
|
320 |
# LC4: Mixed/other trees |
|
321 |
# LC5: Shrubs |
|
322 |
# LC6: Herbaceous vegetation |
|
323 |
# LC7: Cultivated and managed vegetation |
|
324 |
# LC8: Regularly flooded shrub/herbaceous vegetation |
|
325 |
# LC9: Urban/built-up |
|
326 |
# LC10: Snow/ice |
|
327 |
# LC11: Barren lands/sparse vegetation |
|
328 |
# LC12: Open water |
|
329 |
|
Also available in: Unified diff
gam day predictions for paper testing covariates combination 3