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. Sunrise and sunset times depend on your specific location on the globe so you have to specify the location for your data set. Using the “Form B” Locations Worldwide" section on the page it is possible to enter precise coordinates for any location in terms of latitude and longitude. You can also do it for a timezone, but this is very broad and not precise enough for my liking. ...

January 2, 2018 · 2 min · 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 · 4 min · Simon

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

As is known by anyone in the field of data visualization, the “jet” colormap has some flaws: 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 since Matlab is commercially-licensed software, it’s use is restricted. The Matplotlib team have therefore developed their own version, based on the principles of colour theory (covered in my own BSc lecture courses on Visualization). The new Matplotlib default colormap is named “viridis” and it will become the new default colour map starting with Matplotlib v2.0. Users of older versions v1.5.1 can still choose viridis manually using cmap=plt.cm.viridis. ...

April 6, 2016 · 1 min · Simon