Robin's Blog

Author Archive

Roadside leafiness from space – Part 2

In the last post in this series, I showed some pretty maps of roadside leafiness, created by extracting NDVI values near roads – like this: This time, I want to move away from pretty images to some numerical analysis – and also move from a local scale to a national scale. My first question was: […]

Roadside leafiness from space – Part 1

If you just want to see some pretty maps of roadside leafiness then scroll down…otherwise, start at the top to find out how I did this. I’ve recently started doing a little bit of satellite imaging work again, and started off with a project that was inspired by a post on James O’Connor’s blog. He […]

Quick way to delete columns from a shapefile

I haven’t posted anything on this blog for a long time – sorry about that. I’ve been quite ill, and had a new baby – so blogging hasn’t been my top priority. Hopefully I’ll manage some slightly more regular posts now. Anyway, on with the post… I recently needed to delete some attribute columns from a […]

Regression in Python using R-style formula – it’s easy!

I remember experimenting with doing regressions in Python using R-style formulae a long time ago, and I remember it being a bit complicated. Luckily it’s become really easy now – and I’ll show you just how easy. Before running this you will need to install the pandas, statsmodels and patsy packages. If you’re using conda […]

Reminder about cross-platform case-sensitivity differences

This is just a very brief reminder about something you might run into when you’re trying to get your code to work on multiple platforms – in this case, OS X, Linux and Windows. Basically: file names/paths are case-sensitive on Linux, but not on OS X or Windows. Therefore, you could have some Python code […]

Showing code changes when teaching

A key – but challenging – part of learning to program is moving from writing technically-correct code ‘that works’ to writing high-quality code that is sensibly decomposed into functions, generically-applicable and generally ‘good’. Indeed, you could say that this is exactly what Software Carpentry is about – taking you from someone bodging together a few […]

Reading AERONET data in Pandas: a simple helper function

I use data from the AERONET network of sun photometers a lot in my work, and do a lot of processing of the data in Python. As part of this I usually want to load the data into pandas – but because of the format of the data, it’s not quite as simple as it […]