Project

General

Profile

« Previous | Next » 

Revision c8be7255

Added by Adam Wilson about 11 years ago

Updated EE compiler

View differences:

climate/procedures/ee.MOD09.py
84 84
strregion=str(list(region))
85 85
# Next few lines for testing only
86 86
# print info to confirm there is data
87
#data.getInfo()
87
print(data.getInfo())
88 88

  
89 89
## print a status update
90 90
print(output+' Processing....      Coords:'+strregion)
......
101 101
path =mod09a.getDownloadUrl({
102 102
        'name': output,  # name the file (otherwise it will be a uninterpretable hash)
103 103
        'scale': 926,                              # resolution in meters
104
        'crs': 'EPSG:4326',                         #  projection
104
        'crs': 'EPSG:4326', #4326                         #  projection
105 105
        'region': strregion                        # region defined above
106 106
        });
107 107

  
climate/procedures/ee_compile.R
17 17
jobs=expand.grid(tile=tiles$Tile,year=2000:2012,month=1:12)
18 18
jobs[,c("ULX","ULY","LRX","LRY")]=tiles[match(jobs$tile,tiles$Tile),c("ULX","ULY","LRX","LRY")]
19 19

  
20

  
21
jobs=jobs[jobs$month==1,]
20 22
## Run the python downloading script
21 23
#system("~/acrobates/adamw/projects/environmental-layers/climate/procedures/ee.MOD09.py -projwin -159 20 -154.5 18.5 -year 2001 -month 6 -region test")   
22 24
i=6715
23 25
testtiles=c("h02v07","h02v06","h02v08","h03v07","h03v06")
24 26
todo=which(jobs$tile%in%testtiles)
25
#todo=todo[1:3]
26
#todo=1:nrow(jobs)
27
lapply(todo,function(i)
27
todo=todo[1:3]
28
todo=1:nrow(jobs)
29
#todo=todo[500:503]
30
mclapply(todo,function(i)
28 31
         system(paste("~/acrobates/adamw/projects/environmental-layers/climate/procedures/ee.MOD09.py -projwin ",jobs$ULX[i]," ",jobs$ULY[i]," ",jobs$LRX[i]," ",jobs$LRY[i],
29
       "  -year ",jobs$year[i]," -month ",jobs$month[i]," -region ",jobs$tile[i],sep="")))
32
       "  -year ",jobs$year[i]," -month ",jobs$month[i]," -region ",jobs$tile[i],sep="")),mc.cores=1)
30 33

  
31 34

  
32 35
##  Get list of available files
......
35 38
df$date=as.Date(paste(df$year,"_",df$month,"_15",sep=""),"%Y_%m_%d")
36 39

  
37 40
## subset to testtiles?
38
df=df[df$region%in%testtiles,]
39

  
41
#df=df[df$region%in%testtiles,]
42
df=df[df$month==1,]
40 43
table(df$year,df$month)
41 44

  
42 45
## drop some if not complete

Also available in: Unified diff