Radiation Diary – Visualizing data

Having a few hours spare on a Sunday evening, I decided to try and visualize the rather dull radiation levels recorded from last weekend. I know how to live right?

Ever the outcome focused individual, I decided I wanted to produce a heat-map of the flight. I’ve never done this before, but with a little Googling I worked out it should be possible with Google Maps and JavaScript.

I’m no JavaScript expert, and without intelligent auto-complete or type-safety this was going to be a little more hacking than development. I stumbled across codepen.io, a free on-line development environment, but it still lacked auto-complete. I probably should have tried Visual Studio, but with CodePen and Google’s API documentation, I began the hackery.

Before I got too into the code, I decided to visualize the problem and input data. What did I have? Check this picture out, it should say it all.



To produce


See the code, and press Run. Add the Satellite imagery to see the runways properly.


How to load files?

Luckily with a copy and paste from Stack Overflow, I’ve got myself some asynchronous ajax request using JQuery.

How to process a CSV file?

Yet again, Googling revealed Jquery-csv. Bingo!

How to convert the date from the CSV into a JavaScript date?

A little more complicated, I had to hack the separate components of the string because it wasn’t a format JavaScript liked. There may have been something in JQuery that could have helped. I didn’t check.

– How to work with JavaScript objects, arrays, blah blah?

Years of experience of many languages and good Google skills. Yet again, I probably didn’t use all the JQuery I could.

– How to combine the radiation data in minutes, to GPS coordinates in seconds?

I didn’t think too hard about this, I merely iterated around each GPS coordinate and found what radiation existed in the same minute and added a weighted blip on the map.  However, that does mean that what you really see as heat is the clumping together of readings as the aircraft slows down or banks. Zoom in and the heat goes. I’ll need to experiment more to get that right – but the basics are there.

– What’s with the markers?

The KML file import provided all the markers, but I couldn’t find a way of deleting or manipulating them to show interesting peaks of radiation. So I’ve just left them for now as I didn’t really care, the 80-20% rule and all that.










Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s