Home > Uncategorized > MoshTemp303 CELL-a-brate

MoshTemp303 CELL-a-brate

Whats this button do?

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.

Code

source(“Global.R”)

Land<-getLandMask()

load(V2ANOMALIES.RDATA)

V2Anomalies<-obj$Data

load(GHCNINV.RDATA)

invobj<-obj

gridobj<-as.GriddedInventory(invobj,Land)

GridInventory<-gridobj$Data

temp<-intersect.InvAnomalies(gridobj$Data,V2Anomalies)

GridInventory<-temp$GridInventory

V2Anomalies<-temp$Anomalies

CellMatrix<-as.GridCells(V2Anomalies,GridInventory)

Temps<-colMeans(CellMatrix,na.rm=T)

plot(zoo(Temps,order.by=timeline))

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.

Later.


Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: