Monday, February 13, 2012

Explaining those pretty pictures

Tonight this blog is going to live up to its name... I had 2 cups of coffee with breakfast this morning, then one more with lunch at about 1 because I always get a little sleepy after I eat and I still had 5 more hours of class... I still wanted to nap during my 2-4 class which was awkward because it's a small class and you can't get away with not participating... so I had another cup of coffee about 5 to make sure I would be alert in my 6-9 class.  So now it's 10:30 and I'm bouncing off the walls which means it must be time to talk about what I've been up to all last week and explain the random screencap I posted on facebook (read: I am avoiding actual productive work).

Last week I got started on some (very preliminary) work for my actual project.  We are looking for a good, reliable way to find/estimate tree mortality from forest fires, based on some kind of remote-sensed data.  The easiest would be Landsat, because it's ubiquitous and free and there is some information already out there on that.  The other thing we'll investigate will be LiDAR, which is more complex and expensive and I haven't started playing with it but I'm sure I'll talk about it more later.

But for now, I'm playing with known indicators of fire severity that can be derived from Landsat data.  I'm doing the processing in GIS, which is the thing that I came back to school to learn, basically, so I'm excited about it (I'm sure that will wear off, soon enough).  Landsat data (Landsat 7 if you want to get particular) comes in 8 bands - the first 3 are portions of the visible spectrum and roughly correspond to blue-green, green, and red, the next four are slices of infra-red, and the last is some silly thing that no-one uses.

There are four commonly used measures of fire severity: NBR (normalized burn ratio), NDVI (normalized differenced vegetation index), dNBR, and dNDVI (these are just the postfire thing minus the prefire ). One is calculated as (band 4 - band 7) / (band 4 + band 7) and the other is the same formula, different bands.

The data (photo, basically) has a 30 meter pixel size - what do you want, from a satellite? - so what you end up with is a 30 meter grid of some arbitrary values that you can arbitrarily assign color values to, which looks pretty much like any other false-color aerial photo if you view it at a pretty large scale.  Unfortunately, I didn't screencap that when I was at school, so you'll have to take my word for that.  Anyway, what we want to do, to test the accuracy, is examine the values ONLY for places where we know what died and what survived.

I suppose this would be a good time to back up and say that the area I'm studying is the school forest up around Davenport, which caught on fire in 2009.  We have really, really good data going back to the early 90s on all the trees in a series of 1/5 acre circular plots, laid out (nominally) on a 500 foot grid.

So, then, what you see below is a small area of the forest, with NDVI symbolized in grayscale, and the same NDVI within the plots symbolized in color:



I found this was a nice way to visualize what was going on - the plot data jumps out because of the color, but you can see the context from the background.  At this scale, the 30m pixel looks incredibly blocky, and yet, keep in mind that this is an area roughly a mile square.  Landsat is really only good for broad-brush interpretation, which is one of the things we'll be trying to improve on, later on.

Here is the dNDVI for comparison:


The idea behind this is that, by subtracting the calculated values from before the fire, you're removing any variation not caused by the actual fire.  One thing I'll be looking into is whether this is actually any better.  One thing that you might have noticed is that our plots are very close to the same size as the pixels (6.9 feet broader, but who's counting) - pure coincidence.  But it makes calculating an average value for each plot, which I have to do, interesting, especially given the slightly random way the two grids interact.  You can see from the picture that the crew that established the plots didn't get them on a precise grid - hard to accomplish in the forest, although they missed pretty bad in a few places.  Someone went out and GPS'd the actual plots much later, and it's not like you can move them once they've been sampled and resampled for 10 or 20 years, so that's what we've got to work with.

Um, so, yeah. That's what I've been doing, in a tiny windowless room, for the last week or so.  Actually it was only probably 8 hours of work or so, just spread out over several days and with a few false starts.

Friday, February 10, 2012

OCD

I had forgotten that the sidewalks at cal poly have wide expansion joints that are spaced out just a bit shorter than three of my steps, meaning that everywhere I walk, I end up looking down to make sure that every time I step on one (with alternating feet every time) it's in the same spot under my foot, otherwise it doesn't feel right.

That's all I have to say about that.

Friday, February 3, 2012

I am a huge nerd

So, the main point of me being here (i.e. back in school) is to learn more about working with GIS - that's geographical information systems, for the uninitiated.  I feel like this example of nerding out instead of working on any homework or my actual project (much of which is in GIS) is justified by that...  Anyway, I got off my ass and biked to school yesterday, and it was more work than I expected.  I live in Los Osos, which is pretty near sea level.  The Los Osos valley is pretty level and leads into the outskirts of San Luis Obispo, where you turn and ride through a low pass, then down a bit, and then up to Cal Poly which is at the base of some low hills.  Google maps says it's 13 miles.

I decided that since I have the technology and the data (we have anything that the city has), and because I'm a huge nerd, I would find out what my ride looks like.  It took some googling to figure out how to make ArcMap my bitch but I was able to extract heights from a DEM (digital elevation model) of the county every 20' (seemed reasonable) along my route, and export that data into excel:



Looks more impressive than it actually is - the max elevation difference is about 250' (ok, 264.3 but who's counting).

Oh, and google's got the distance pretty wrong - it's just short of 12 miles.