Our Belgian Earthquake Emergency Report System (BEERS) detects abnormal visitor fluxes on the http://www.seismologie.be website and sends emails & SMS whenever some threshold is met. Recently, we have upgraded our sms machinery to FoxBox and for some weird reasons, the…
Earthworm statmgr replacement
At ROB, we don’t use Earthworm (ew) for real time acquisition or monitoring, but we have installed it on our computer at the Kawah Ijen observatory in order to group all seismic fluxes on a single machine, and thus a…
Playing with PICs – The beginning
Well, usually, “The Beginning” tends to come after some trilogy, but, eh!, who cares ! I’ve been playing with Microchip PICs for quite a number of years, mostly with small-and-somehow-useless blink-a-led projects. Now, I’ve got a project I want to…
Shaded Relief Map in Python
Today, we’ll combine different cool stuff: cartopy, Google Maps tiles, SRTM elevation data and shaded relief maps ! We will need cartopy (+ dependencies), which you can install from source, or from C. Gohlke’s prebuilt binaries for Windows users. The…
Relief Maps in Google Earth
Ok, this must be many years old, but I found it today, so let’s call it a Discovery. The following link gives you the ability to download a network-linked colour-coded relief overlay from Maps-For-Free, but directly in Google Earth. I…
Jacknife
The Jacknife is also sometimes called the “Leave One Out” method, and is a method to somehow evaluate the stability of statistics done on data. By leaving one element out of the input array and studying the mean of the…
I’m 30…
24 September 1983. I’m born. Since then, damn, already 30 years… I’m not going to talk about my life, it’s not even interesting to myself. I’d rather give a brief history of the IT background I’ve learnt during the last…
Seismicity Rate using Obspy and Pandas
Pandas and Obspy are incredible pieces of software that definitively make my life easier ! In this tutorial, we will get seismic Event data from IRIS using Obspy, then analyse the catalog using Pandas, to end up with a “Seismicity…
Pack an Enthought Traits app inside a .exe using py2exe (Canopy Edit)
10 months ago, I published the updated version of my tutorial to pack an Enthought TraitsUI based application inside an .exe Windows Executable file, using a standard Python 2.7 install and the Enthought Tool Suite 4.0 (ETS4.0). In April 2013,…
Old 16bit DOS programs on Windows 7 (x64)
We needed to execute an old-but-working 16bits program to locate earthquakes called “HypoEllipse” (source), but calling it from the Windows 7 x64 boxes resulted in a nice : Bam ! Not working, sorry for you… No ! I say No…
Meteor in Russia – Seismic Signal ?
Very early this morning, a meteor lit up the skies of Russia, somewhere close to Ekaterinburg. Same as for the Korean Boom Boom, we wanted to have a look at the seismic data of a close-by station to check if…
Plot waveforms of events on a dates axis
Following a question from my dear colleague Devy, here is how to plot a set of events, occurring at random moments in time. The idea is to plot the waveform of each event with the beginning at the top and…
North Korean nuclear tests with Obspy
This morning, North Korea tested some nuclear “bomb” somewhere in the middle of the country (confirmed by Pyongyang officials and CTBTO), and many seismic sensors worldwide recorded the triggered waveforms. The location of the test is the same as the…
Seismicity Map and Rate using Basemap and Pandas
Imagine we want to plot a map of the seismic activity in NW-Europe and, at the same time, count the number events per month. To get a catalogue of earthquakes in the region, one can call the NEIC (note: this…
New Tutorial Series: Pandas
In the coming months, I’ll prepare some tutorials over an excellent data analysis package called pandas ! To show you the power of pandas, just take a look at this old tutorial, where I exploited the power of itertools to…
Matplotlib Basemap tutorial 10: Shapefiles Unleached, continued
Following the comments on this year-old post I’ve had a look at pyshp which seems a little more maintained (the last line in the changelog is 1 year old…), and it is indeed a quite nice piece of code. I…
Honoured !
This blog is cited in the excellent book of Wes McKinney: “Python for Data Analysis” (eds.O’Reilly)! Oh yeah! I’m proud! Thanks Wes!
New Theme
Geophysique.be has been updated to WordPress 3.5 and while the previous theme is still compatible with this new version, I’ve decided to switch to the very clean TwentyTwelve theme. This theme is completely responsive, so the site is now viewable…
Easily create .kml file to plot focal mechanisms in Google Earth
Plotting focal mechanisms in Google Earth is an annoying task to do manually. I wrote a script to convert a text file to beach balls using the obspy package and then to create the corresponding KML file. Each ball is…
Breaking News: new Author !
I’m reallllly happy to say that from now on, Dimitri Kusters will also post snippets of code related to his PhD research on this Blog! Welcome!
Last Earthquakes tool – ETS powered
While in Indonesia last July, I created a small tool for the Kawah Ijen observers to allow them to search and plot teleseismic events and to calculate theoretical arrival times of the waves at the Ijen stations. It took roughly…
Matplotlib & Datetimes – Tutorial 04: Grouping & Analysing Sparse Data
To extend the previous tutorial (see here), we define a data array that has some information about the event that occurred for each datetime. The plot of data vs time now looks like: The data array is constructed with numpy.random:…
Matplotlib & Datetimes – Tutorial 03: Grouping Sparse Data
New tutorial, more advanced this time ! Let’s say we have a number of observations, like occurrences of earthquakes, or visitors connecting to a webserver, etc. These observations don’t occur every second, they are sparse on the time axis. To…
Matplotlib & Datetimes – Tutorial 02: Bar Plot
To add some interesting information to the previous tutorial, I’ve downloaded the number of licence plates given for new cars in Belgium for the same time span: 2005 587764 2006 633570 2007 644313 2008 652590 2009 571001 2010 642086 2011…
Matplotlib & Datetimes – Tutorial 01: Fuel Prices
Anyone who has played a little with dates know how painful it can be… Even more when you want to plot this data !! Matplotlib provides (link) a dates API, but to be honnest, even if the documentation is well…
R2 input/output script [aka …Use R2! (continued)]
Following a very old post (link), and questions from Matthias and Kevin, I’ve finally managed to test the R2-related scripts I wrote long-long time ago… I’m really sorry, but don’t quite have the time now to really document all functions/actions,…
Youdo.be
Le site web de ma soeur et de ma mère est en ligne ! Visitez, réservez ! Ca détend ! http://www.youdo.be !
Séisme – Aardbeving – Erdbeben in Netherland/Germany/Nederland/Deutchland/Belgique/Belgien/Belgie
Dag iedereen, Bonjour à tous, Gisterenavond om 21u02, was er een aardbeving van magnitude ML=4.3 bij de grens tussen Duitsland en Nederland, 15 km ten zuidoosten van Nijmegen. Het werd gevoeld door veel mensen in Brussel, Leuven en Luik. Iedereen…
Using Obspy modules with py2exe
Obspy is a really cool package for seismological observatories. In fact, it’s a super set of packages. They are distributed using eggs and have a nice way of declaring namespaces and entry points. The disadvantage, in my case, is that…
Aardbeving in West-Vlaanderen
Vanavond om 20:38, een aardbeving vond plaats in West-Vlaanderen. Het werd gevoeld door de bevolking in de dorpen van Ruddervoorde, Zedelgem en misschien zelfs tot Brugge. Iedereen die heeft het gevoeld is uitgenodigd om de enquête in te vullen op…
Pack an Enthought Traits app inside a .exe using py2exe (ETS 4.0 Edit)
In October 2010, I published a small tutorial on how to build a .exe Windows executable for ETS (Enthought Tool Suite) 3.5.0 -based applications. Today, I present the edited version of the setup script, to match the new Enthought Namespace…
New on Géophysique.be: Gallery
Everyone used to search for code snippets on the web know the importance of a “Gallery” linking to all examples and tutorials… So, here is my really ugly Gallery :
Matplotlib Basemap tutorial 09: Drawing circles
In the previous tutorial, I defined a “shoot” method to compute the landing point of a shoot from one point, to a given azimuth and distance. Using this logic, it’s possible to find the points situated at a given distance…
Matplotlib Basemap tutorial 08: Shooting Great Circles
Following a question from Ricardo Gama (see his comment), I’ve prepared this new tutorial. He wondered if Basemap has a function similar to the track1 function in matlab (you know, that crappy costly thing…)… Here is what I obtained :…
Matplotlib Basemap: Tell me what you need !
Dear visitors, I’m always searching new ideas of preparing new tutorials for things doable with Basemap, but I’d like these examples to be as useful as possible, which means : If you have something you would like to appear here,…
Matplotlib Basemap tutorial 07: Shapefiles unleached
New version here Following a question in the matplotlib mailing list, I dug inside the code of readshapefile, in order to gain power : The goal: The data: http://www.gadm.org/ saved inside a new “borders/” folder ! The idea: Opening a…
San Francisco is full of waves !
Live from AGU Fall Meeting 2010, I can’t resist to share some waves with you all !!
Matplotlib Fonts (plots, basemaps, etc.)
Here is the trick (well documented on the matplotlib webpage) to define the font family and size of what appears on your matplotlib plot:
Numpy Trick 01
I usually forget how much Numpy makes life easy : Say, you have a 101 element array, e.g.: import numpy as np a = np.linspace(0,100,101) and you want to take every 4th item in that array, that’s as easy as…
Numpy.ma not always necessary
I just discovered that there is an easier way to do this (e.g. from tutorial06): import numpy.ma as ma mask = ma.masked_where(countries[‘ISO’] != iso, countries[‘ISO’]) country = ma.array(countries[‘country’],mask=mask.mask).compressed()[0] by using the built-in numpy.where method: import numpy as np index =…
Don’t be scared …
Don’t be scared, you are on geophysique.be ! I’m just trying some new themes for this blog/website. I want to make it more readable, but also easier to search/scroll. I kinda like this “eos” theme, the “content” column is nice…
Matplotlib Basemap tutorial 06: Real Case pie charts
Here is a new tutorial that will include “a bit of all” tutorials previously published on this blog and some new cool stuff to play with ! Idea: Find some resources on the Internet and plot them on the map…
Matplotlib Basemap tutorial 05 : Adding some pie charts !
Hi folkes, Following a question by Gui on this website, I checked the “how to” draw pie charts on a basemap plot ! Here below I generalise the example given by Manuel Metz on the matplotlib website. The idea is…
Pack an Enthought Traits app inside a .exe using py2exe !
[DEPRECATED if you use ETS 4.0 — see the new version] So, guys, today is a great day, BIG news : I succeeded packaging an Enthought Traits UI script inside a standalone package. Keys to remember: To get things to…
Update to ETS 3.5.0 !
Great news from last week : ETS 3.5.0 is out ! Note the change in the source-download process.. Now using an unique ets.py file instead of the ProjectTools ! http://blog.enthought.com/open-source/enthought-tool-suite-3-5-0-released/ http://www.optiniche.com/blog/117/wordpress-trackback-tutorial/
Matplotlib Basemap tutorial 04 : using inside_poly() to select data !
# remember to define the ax instance : ax = plt.subplot(111) zone = “Roetgen – Monschau” x,y = m(6.15,50.41) x2,y2 = m(6.59,50.67) x3,y3 = m(6.34,50.855) x4,y4 = m(5.83,50.65) data = np.array(([x,x2,x3,x4], [y,y2,y3,y4])) p = Polygon(data.T,edgecolor=’red’,linewidth=1.5,facecolor=’none’) ax.add_artist(p) Note that we have…
Earthquake | Séisme | Erdbeben : Frankfurt (Hofheim am Taunus)
During the night, an earthquake struck the vicinity of Hofheim am Taunus. If you felt this earthquake, please fill in the inquiry on the “Royal Obseravtory of Belgium | University of Cologne” website : Link = http://seismologie.oma.be/
Matplotlib Basemap tutorial 03 : Masked arrays & Zoom
Here, we will focus on adding a “zoom box” on the top left corner of the plot. But before that, we will mask a part of the earthquakes, in order to have a “cleaner” map ! This is achieved by…
Matplotlib Basemap tutorial 02 : Let’s add some earthquakes !
Now, let’s imagine we have a dataset containing latitude/longitudes of earthquakes, plus their depth and magnitude. Of course, you don’t always have this dataset available, so let’s build a fake one : import numpy as np lon = np.random.random_integers(11,79,1000)/10. lat…
Matplotlib Basemap tutorial 01 : Your first map
# # BaseMap example by geophysique.be # tutorial 01 from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt import numpy as np fig = plt.figure(figsize=(11.7,8.3)) #Custom adjust of the subplots plt.subplots_adjust(left=0.05,right=0.95,top=0.90,bottom=0.05,wspace=0.15,hspace=0.05) ax = plt.subplot(111) #Let’s create a basemap around Belgium m…