## 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…

## 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,…

## 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…

## 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,…

## 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…

## 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 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…

## 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…

## 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…

## Installing EPD on Windows 7 (64bits)

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…

## Stop using griddata, use matplotlib.mlab.griddata !

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…