Revision 99b3508d
Added by Adam Wilson over 11 years ago
climate/procedures/NDP-026D.R | ||
---|---|---|
70 | 70 |
cldsd=sd(x$Amt[x$Nobs>10]/100,na.rm=T))})) |
71 | 71 |
cldm[,c("lat","lon")]=st[match(cldm$StaID,st$StaID),c("lat","lon")] |
72 | 72 |
|
73 |
## means by year |
|
74 |
cldy=do.call(rbind.data.frame,by(cld,list(year=as.factor(cld$YR),StaID=as.factor(cld$StaID)),function(x){ |
|
75 |
data.frame( |
|
76 |
year=x$YR[1], |
|
77 |
StaID=x$StaID[1], |
|
78 |
cld=mean(x$Amt[x$Nobs>10]/100,na.rm=T), |
|
79 |
cldsd=sd(x$Amt[x$Nobs>10]/100,na.rm=T))})) |
|
80 |
cldy[,c("lat","lon")]=st[match(cldy$StaID,st$StaID),c("lat","lon")] |
|
81 |
|
|
82 |
|
|
73 | 83 |
#cldm=foreach(m=unique(cld$month),.combine='rbind')%:% |
74 | 84 |
# foreach(s=unique(cld$StaID),.combine="rbind") %dopar% { |
75 | 85 |
# x=cld[cld$month==m&cld$StaID==s,] |
... | ... | |
79 | 89 |
# Amt=mean(x$Amt[x$Nobs>10],na.rm=T)/100)} |
80 | 90 |
|
81 | 91 |
|
82 |
## write out the table |
|
92 |
## write out the tables |
|
93 |
write.csv(cldy,file="cldy.csv") |
|
83 | 94 |
write.csv(cldm,file="cldm.csv") |
84 | 95 |
|
85 | 96 |
|
86 | 97 |
################## |
87 | 98 |
### |
88 | 99 |
cldm=read.csv("cldm.csv") |
100 |
cldy=read.csv("cldy.csv") |
|
89 | 101 |
|
90 | 102 |
|
91 | 103 |
##make spatial object |
... | ... | |
96 | 108 |
#### Evaluate MOD35 Cloud data |
97 | 109 |
mod35=brick("../modis/mod35/MOD35_h11v08.nc",varname="CLD01") |
98 | 110 |
mod35sd=brick("../modis/mod35/MOD35_h11v08.nc",varname="CLD_sd") |
99 |
|
|
100 | 111 |
projection(mod35)="+proj=sinu +lon_0=0 +x_0=0 +y_0=0 +a=6371007.181 +b=6371007.181 +units=m +no_defs" |
101 |
projection(mod35sd)="+proj=sinu +lon_0=0 +x_0=0 +y_0=0 +a=6371007.181 +b=6371007.181 +units=m +no_defs" |
|
112 |
|
|
113 |
|
|
114 |
### use data from google earth engine |
|
115 |
mod35=brick("../modis/mod09/global_2009/") |
|
116 |
mod09=raster("../modis/mod09/global_2009/MOD09_2009.tif") |
|
117 |
|
|
118 |
n=100 |
|
119 |
at=seq(0,100,length=n) |
|
120 |
colr=colorRampPalette(c("black","green","red")) |
|
121 |
cols=colr(n) |
|
122 |
|
|
123 |
levelplot(mod09,col.regions=cols,at=at) |
|
124 |
|
|
102 | 125 |
|
103 | 126 |
cldms=spTransform(cldms,CRS(projection(mod35))) |
104 | 127 |
|
Also available in: Unified diff
Added script to extract MOD35 processing path from swath level data and another to summarize MOD35 data. Also updated NDP-026D script to use new MOD35/09 summaries from Earth Engine