Revision f3e5567c
Added by Benoit Parmentier over 11 years ago
climate/research/oregon/interpolation/download_and_produce_MODIS_LST_climatology.R | ||
---|---|---|
53 | 53 |
#j to be used later...parallelization?? |
54 | 54 |
|
55 | 55 |
#Additional parameters |
56 |
#list_tiles_modis <- unlist(strsplit(list_tiles_modis,",")) # transform string into separate element in char vector |
|
57 |
#list_tiles_modis <- list_tiles_modis[j] |
|
56 | 58 |
end_month= "12" |
57 | 59 |
start_month= "1" |
58 | 60 |
|
... | ... | |
65 | 67 |
|
66 | 68 |
### CALCULATE NIGHT OR DAY CLIMATOLOGY? |
67 | 69 |
|
70 |
|
|
68 | 71 |
if (var=="TMIN") { |
69 | 72 |
night="1" # if 1 then produce night climatology |
70 | 73 |
} else{ |
... | ... | |
75 | 78 |
|
76 | 79 |
list_param_python_script <- list(list_tiles_modis,start_year,end_year,start_month,end_month,hdfdir, |
77 | 80 |
night,download,out_suffix_modis) |
78 |
names(list_param_python_script)<-c("list_tiles_modis","start_year","end_year","start_month","end_month","hdfdir", |
|
81 |
names(list_param_python_script)<-c("list_andtiles_modis","start_year","end_year","start_month","end_month","hdfdir",
|
|
79 | 82 |
"night","download","out_suffix_modis") |
80 | 83 |
list_param_python_script_str <- paste(unlist(list_param_python_script), collapse=" ") |
81 | 84 |
|
... | ... | |
114 | 117 |
|
115 | 118 |
#list_tiles_modis <- c("h11v08,h11v07,h12v07,h12v08,h10v07,h10v08") #tile for Venezuela and surrounding area |
116 | 119 |
#list_tiles_modis <- c("h08v04,h09v04") #tiles for Oregon #defined above... |
120 |
list_tiles_modis <- c("h12v10,h13v10") #tiles for Oregon #defined above... |
|
117 | 121 |
#list_tiles_modis <- c("h09v09,h10v09,h11v09,h12v09,h13v09,h14v09") |
118 | 122 |
#list_tiles_modis <-c("h30v10,h31v10,h32v10,h30v11,h31v11") #list("Queensland") |
119 | 123 |
|
120 |
#list_tiles_modis <- c("h08v04") |
|
121 | 124 |
script_path<-"/home/parmentier/Data/IPLANT_project/env_layers_scripts/" |
122 | 125 |
modis_download_script <- file.path(script_path,"modis_download_05142013.py") # LST modis download python script |
123 | 126 |
clim_script <- file.path(script_path,"climatology_05142013.py") # LST climatology python script |
124 | 127 |
grass_setting_script <- file.path(script_path,"grass-setup.R") |
125 |
var="TMIN" |
|
126 |
list_tiles_modis <- c("h11v11,h12v11,h13v11,h14v11,h11v12,h12v12,h13v12,h12v13,h13v13,h13v14,h14v14") |
|
127 |
|
|
128 |
var="TMAX" |
|
128 | 129 |
start_year = "2001" |
129 | 130 |
end_year = "2010" |
130 | 131 |
hdfdir = '/home/layers/commons/modis/MOD11A1_tiles' #destination file where hdf files are stored locally after download. |
131 | 132 |
#hdfdir = '/home/parmentier/Data/IPLANT_project/MOD11A1_tiles' |
132 | 133 |
download=1 |
133 | 134 |
clim_calc=0 |
134 |
out_suffix_modis="_05202013"
|
|
135 |
out_suffix_modis="_05222013"
|
|
135 | 136 |
|
136 | 137 |
list_param_download_clim_LST_script <- list(list_tiles_modis,start_year,end_year,hdfdir, |
137 | 138 |
var,grass_setting_script,modis_download_script, clim_script, |
... | ... | |
139 | 140 |
names(list_param_download_clim_LST_script)<-c("list_tiles_modis","start_year","end_year","hdfdir", |
140 | 141 |
"var","grass_setting_script","modis_download_script","clim_script", |
141 | 142 |
"download","clim_calc","out_suffix_modis") |
142 |
debug(download_calculate_MODIS_LST_climatology) |
|
143 |
#debug(download_calculate_MODIS_LST_climatology) |
|
144 |
#clim_production_obj <-mclapply(1:2, list_param=list_param_download_clim_LST_script, download_calculate_MODIS_LST_climatology,mc.preschedule=FALSE,mc.cores = 2) #This is the end bracket from mclapply(...) statement |
|
143 | 145 |
|
144 | 146 |
download_calculate_MODIS_LST_climatology(1,list_param_download_clim_LST_script) |
145 | 147 |
|
Also available in: Unified diff
LST script calc, modifications to allow parallel call of python+GRASS script