Fieldwork guide for robots (and humans)

In the future, all our fieldwork will be done by robots while we play around on our hover-boards. In anticipation of this, I have written a program for the robots to follow.  Until that day arrives, it is also a handy checklist for human beings.  It assumes that future robot programming languages will look a lot like English, and pays special attention to notebook layout and how to geotag photos.


def fieldworkPlan():

  • Before you go:
    • makeSureYouHaveTheRightKit()
    • prepareYourKit()
  • For each day in the field:
    • Write the date and the day’s aims in your notebook
    • For each locality visited:
      • dataCollectingRoutine()
    • endOfDayRoutine()
  • postTripRoutine()

def makeSureYouHaveTheRightKit():

  • Notebook
    # I like the Rite in the Rain with Metric Grid.
    # They’re not cheap, but they are really tough and, with a pencil, you can literally write through rain drops.
    # The metric grid pattern is handy for lining up logs, but easily ignored for sketches.
  • Fieldwork gear:
    • Sample bags
    • Marker pen
    • Hand lens
    • Ruler / tape measure
    • Hammer (+ glasses) / spade / trowel
  • Camera
    # I like to have a waterproof/dustproof compact that I don’t need to worry about getting wet or dirty.
    # I decided that built-in GPS was an unnecessary expense.
    # The Panasonic DMC-FT25 is a pretty good example, and not too expensive these days.
    # It lets you take pictures like this in geothermal pools…waterproof_camera
  • GPS (with cable)
    # The most basic Garmin eTrex is ideal, as I only want the GPS for two purposes.
    # (1) To record waypoints at each location I make observations.
    # (2) To record time-stamped track of where I go.
    # I then correlate this with the timestamp of my photos, which lets me geotag (embed the photo’s location into the file).
    # The most important thing is that you can easily get the data onto a computer.
    # You can also use smartphones with software such as MyTracks (on Android) or Strava that can exports tracks as .gpx files.
    # I find this uses the phone’s battery very quickly.
  • Software:
    • gpsbabel
      # This is open source software that reads data from your GPS and can convert it between various formats
    • GpsPrune
      # This is open source software for editing GPS data.
      # We will use it to geotag our photos.
      # To do this, gpsbabel and exiftools also need to be installed.
      # It also lets you view geotagged photos by location.
    • Photo cataloguing software
      # e.g. Shotwell, Picasa, iPhoto.
      # These are very useful because you can browse photos across folders based on their dates.
      # You can also tag photos e.g. ‘notebook’, ‘logged section’.
      # Some allow you to view geotagged photos on a map.
  • Suitable field clothing
    # See my Volcano suit / What to wear in Iceland post.

def prepareYourKit():

  • Notebook
    # Write contact details in the front in case you lose it.
    # Write useful notes for reference in the back, such as grain size definitions for logging or a key for different symbols in logs.
  • Camera
    # Synchronise the clock with your GPS
  • GPS
    # Set the coordinate system to whatever system your maps use.
    # It doesn’t matter if this is something quite rare, because they are all stored as Lat/Lon within the GPS anyway.
  • Software
    # Practice geotagging photos using GPS track timestamps.

def dataCollectingRoutine():

  • Mark GPS waypoint; leave GPS running to record track.
    # I usually take the automatically suggested waypoint number, rather than fiddling with renaming it each time.
  • Prepare outcrop for logging/sampling
  • Take photographs of:
    • General outcrop context
    • Logged/sampled section
    • Features of interest
  • Note the last three digits of each photo’s file name and, if necessary, make a note of what it shows.
  • Record data
    # The following is an example of how I like to lay out my notebook.
    # Make observations before interpretations.

    notebook_example600

    Example notebook layout. Click to enlarge.

  • Collect samples
    # Write the sample number at least 3 times on the bag
  • Clean up the site
  • Take photographs of the notebook pages that you have just written
    # This not only acts as a backup, but, because the GPS is running and you can geotag them, you can also access them via links on your GIS maps (see below)
  • Switch off GPS

def endOfDayRoutine():

  • Make a note of any thoughts or wider interpretations that you had
  • If you have a laptop in the field:
  • Pack your samples safely
  • Type up spreadsheet(s) with all your localities, samples and measurements.

Other tips

  • Use GpsPrune to geotag the photographs of the logs from your notebooks. Then you can find them quickly by location.
  • You can view them in your QGIS maps using the “Geotag and Import Photos” and “eVis” plugins:

  • You can Easily change coordinate projection systems in Python with pyproj.
  • On Unix-type systems (e.g. Linux, Mac) you can download your photos and GPS data very quickly and without the fuss of a mouse and GUI with two simple terminal commands
    $ cp -urn /media/camera/ ~/Pictures/Iceland2014/
    $ gpsbabel -tw -i garmin -f /dev/ttyUSB0 -o gpx -F ~/Iceland2014/GPS_data/2014-06-05_gpsdata.gpx
Categories: Uncategorized

Do Iceland’s volcanoes pose a threat to the UK?

I recently gave a talk about the threat to the UK from Iceland’s volcanoes at the UK’s largest meeting of geography teachers, the GA Annual Conference.  The talk was kindly sponsored by WJEC, who filmed it and have posted the videos on YouTube.  The full talk is around 45 minutes long and is split over 4 videos.  This post brings them all to one place and provides links so that you can skip to topics of interest if you don’t have time to watch the whole thing.

Part 1 – Eyjafjallajökull 2010 and Grímsvötn 2011

Part 2 – Impacts of ash in the UK and on aviation

Part 3 – Perception and reality

Part 4 – Potential impacts of the largest eruptions

Further reading

