A quick morning update rebuilding what I did last night, checking it all out, building from scratch. We are one step closer. The last step we took was to get our 3 major pieces of data coordinated. We needed to ‘intersect” the Land,Anomalies and the Inventory. Now, we turn it into Grid cells. For today, I’ll show what it looks like in code, and then you have the magnifico chart above. BEWARE this is still not area WEIGHTED.
It should be somewhat clear. Except for the referencing part where you read in or “load” RDATA. Basically, if you load(xyz.Rdata) you get an object called…..obj. so load(GHCNINV.RDATA); invobj<-obj means load this Rdata file. That file gets stuffed into an object called “obj” Probably need to do some more reading on this, but I will bury this detail in an API. so that this will work : Inventory<-loadOBJ(GHCNINV.RDATA)
Anyway, so the Anomalies get loaded, the inventory gets loaded, we load the LandMask. Then we grid the inventory. That’s adding celldata and area data. Then we intersect all three. Then we hand it over to as.GridCell() which takes the stations, groups them in cells and averages per cell. Lastly, we take the the COLUMN means ( columns are months) and we plot. The graph is now area averaged. Not weighted yet, that will take one step. gridWeight.