Fetching, wrangling and visualising sunrise and sunset data using Python

Previously I showed how it was possible to obtain sunrise and sunset times for a whole year at any location on Earth, from a public source. This time I am going to explain how to fetch that data, clean it up and create graphical visualizations like the one below, all using Python. A Jupyter Notebook is available on GitHub. Such data might even be useful in, for example, simulation of solar power generation....

February 2, 2018 · Simon

How to get Sunrise and Sunset times for data analysis

jinsngjung / Pixabay Today is 2nd January and the days are getting longer again. I was thinking about sunrise and sunset times and wondering if I should do some data analysis and plotting of these to visualize how they change over the course of a year. Of course, the first step is to get a suitable data set. You can get a data set of sunrise and sunset times from this page on the US Naval Observatory (USNO) website....

January 2, 2018 · Simon

Configuring KNIME to work with Python 2.7.x on Windows

UPDATE: These days it is recommended to use Python3 instead of Python2 Apparently it is tricky to get Python integration working in the KNIME Analytics Platform. If you read the official guide too quickly you can miss some critical information at the bottom of the page. I was getting an error complaining that the google.protobuf library was missing even though I thought that I had everything installed correctly: Library google.protobuf is missing, required minimum version is 2....

August 23, 2017 · Simon

Plotting multivariate data with Matplotlib/Pylab: Edgar Anderson’s Iris flower data set

The problem of how to visualize multivariate data sets is something I often face in my work. When using numerical optimization we might have a single objective function and multiple design variables that can be represented by columnar data in the form {x1, x2, x3, … xn, y} a.k.a. NXY. With design spaces of more than a few dimensions it is difficult to visualize them in order to estimate the relationship between each independent variable and the objective, or perform a sensitivity study....

August 31, 2016 · Simon

The new default colormap for matplotlib is called “viridis” and it’s great!

It’s probably not news to anyone in data visualization that the most-used “jet” colormap (sic) (sometimes referred to as “rainbow”) is a bad choice for many reasons. Doesn’t work when printed black & white Doesn’t work well for colourblind people Not linear in colour space, so it’s hard to estimate numerical values from the resulting image The Matlab team recently developed a new colormap called “parula” but amazingly because Matlab is commercially-licensed software no-one else is allowed to use it!...

April 6, 2016 · Simon