Much of the material in the talk has been covered in blog posts on this site.  You can see a full list of them on the Every Post Ever page.  Please bookmark the RSS feed if you want to keep up to date with the latest posts.  You can also follow me on Twitter.

Categories: Uncategorized

Sources of reliable information about large Icelandic fissure eruptions

Don’t you hate it when you see the film of a book that you enjoyed and they have missed out lots of the best bits?  Or even worse, the director has made changes to the original story for ‘artistic’ reasons?  Well, that’s how I feel about the news coverage today about a report into the threat to the UK from big lava eruptions in Iceland.

laki_newsWhat’s the story?

Claire Witham of the Met Office, is giving a presentation at the European Geosciences Union conference in Vienna this week about impact on the UK of such an eruption.  It’s serious stuff.  Last October, the British Geological Survey released a report (compiled by Sue Loughlin, Head of Volcanology) that describes what we know about such eruptions:

  • The 1783-84 Laki event erupted over 14 km3 of basalt lava, releasing millions of tonnes of sulphur dioxide gas that polluted the atmosphere across northwest Europe for months with sulphuric acid fog.
  • It’s estimated that it killed over 20,000 people in Europe at the time, and new studies suggest that if it happened again today that figure could be 140,000.  Furthermore, the acid damages crops and can poison waterways.
  • We’ve had two Laki-sized eruptions in the past 1,000 years (Laki 1783, Eldgjá 934), and eleven smaller ones (but only two of these erupted >1 km3 magma), so another such eruption is possible in our lifetimes.

Nevertheless, the reality wasn’t exciting enough for the mainstream media, who have reported this as some kind of imminent apocalypse.  In lots of science communication, there is a problem with dumbing-down of information.  In volcanology, the problem is sexing up.

Media changes to the story for ‘artistic reasons’

  1. A number of reports introduced a new character, the supervolcano.  The term doesn’t appear anywhere in the original report.  In fact, as Erik Klemetti described, it doesn’t appear very often in any real scientific papers.  And when it does, it’s mainly to do with explosive eruptions of over 1000 km3 of pumice and ash.  Laki produced 14 km3 of lava, so wouldn’t even come close!
  2. Another favourite baddie, climate change, also gets a role in the media story.  The summer of 1783 was unusually hot in Europe, and the winter of 1783-84 was very cold across the whole northern hemisphere.  Scientists at the time suggested that there might be a connection, but more recent work shows that (surprise, surprise) things are a bit more complicated than that.  The BGS report itself says that it is not possible to prove that the extreme weather was linked to the eruption.
  3. No self-respecting blockbuster is complete without a massive body count.  So even though the report states that the eruption killed 60% of Icelandic livestock, the International Business Times inflates that figure to 80%.  Even better, the Daily Star posted their report under the headline: TOXIC SMOG FROM ICELANDIC VOLCANO COULD KILL MILLIONS.
  4. Finally, no story about a hypothetical future risk gets as many clicks as one with immediate danger.  Hence the the Daily Star opening with the words “Ministers are on red alert…”  This is the same reason that the Mail Online recently converted an Icelandic volcanologist’s gentle reminder that Hekla is still an active volcano (and you should think twice about climbing it) into “major eruption could happen within days and hit air travel”.  That was on the 19 March, and still nothing has happened.  The BGS report says that, on average, we can expect a fissure eruption of >1 km3 lava once every 270 years or so.

Sources of good information about large-magnitude fissure eruptions in Iceland.

  • The best information comes straight from the horse’s mouth.  You can read the full report into large magnitude fissure eruptions on the British Geological Survey website here, including an executive summary that you can download here.  It contains all the great stuff that was left out of the news reports, such as descriptions of the impacts at the time and of Icelandic fissure eruptions in general.
  • The Cabinet Office National Risk Register of Civil Emergencies, which now contains a Laki-type event, is here.
  • A great blog post by Anja Schmidt, who calculated the 140,000 figure, compares a Laki-type event to the recent air pollution experienced in the UK.
  • For a popular science overview of the Laki eruption in the context of other Icelandic and worldwide eruptions, check out Island on Fire by Alex Witze and Jeff Kanipe.  A review by David Pyle, Professor of Volcanology, is here.
  • Update 1 May: Jonathan Amos on the BBC News has posted the first sensible article covering this, including interviews with Claire Witham, Alex Witze and Jeff Kanipe.

If you’ve still not had your fill of volcanoes for the day, you can also try yourself against my game, Soup or Volcano, or read my last media-based rant, Ash cloud travel insurance / why scientists should blog.

Update: 22:55hrs
This afternoon I gave an interview on BBC Radio Scotland, who wanted some comments on the report.  I’ve uploaded it onto YouTube so you can hear it below.  Can you spot the typo on the slide?

Update: 30 April 2013
The original version of this post incorrectly stated that Sue Loughlin from the BGS presented their report in Vienna, as was reported by the International Business Times.  Claire Witham from the Met Office is leading the study into the impact on the UK and presented the results in Vienna.

Categories: Uncategorized

Fitting probability distributions from binned / quantile data in Python

I’ve made an iPython Notebook that explains how to fit probability distributions to data when only binned values, or quantiles, or perhaps a cumulative distribution are available.  It uses a least squares fit approach.  View it by clicking the picture below:

fitting_distributions

The page includes a button to download the notebook so that you can play around with it yourself.

Python is a free and open source programming language that is becoming increasingly popular with scientists as a replacement for Matlab or IDL.  I hope that the notebook will be helpful to anyone who works with grainsize data e.g. volcanologists, sedimentologists, atmospheric scientists.

