At the end of my last post I left you with a taster of what Part 2 would provide: a way of producing automatically-updating graphs of power usage over time. Part 1 was based purely on Python code that would run on any system (Windows, Linux or OS X) but this part will require a […]
After borrowing a CurrentCost electricity usage meter from my local library (if you’re in the area, then Eastleigh library will loan you one for free!), I decided to buy one, as I’d found it very useful in trying to reduce my electricity usage. The benefit of buying one as opposed to borrowing one was that […]
This post is more a note to myself than anything else – but it might prove useful for someone sometime. In the dim and distant mists of time, I set up a startup file for ENVI which automatically loaded a specific image every time you opened ENVI. I have no idea why I did that […]
As part of my PhD I’ve developed a number of algorithms which are implemented as a class in Python code. An example would be something like this: class Algorithm: def __init__(self, input_filename, output_basename, thresh, n_iter=10): self.input_filename = input_filename self.output_basename = output_basename self.thresh = thresh self.n_iter = n_iter def run(self): self.preprocess() self.do_iterations() self.postprocess() def preprocess(self): # […]
I do a lot of my academic programming in Python, and – even though I often write about the importance of reproducible research – I don’t always document my code very well. This sometimes leads to problems where I have some code running fine, but I don’t know which modules it requires. These could be […]
When running GDAL on my university’s supercomputer yesterday I got the following error: ERROR 1: Landsat_Soton.tif, band 1: An error occured while writing a dirty block This post is really just to remind me how to solve this error – I imagine the error may have a multitude of possible causes. In my case though, […]
Recently I ran into a situation where I needed to select Landsat scenes by various criteria – for example, to find images over a certain location, within a certain date range, with other requirements on cloudiness and so on. Normally I’d do this sort of filtering using a tool like EarthExplorer, but I needed to […]
For a while now I’ve been frustrated by an error that I get whenever I’m using git on Windows. When I try and run certain git commands – such as git log or git diff – I get the following message: The error message “WARNING: terminal not fully functional” appears, but if you press return […]
Today I got sent a file by a colleague in OSM format. I’d never come across the format before, but I did a quick check and found that OGR could read it (like pretty much every vector GIS format under the sun). So, I ran a quick OGR command: ogr2ogr -f “ESRI Shapefile” Villages.shp Villages.osm […]
I’ve spent a long time over the last few days struggling with a problem with a Flask webapp that I’ve been developing. The app worked fine on my local computer, but when I tried to deploy it to my web server and run it via WSGI it seemed to ‘just hang’. That is – when […]