Thomas Lecocq @ the Royal Observatory of Belgium

Menu

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 whole did not behave normally. The process is simple : Detection → Send Email to sms…

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 single archive. Sometimes, for random reasons, some ew modules fail and crash and are marked…

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 develop! I’ll explain the ultimate goal in the next tutorials, but today, I’ll focus on…

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 first map we create will simply show a 1 degree-square zone including Sudelfeld (where I…

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 love it ! Link: Maps-For-Free Relief

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 values, one can identify outliers. Here is a small Python implementation, generalised to “Leave N…

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 21-something years. It all started when I was 9, in the primary school classroom where…

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 Rate” per month, splitting events in magnitude bins, graphically speaking: To get the data, we…

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, Enthought published their latest distribution called “Canopy”. This distribution marks a clear change in the…

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 ! Some great guys developed “DosBOX”: a super emulator for old-but-working DOS applications ! All…

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 something was visible. The closest IRIS seismic station to this place is II.ARU (see location),…

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 the end at the bottom (along the “y” axis) and centred on the origin time…

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 2009 one, confirmed by the location provided by global monitoring networks (USGS, GEOFON). To pythonise…

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 catalogue contains a lot of different stuff, i.e. quarry blasts, mining-induced events, army-directed WWI&II bombs…

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 group sparse data into 5 seconds bins. The magic of pandas is that, when you…

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 thus rewrote “Tutorial 7” to use this module : The goal: The data: http://www.gadm.org/ saved…

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 on smartphones and tabs !!

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 a symbol, used by one Placemark. Below, you’ll see a view of the beachball plot…

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 2 hours to have a working version of the software, with: a GUI to plot…

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: data = np.random.randint(10000,size=len(times)) Now, we will modify the example from tutorial 03: def group(di): return…

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 prepare an example, I’ve created a set of random datetimes like this : N =…

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 679619 Load them in the same fashion: plates, number = np.loadtxt(‘newplates.txt’,skiprows=1,unpack=True) xdates2 = [datetime.datetime.strptime(str(int(date)),’%Y’) for…

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 maintained, I find it confusing. Maybe because they made the choice of a Gregorian-based calendar,…

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, but it should be quite straightforward. This script assumes you start from a ABEM S4K…

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 the namespace- approach is quite not compatible with py2exe (will maybe/surely change one day)… …

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 !! Goal: Pack an ETS-based application in a executable .exe file for windows Keys to…

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 from a “centre” point, a circle. The goal: Drawing circles of a given radius around…

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 : The goal: Plotting great circles with Basemap, but knowing only the longitude, latitude, the azimuth…

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, please, use the Comment box below to tell me ! I’ll do my best to…

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 GADM shapefile, get region names, and plot filled regions with random color ! The process:…

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 : print a[::4] will output: array([0., 4., … , 96., 100.]) I love Numpy !

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 = np.where(countries[‘ISO’] == iso) country = countries[‘country’][index][0] Yeah, that’s fun ! The numpy.where method takes two…

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 and large, quite good for my python pre formatted code snippets. I also like the…

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 of Europe ! In brief: do that: Step 0: Input Preparation I found some statistics…

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 to draw a pie from scratch, in a method that allows a custom number of…

[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 work, I had to manually import all packages used, surely the Wx backend. It’s not…

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/

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/

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 using the numpy.ma module : import numpy.ma as ma Mlon = ma.masked_outside(lon, 5.6, 7.5) #…

I finally managed to install Enthought Python Distribution on my Windows 7 64bit box. In fact, I installed EPD 32bits (I’m a student, the academic licence is free). So, the solution was in the Mailing List Archive (enthought-dev) : Disable the UAC (User Account Control) of Windows 7 in order to let the msi installer…

Tired of using Res2Dinv ? Why not switching to another software, and… FREE ! Andrew Binley provides some excellent programs on his website. I have created some python scripts for easing the I/O to R2. These scripts will soon be available here, Andrew will also provide our compiled version on his website, so you don’t…

I just discovered that I was using from griddata import griddata in quite a lot of python scripts I wrote for scientific data plotting. While struggling to recompile it under my new win7 x64 box, I googled a little and found out that it’s now included in matplotlib (which was already installed…). So, now, I’ll…

Meta

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Cookie settingsACCEPT

Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.

Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.

Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.