iPython notebooks are amazing; if you use Python for science and haven’t tried them yet, then I urge you to have a look.  They let you run Python code in little chunks, displaying the results immediately and interspersed with comments and LaTeX-rendered equations.  You can also render publicly-available notebooks using the iPython Notebook Viewer website, as I have done here.  I think that they are The Future.

iPython notebooks come nicely packaged for Windows and Mac in the Anaconda Python distribution (and probably others such as Enthought, too).  You can install the ipython-notebook package on Ubuntu-like Linux distributions with a single command (sudo apt-get install ipython-notebook), but to get the most up-to-date versions it is better to use pip:

# Depending on what is already installed, 
# you may also need to add some dependencies.
sudo apt-get install pandoc python-zmq python-tornado

# Install pip, then use pip to install ipython
sudo apt-get install python-pip
sudo pip install ipython
Comments Off on Fitting probability distributions from binned / quantile data in Python
Categories: Uncategorized

The most important journals in volcanology

The Journal Impact Factor (JIF; average number of citations to a paper in a journal in the first two years since it was published) is such a poor predictor of an individual paper’s citation count that quoting it is a sign of statistical illiteracy, yet cursory judgements about the quality of scientific papers are routinely based upon of the JIF of the journal in which they are published.  At one end of the spectrum, this means that a paper in Nature or Science is automatically assumed to be so important that a single one on a CV can be a passport to job interviews, speaking invitations, jobs and promotions.  At the other, papers in discipline-specific journals can be passed over, assumed to be unimportant, despite being more useful to the group of people that actually read them.

Volcanology journals are an example of the latter; it’s a small field and, with just a few volcanologists to cite each other’s work, the JIFs of the specialist journals are quite low.  Nevertheless, they are clearly very important to the world of volcanology.  I wanted to find out what the most important journals in volcanology are, and if there was any correlation with the JIF.

To do this, I looked at the reference list of a recent review article, How volcanoes work: A 25 year perspective, written by Kathy Cashman and Steve Sparks.  Both authors have distinguished careers and extremely wide-ranging interests so can be trusted to give a reliable overview of the subject.  In the paper, they “focus particularly on the physical processes that modulate magma  accumulation in the upper crust, transport magma to the surface, and control eruptive activity“, which is actually a huge scope.  Volcanologists working with data from the depths of the mantle and lower crust or from orbit on satellites may feel a bit neglected, but most of physical volcanology is represented.

The paper cites a whopping 364 references.  I extracted the journal or book title from each, and with a few lines of Python code, got counts of which were cited most.  The number of counts is a proxy for the importance of the journal in the field of volcanology.

The most important journals in volcanology

top20_barchart The most cited journals by Cashman and Sparks are the Journal of Volcanology and Geothermal Research and Bulletin of Volcanology.  Both are respected journals, well-read by volcanologists, so it is no surprise that they are the most important journals in the field.  JGR and EPSL are next.  Between them, these top four journals represent just under half (175/364) of all papers cited in the review.

Nature and Geology feature in 5th and 6th, showing that some important volcanology papers are published there, but they certainly do not dominate in the way that their JIFs would suggest.

Comparison between JIF and citations in Cashman and Sparks (2013)

citations_vs_jifComparing the number of citations in Cashman and Sparks (CCS) with the JIF (2 year citation data from SCImago; top 20 journals only) shows an overall lack of correlation.  The data can be divided into three groups:

  • Journals with JIF > 5:  These ‘big hitters’ show a positive correlation between JIF and CCS, but, with the possible exception of Nature, they are not the most important journals to volcanologists.
  • Journals with CCS > 10:  The four journals shown to be the most influential in volcanology all have a modest JIF that does not reflect their significance within the subject.  With Nature as an exception once more, the most important journals in volcanology actually show a slightly inverse correlation with JIF.
  • Journals with JIF < 5 and CCS < 10:  These show no correlation between JIF and CCS.

Conclusion

The data show that the most important journals in the field of volcanology, based on citations in a comprehensive review of the advances of the past 25 years, are Journal of Volcanology and Geothermal Research and Bulletin of Volcanology.  These are discipline-specific journals with low JIFs.  Consequently, the JIF of these journals is of especially little value in assessing the quality of the work in their articles or the importance of their contribution to the field.

EDIT 2014-03-12 21:30.  Of course the CCS is just another journal-based metric, so it still can’t tell you anything about an individual article or scientist.

If you don’t believe that journal-based metrics, such as Journal Impact Factors, should be used as a surrogate measure of the quality of individual research articles, or to assess an individual scientist’s contributions, or in hiring, promotion or funding decisions, then you can join over 10,000 others in signing the San Francisco Declaration on Research Assessment.

Reference:

Cashman KV, Sparks RSJ (2013) How volcanoes work: A 25 year perspective. Geological Society of America Bulletin. doi: 10.1130/B30720.1

Results in Full:

Journal of Volcanology and Geothermal Research,57
Bulletin of Volcanology,47
Journal of Geophysical Research,40
Earth and Planetary Science Letters,31
Nature,18
Geology,17
Journal of Petrology,12
Geochemistry Geophysics Geosystems,11
Geological Society of America Bulletin,10
U.S. Geological Survey Professional Paper,10
Geophysical Research Letters,9
Science,8
Geological Society of London Memoir,7
Contributions to Mineralogy and Petrology,6
Reviews in Mineralogy and Geochemistry,6
Nature Geoscience,5
Philosophical Transactions of the Royal Society of London,4
Geophysical Monograph,4
Journal of Human Evolution,3
Earth-Science Reviews,2
Geological Society of London Special Publication,2
The Journal of Geology,2
Journal of the Geological Society of London,2
Mathematical,2
International Journal of Remote Sensing,2
Physics and Chemistry of Minerals,2
Annual Review of Fluid Mechanics,2
Geological Society of America Special Paper,2
Journal of the Geological Society,1
Fire and Mud—Eruptions and Lahars of Mount Pinatubo,1
Oceanography,1
Geological Magazine,1
Geophysical Journal of the Royal Astronomical Society,1
Tectonophysics,1
Geological Society of London,1
Religion,1
The Geochemical Society,1
Journal of Colloid and Interface Science,1
Marine Geology,1
Krakatau 1883: The Volcanic Eruption and its Effects,1
Geophysical Journal International,1
GeoJournal,1
Pure and Applied Geophysics,1
Lava Flows and Domes,1
Disaster Resilience: An Integrated Approach,1
Volcano Hazard and Exposure in Track II Countries and Risk Mitigation Measures—GFDRR Volcano Risk Study,1
Assessment of Risk and Uncertainty for Natural Hazards,1
Encyclopedia of Complexity and Systems Science,1
Precambrian Research,1
Eos (Transactions, American Geophysical Union),1
Chemie der Erde–Geochemistry,1
IEEE Transactions,1
Journal of Fluid Mechanics,1
American Journal of Physics,1
Chemical Geology,1
Computers & Geosciences,1
Living Under the Shadow: Cultural Impacts of Volcanic Eruptions,1
Paricutín: The Volcano Born in a Mexican Cornfield,1
Journal of Geology,1
Physics of the Earth and Planetary Interiors,1
Encyclopedia of Volcanoes,1
Volcanic Plumes,1
Progress in Physical Geography,1
Washington,1
Archives of Environmental Health: An International Journal,1
Timescales of Magmatic Processes,1
Scientific Drilling,1
Reviews of Geophysics,1
Applications of Percolation Theory,1

Categories: Uncategorized

Three years of volcan01010: Highlights of 2013

It’s 3 years since I started blogging at volcan01010. This post has some highlights from the last year. If you are into Iceland, volcanoes, Python, or open source software (especially GIS) then there should be something here for you.

Buzzfeed headlines

Those annoying Buzzfeed headlines seem to be everywhere these days. I jumped on the bandwagon recently and sent out a series of tweets about the Seven volcan01010 Posts You Can’t Afford to Miss!

  1. Tensile strength of rapidly expanding and accelerating magma #fail!
  2. The amazing reason why Hekla looks so different to other South Iceland volcanoes.
  3. This fact about transatlantic flight will blow your mind.
  4. The 65 #opensource geoscience software tools that Adobe, ESRI and Microsoft don’t want you to know about.
  5. Can you hear the difference between a volcano and a mating whale?
  6. Will your children outlive Iceland’s glaciers?
  7. You’ll never believe the chances of another airport-closing ash cloud!

Iceland and volcanoes (volcan…)

  • Soup or volcano?Inspired by media obsession with supervolcanoes, I created this fun quiz for anyone aged 9 to 99 (centenarians have a notoriously poor sense of humour). See if you can be it!

Open source software and GIS (…01010)

Which five countries have the most volcanoes per person? This intro shows how to use SQLite to extract useful data from massive spreadsheets and how to use it to organise your own sample data.

There are different ways of describing a lognormal distribution and I found the way that they are used in Python quite confusing. I couldn’t find any good guides online, so I made my own.

Highlights from 2011, 2012

The previous two anniversary posts are still available:

Progress since last year

Volcan01010 now has 881 followers on Twitter (up from 459 last year), and in the last 12 months the blog had 27,894 page views from 17,435 unique visitors in 170 countries (with the vast majority in the UK and USA). The numbers of hits are up about 50% from last year. Traffic comes in more steadily now and is spread across more posts, but the software how-to’s are usually most popular. I’m pretty happy that there were 13 days last year when over 100 people visited the blog; that’s a lot more people than come to any of my lectures!

If you find the blog interesting or useful, then please tell all your friends. Or make a video of yourself reading a post, and at the end nominate two of your friends to do the same in 24 hours.

Comments Off on Three years of volcan01010: Highlights of 2013
Categories: Uncategorized

A history of ash clouds and aviation

During 2010’s Eyjafjallajökull eruption, as the planes stood on the tarmac, many people asked why this hadn’t happened before.  After all, Iceland’s volcanoes have been active since long before mankind took to the skies.  Well, there are three main reasons for this.  These are the volcanoes, the airline industry and flight safety regulations.  This post looks at how all three have changed since the Second World War.

The volcanoes

The orange areas in the barcode-like diagram below show all the periods in which volcanoes in Iceland were erupting.  The data came from the Global Volcanism Program.  It’s a fairly regular occurrence, as you can see.  On average, as I explained in my first ever volcan01010 blog post, there is an eruption in Iceland about every 5 years, with 3/4 of them being explosive.  The wind blows towards the UK about 1/3 of the time, so you could expect a direct hit from an ash cloud about once every 20 years.

The Surtsey and Krafla Fires eruptions stand out for their long duration.  Surtsey, in particular, is interesting because the eruption produced a new island in the north Atlantic, with ash-rich explosions driven by hot magma boiling the water of the ocean.  It lasted three and a half years.  What would happen if a similar eruption began now?

I’ve marked the three most powerful explosive eruptions, Hekla 1947, Eyjafjallajökull 2010 and Grímsvötn 2011, with bold lines.  These produced much more ash than the others.  It is pure luck that there was such a long gap between them.

Air_traffic_vs_eruptions_01

The airline industry

Air_traffic_vs_eruptions_02

The blue line shows the huge growth in the global airline industry over the past 70 years (averaging 5% per annum).  There were no transatlantic passenger flights at the time of Hekla 1947.  By 2010, there were 2.5 million passengers flying between London Heathrow and New York JFK per year.  The more planes that are flying around, the more chance there is that one will meet an ash cloud.  In the two most dramatic encounters (BA Flight 9 vs Galunggung, Indonesia and KLM Flight 867 vs Mt Redoubt, Alaska, USA) the ash caused the jet engines to fail.  This led to changes to flight rules described below.

An important point to note is that as society becomes more dependent on air transport, any disruption is going to be increasingly expensive.

Flight safety regulations

The near-miss ash cloud encounters led to the establishment of the International Airways Volcano Watch in 1987, and the process of designating regional meteorological  agencies as Volcanic Ash Advisory Centres (VAACs) began in 1990.  With no proper measurements of how much ash was safe to fly through, the guidance was to ‘avoid all ash’.  The final graph shows the period when these rules were in effect.

In much of the world, where planes can just divert around dangerous areas, the guidance worked well.  But when Eyjafjallajökull dispersed ash across much of NW Europe in 2010, closing the airspace of entire countries, it led to 95,000 cancelled flights and the massive global disruption that made the volcano infamous.

Air_traffic_vs_eruptions_03

The Eyjafjallajökull eruption was the most ash-rich explosive eruption in Iceland since the rules were put in place, but it wasn’t the first time that Icelandic eruptions had affected flights.  The Hekla 2000 eruption damaged a NASA DC-8 aircraft that accidentally flew through the plume, and the Grímsvötn 2004 eruption caused parts of Scandinavian airspace to be closed.  In fact, every Icelandic eruption of the 21st century has impacted aviation.

During the Eyjafjallajökull crisis, the aviation rules were relaxed and ash contamination was divided into different concentration zones (even though we can’t reliably map the difference between them).  In Europe, planes can now fly where up to 4000 micrograms of ash per cubic metre of atmosphere are predicted and this got things moving again in 2010 while the eruption was ongoing (yellow region on graph).  It is also a big reason why only 900 flights were cancelled during the 2011 Grímsvötn eruption, despite the fact that it erupted twice as much material in one tenth of the time.  With these new rules, it seems likely that only the largest eruptions could cause disruption on the the scale of Eyjafjallajökull.

Looking to the future

The chaos caused by the Eyjafjallajökull eruption was unprecedented because the global airline industry ‘took off’ and became part major of society during a lucky gap between powerful explosive eruptions in Iceland.  We can’t predict the next 70 years, but the following trends are likely:

  • Iceland’s volcanoes will continue to erupt.  In particular, the time since that last eruptions of Hekla and Katla is longer than the average gap between their more recent eruptions.  Both volcanoes typically produce ash-rich eruptions.
  • Global air traffic will continue to rise, making future airspace closures more and more expensive.
  • The new flight rules will result in smaller areas being closed, and for shorter lengths of time, than during the ‘Avoid all ash’ era.  This will make continent-wide closures like Eyjafjallajökull caused much less likely.  Given the right weather conditions, however, it will still be possible for ash clouds to close airports in the busiest parts of NW Europe.
Categories: Uncategorized

Generate volcano trivia with this SQLite tutorial

Excel is not a database. Even so, spreadsheets are commonly used as such. They are convenient places to enter and store data, but not to get it out again. This post aims to show how using a real database makes this easier.

It uses an SQLite database, which is what many browsers (e.g. Firefox) use to store your bookmarks and history. These can also be read by other software e.g. Geographic Information Systems. It has none of the overly-complex wrappings of MS Access or LibreOffice Base and doesn’t need a server like MySQL or Oracle. Once the data are imported, typically from a comma separated value (csv) file, it simply provides an interface so that we can ask questions using Structured Query Language (SQL).

This example uses the Smithsonian Institute’s Global Volcanism Program catalogue of volcanoes, which can be downloaded as a csv file from their website, as the database.  It lists locations and recent eruptions of over 1,500 active volcanoes. Querying the list can generate a wealth of interesting (and less-interesting) volcano facts.

The commands may look complicated at first, but hopefully you can see where the advantages in a real database lie.  If so, there are instructions for getting started at the end.  If not, just enjoy the trivia.

Get an A-Z list of all the volcanoes in the world.

SELECT "Volcano Name" FROM GVPVolcano
ORDER BY "Volcano Name";
Volcano name
Abu
Babuyan Claro
Cabalían
Dabbahu
E-san
Falcon Island
Gabillema
Hachijo-jima
Iamalele
Jailolo
Kaba
La Palma
Ma Alalta
NW Eifuku
O’a Caldera
Pacaya
Qal’eh Hasan Ali
Rabaul
SW Usangu Basin
Ta’u
Ubehebe Craters
Vailulu’u
Waesche
Xianjindao
Yake-dake
Zacate Grande, Isla

The database contains information on 1555 volcanoes. That’s a big spreadsheet to manipulate by hand. This list is trimmed to give just the first example for each letter of the alphabet. There are 160 volcanoes whose name begins with ‘S’, but only one that begins with ‘X’ (Xianjindo in North Korea).

Get a list of all the volcanoes in Iceland.

SELECT "Volcano Name" FROM GVPVolcano
  WHERE "Country" IS "Iceland";
Volcano Name
Snaefellsjökull
Helgrindur
Ljósufjöll
Reykjanes
Krísuvík
Brennisteinsfjöll
Hengill
Hrómundartindur
Grímsnes
Prestahnukur
Hveravellir
Hofsjökull
Vestmannaeyjar
Eyjafjallajökull
Katla
Tindfjallajökull
Torfajökull
Hekla
Grímsvötn
Bárdarbunga
Tungnafellsjökull
Kverkfjöll
Askja
Fremrinamur
Krafla
Theistareykjarbunga
Tjörnes Fracture Zone
Öraefajökull
Esjufjöll
Kolbeinsey Ridge

If you wanted to plot them on a map, you can get their latitude and longitude, too.

SELECT "Volcano Name", Longitude, Latitude FROM GVPVolcano
  WHERE "Country" IS "Iceland";
Volcano Name Longitude Latitude
Snaefellsjökull -23.78 64.8
Helgrindur -23.25 64.87
Ljósufjöll -22.23 64.87
Reykjanes -22.5 63.88
Krísuvík -22.1 63.93
Brennisteinsfjöll -21.83 63.92
Hengill -21.32 64.08
Hrómundartindur -21.202 64.073
Grímsnes -20.87 64.03
Prestahnukur -20.58 64.6
Hveravellir -19.98 64.75
Hofsjökull -18.92 64.78
Vestmannaeyjar -20.28 63.43
Eyjafjallajökull -19.62 63.63
Katla -19.05 63.63
Tindfjallajökull -19.57 63.78
Torfajökull -19.17 63.92
Hekla -19.7 63.98
Grímsvötn -17.33 64.42
Bárdarbunga -17.53 64.63
Tungnafellsjökull -17.92 64.73
Kverkfjöll -16.72 64.65
Askja -16.75 65.03
Fremrinamur -16.65 65.43
Krafla -16.78 65.73
Theistareykjarbunga -16.83 65.88
Tjörnes Fracture Zone -17.1 66.3
Öraefajökull -16.65 64.0
Esjufjöll -16.65 64.27
kolbeinsey ridge -18.5 66.67

What can you tell me about Hekla?

SELECT * FROM GVPVolcano
 WHERE "Volcano Name" IS "Hekla";

There isn’t room to show all the columns as a table, but the data look like:

Volcano Number = 372070
Volcano Name = Hekla
Country = Iceland
Primary Volcano Type = Stratovolcano
Last Known Eruption = 2000 CE
Region = Iceland and Arctic Ocean
Subregion = Iceland (southern)
Latitude = 63.98
Longitude = -19.7
Elevation (m) = 1491.0
Dominant Rock Type = Andesite / Basaltic Andesite
Tectonic Setting = Tensional Oceanic

Which is taller, Mt Fiji or Mt Etna?

SELECT "Volcano Name", "Elevation (m)" FROM GVPVolcano
  WHERE "Volcano Name" is "Fuji"
  OR "Volcano Name" IS "Etna";
Volcano Name Elevation (m)
Etna 3330.0
Fuji 3776.0

Fuji wins! But Etna has been trying hard to catch up recently.

What are the 10 tallest volcanoes in the world?

SELECT "Volcano Name", Country, "Elevation (m)" FROM GVPVolcano
WHERE "Elevation (m)" IS NOT "NaN"
ORDER BY "Elevation (m)" DESC
LIMIT 10;
Volcano Name Country Elevation (m)
Ojos del Salado, Nevados Chile-Argentina 6887.0
Llullaillaco Chile-Argentina 6739.0
Tipas Argentina 6660.0
Incahuasi, Nevado de Chile-Argentina 6621.0
Cóndor, Cerro el Argentina 6532.0
Coropuna Peru 6377.0
Parinacota Chile-Bolivia 6348.0
Chimborazo Ecuador 6310.0
Pular Chile 6233.0
Solo, El Chile-Argentina 6190.0

They are all in western South America. I suppose that this region has the advantage of the Pacific plate being subducted under the South American continent and pushing up the Andes mountain range. The volcanoes just sit on top of it. This highlights the issue that your definition of the tallest may depend on where you are measuring from. Sea level, the Earth’s crust, the centre of the Earth? This video from BBC Planet Earth Unplugged explains this nicely.

Ojos de Salados, on the Chile-Argentina border, is 6888 m tall and last erupted around 700 AD. Source: http://volcano.si.edu/volcano.cfm?vn=355130

What are the 5 northernmost volcanoes in the world?

SELECT "Volcano Name", Country, Latitude, "Tectonic Setting" 
 FROM GVPVolcano
 ORDER BY Latitude DESC
 LIMIT 5;
Volcano Name Country Latitude Tectonic Setting
Unnamed Undersea Features 88.27 Tensional Oceanic
Unnamed Undersea Features 85.58 Tensional Oceanic
Jan Mayen Norway 71.08 Tensional Oceanic
Kolbeinsey Ridge Iceland 66.67 Tensional Oceanic
Tjörnes Fracture Zone Iceland 66.3 Tensional Oceanic

They all relate to the mid-ocean ridges, whereas the southern ones are all in Antarctica and are relate to subduction. There are no active volcanoes within 1,100 km of the South Pole.

Volcano Name Country Latitude Tectonic Setting
Morning, Mt. Antarctica -78.5 Intermediate Continental
Royal Society Range Antarctica -78.25 Intermediate Continental
Erebus Antarctica -77.53 Intermediate Continental
Waesche Antarctica -77.17 Intermediate Continental
Unnamed Antarctica -76.83 Intermediate Continental

Mount Morning, Antarctica, is the southernmost volcano in the world. Source: http://volcano.si.edu/volcano.cfm?vn=390017

What are the most volcanically active countries in the world?

SELECT Country, COUNT(Country) AS NumberOfVolcanoes FROM GVPVolcano
  GROUP BY Country
  ORDER BY NumberOfVolcanoes DESC
  LIMIT 5;
Country NumberOfVolcanoes
United States 184
Russia 154
Indonesia 142
Japan 114
Chile 78

If you stood all the volcanoes in the world on top of each other, could you reach the Moon?

SELECT SUM("Elevation (m)") AS TotalHeight FROM GVPVolcano;
TotalHeight
2533877.0

Not even close! 2,534 km is nothing compared to the 384,000 km distance to the Moon. It isn’t even a tenth as high as the orbits of geostationary satellites (36,000 km).

Which volcanoes have erupted since I was born?

You have to be a little bit tricky with this, as the eruption years in the database are in the form “2013 CE”, so you have to trim off the spare text and tell SQLite to treat it as a number (integer).

SELECT CAST(TRIM("Last Known Eruption", " CE") AS integer) AS Year, 
 "Volcano Name", Country FROM GVPVolcano
WHERE "Last Known Eruption" LIKE "% CE"
AND Year >= 1979
ORDER BY Year;
Year Volcano Name Country
1979 Curacoa Tonga
1979 Carrán-Los Venados Chile
1979 Arenales Chile
1979 Lautaro Chile
1979 Soufrière St. Vincent Saint Vincent and the Grenadines
1980 Kuchinoerabujima Japan
1980 On-take Japan
1980 Callaqui Chile
1981 Okataina New Zealand
1981 Shikotsu Japan
1981 Chachadake [Tiatia] Japan – administered by Russia
1982 Chirpoi Russia
1982 Chichón, El Mexico
1982 Wolf Ecuador
1983 Colo [Una Una] Indonesia
1983 Kusatsu-Shirane Japan
1984 Galunggung Indonesia
1984 Kaitoku Seamount Japan
1984 Mauna Loa United States
1984 Krafla Iceland
etc.

There were 273 of them, apparently. The database only lists the most recent eruption of each volcano, so Mt St Helens appears in 2008, and not 1980 in the snippet above. 57 volcanoes registered eruptions in 2013.

How many volcanoes are in the poorest countries of the world?

The real power of SQL comes from combining data from different tables. In this example, we use a list of the countries with Gross Domestic Product per Capita of less than $5,000 from the CIA World Factbook as a filter for volcanically-active countries. If you weren’t just doing this for fun, you’d need to check that all the country names are identical in the two tables.

SELECT COUNT("Volcano Name") AS NumOfCountries FROM GVPVolcano
WHERE Country IN (SELECT Country FROM CIAFactbook
WHERE "GDP - per capita (PPP)" < 5000);
NumOfCountries
482

So 482 of the 1555 active volcanoes are in the poorest 88 of the 261 countries in the CIA Factbook.

Which countries have the most volcanoes per head?

This example uses a JOIN.  JOINs are extremely powerful when you have data of different types in different tables. The number of volcanoes per head is very small, so citizens per volcano is presented here instead.

SELECT v.Country, 
 COUNT(v.Country) AS NumberOfVolcanoes,
 c.Population,
 c.Population / COUNT(v.Country)*1.0 AS CitizensPerVolcano
FROM GVPVolcano AS v
LEFT JOIN CIAFactbook AS c
ON v.Country=c.Country
WHERE Population IS NOT Null
  GROUP BY v.Country
  ORDER BY CitizensPerVolcano ASC
  LIMIT 5;
Country NumberOfVolcanoes Population CitizensPerVolcano
Tonga 18 120898 6716
Iceland 30 306694 10223
Dominica 5 72660 14532
Vanuatu 14 218519 15608
Saint Kitts and Nevis 2 40131 20065

The join works by matching the Countries column in each of the two tables. Unsurprisingly, I suppose, it turns out that volcanic island nations are the places where people live closest to active volcanoes.

A practical example for geologists

Another purpose of this post is to demonstrate how scientists can benefit from using databases in their work. As a geologist, I need to keep track of samples collected from the field and the results that I get from analysing them. A suitable database might contain the following tables with the following columns:

  • Site: Number, Latitude, Longitude
  • Sample: Number, SiteNumber, Type (e.g. lava, ash), Description
  • XRFData: SampleNumber, SiO2, Al2O3, NaO, K2O, …

The idea is that each table contains only one type of data and that each has one key column with unique values (e.g. site or sample numbers). You can then get your data with short queries.

For example, chemical composition data from the XRF instrument is commonly plotted on a ‘Total alkalis vs silica’ plot, which distinguishes between different magma types (e.g. basalt, andesite). You can extract the data with:

SELECT SampleNumber, 
  NaO+K2O AS TotalAlkali, 
  SiO AS Silica 
FROM XRFData;

To plot a map of SiO2 content in lava samples you can join the tables together.

SELECT Sample.Number, 
  Site.Latitude, 
  Site.Longitude, 
  XRFData.SiO2
FROM Sample
  LEFT JOIN Site ON Sample.SiteNumber=Site.Number
  LEFT JOIN XRFData ON Sample.Number=XRFData.SampleNumber
WHERE Site.Type IS 'lava';

If you do more analysis, you can simply add another table (e.g. SieveData, LiteratureData) without having to mess around with the data that you already have and, as long as your sample numbers are distinct, you can keep data from different projects together instead of scattered across many spreadsheets.

Getting started

There are two good programs for viewing SQLite databases. Both are free+open source software, so you can download and install them on as many machines as you like. SQLite Manager is an add-on for the Firefox web browser. It has a nice tool for importing data from csv files. Sqliteman is a small stand-alone package that runs on Linux (sudo apt-get install sqliteman on Ubuntu-like systems), Windows or Mac. There is also a command-line interface utility, sqlite3 that can import and export data.

Click here to download the SQLite file for the database used in this post. It includes data from the Smithsonian Institute’s Global Volcanism Program’s volcano spreadsheet and csv version of the CIA World Factbook from here.

I highly recommend the W3 Schools’ SQL tutorial for learning the language. It takes about an hour. It is also worth reading up on database structure, particularly normalization, to help you choose suitable tables.

Regular readers of volcan01010 may be surprised that I have got this far without mentioning Python, a free+open source programming language that is becoming central to a scientist’s toolbox. The sqlite3 module comes as standard and lets Python read and write directly from / to SQLite databases. The Zetcode SQLite Python tutorial gives a great introduction.  It’s often easiest to input and edit data as csv files and it’s straightforward to write a Python script to automatically import them as tables for analysis. As csv files are plain text, they are easily portable and can also be tracked with version control software.

Happy databasing…

Categories: Uncategorized

QGIS on the FLOSS Weekly podcast

Each week, the FLOSS Weekly podcast takes an hour-long look at exciting projects in the world of Free/Libre and Open Source Software.  It recently covered QGIS (or Quantum GIS), which is a really nice, user friendly, Geographical Information Systems package for plotting and analysing map data.  It is well worth a listen:

FLOSS Weekly Episode 270: QGIS

Some of the interesting things discussed include:

  • Use cases of the software, including flood hazard mapping and plotting utilities.
  • The popularity of QGIS amongst the international development and disaster management communities.
  • That much of the funding for the software development comes from local governments, who saw that they were spending so much money on licence and subscription costs for proprietary packages that it would be much better value to switch to open source and use the money to hire their own software developers to add features that they were missing.  (This is the same reason that the Spanish region of Valencia created another open source GIS package, gvSIG).
  • That even the software developers can’t agree on whether the name is pronounced “Cue – Gee – Eye – Ess” or “Cue – Jiss”.

You can learn more Quantum GIS, and download a copy, at the QGIS website.  It is my favourite tool for:

  • Georeferencing scanned field maps so that they can be imported into GIS packages (Georeferencer plugin)
  • Plotting up my own data with Google Maps (aerial photos or otherwise) or Open Street Map in the background.  This uses the QGIS Open Layers plugin.
  • Using the Map Composer to make nice pdf maps for printing, sometimes including data from GRASS GIS (another open source GIS package that has many tools for analysis).

To see a list of other useful free/open source tools for geoscientists, check out my post All the Software a Geoscientist Needs, for Free!

Categories: Uncategorized

Soup or Volcano?

Inspired by Erik Klemmetti’s recent blog post about the rise of the term ‘supervolcano’, and by the imminent launch of the Volcano Top Trumps card game, I’ve created a quick game of my own: Soup or Volcano?

The rules are simple: Look at the following five images and decide if they contain soup, or a volcano. Then scroll down to the answers and see how well you did.

Soup or Volcano?

1.

erebus_lakeImage by Dr Nelia Dunbar, http://erebus.nmt.edu

2.

minestroneImage: Tesco.com

3.

pahtoe_largePhoto: JD Griggs, USGS

4.

tomato_soupImage: Sir Nico, Wikimedia Commons

5.

colima_domeImage: Will Hutchison, Oxford University

Now scroll down for the answers…

.

.

.

…a wee bit further…

.

.

The Answers

  1. Volcano. The lava lake of Mount Erebus, Antarctica, is a bubbling cauldron of molten magma. The bubbles burst with a ‘pop’ of low frequency sound (called infrasound). By analysing this, volcanologists can work out the size and pressure of the bubbles and how much gas is released in each.
  2. Soup. A delicious minestrone. Minestrone soup actually has a lot in common with magma. Both contain a hot liquid (tomatoey-goodness versus molten rock), solid bits (croutons, pasta shapes and vegetables versus crystals) and often gas bubbles (steam versus a mixture of steam, carbon dioxide, sulphur dioxide, chlorine, fluorine and others).
  3. Volcano. A basalt lava flow a Kilauea, Hawaii. This is erupted a temperatures of over 1000°C. As it cools, the surface develops a skin, a bit like the skin on soup. Molten lava can flow inside the skin, and the whole flow gets thicker from within. There are some great time-lapse videos of this on YouTube.

  4. Soup. A thick, creamy tomato soup. The measure of the ‘thickness’ or ‘stickiness’ of a liquid is the viscosity and it is measured in units called Pascal-seconds (Pa s). The viscosity of water is about 0.001 Pa s and I would guess that this soup is around 1 Pa s. The viscosity of magma depends on lots of things such as the chemical composition, the temperature, and how much water is dissolved in it. Crystal and water-free basalt has a viscosity of ~10 to ~100 Pa s.  Other types of magma can have viscosities of over 1,000,000 Pa s.
  5. Volcano. The crater of Colima volcano, Mexico, contains a lava dome. The lava here is of andesite or dacite composition is much more viscous than the basalts in Hawaii. The dome is covered in blocks of broken, solidified lava, but the perfectly flat top surface is a clue that there is liquid underneath. New magma oozes into the crater, then spills over the edge and tumbles down the side in spectacular glowing rockfalls.

    http://vimeo.com/62885359

How well did you do?

  1. 5 points: Congratulations! Your powers of separating food from large bits of rock are impressive. Come back next week to try your luck against Level 2: Pasta or Planet? Or maybe not.
  2. 0 to 4 points: Are you serious? This was not a hard quiz, but your results were terrible. I recommend booking a trip to Kilauea in Hawaii, or Stromboli in Italy to see some real volcanoes in action. Don’t forget to pack a spoon.
Categories: Uncategorized