gcmt eventid

I have a script that pulls synthetics from the IRIS/syngine instaseis webservice using, e.g.,
obspy…read() + “eventid=GCMT:C201802061550A”.

I’m trying to build on this by either looking up the GCMT eventid for a given event,
or using the GCMT eventid to find the event parameters.

i.e., I’d like to either:

  1. specify the GCMT eventid for a particular event and
    use it to query one of the fdsn clients (e.g., IRIS) to get the corresponding event origin time,
    lat, lon, etc)

ie, I can go to http://ds.iris.edu/spud/momenttensor or http://www.globalcmt.org/CMTsearch.html
and find the GCMT eventid for a specified event.

But is there a way to use in this in obspy (e.g., catalog, get_event ?) to find the event specs ?


  1. use the specified origin (time, lat, lon) to search the GCMT programatically for the corresponding gcmt eventid.

Is there any way to query one of the catalog providers for GCMT eventid in obspy ?

I’ve looked through the obspy docs but I can’t tell which catalogs are supported and/or if ‘gcmt’ is
used for anything beyond syngine/instaseis, where it is passed to the IRIS web service and used to
look up the event parameters (lat, lon, origin, moment tensor) needed to sum the green’s functions
to form the synthetic (?)



Hi Mike,

a couple of things:

(1) I did not get if you are using ObsPy’s syngine client. To be sure you are aware of it:

(2) We currently have no “clients” for the spud mts or the GCMT website. These would most likely require some HTML parsing which tend to be tedious to maintain.

(3) In these cases I usually just download all GCMT events and manually query these files:

(4) The ISC webservice can give you GCMT MTs. But their service (at least used to) implements very strict rate limits so it is tedious to use it.

(5) Instead of passing the event id you can also pass the event parameters including MT components directly to syngine.

(6) Instaseis () can use syngine as a backend and has some functionality to convert ObsPy event objects (and thus any event file ObsPy can read) to proper syngine queries.



Hi Lion,

I have a call like this in my python/obspy script:

st_synth = read(“http://service.iris.edu/irisws/syngine/1/query?%s
“model=%s&label=Tutorial&format=miniseed” % (receiver,eventid,model))

Right now I’m picking up the event info (origin, lat, lon) from a config.yml file.

I wanted to replace this with just the gcmt eventid to save time, if there were a
way to look up the event info from gcmt eventid.

It looks to me like obspy can query other catalogs (e.g., ISC, NEIC ?) and get info for events
within a range (location box, time box, etc). I guess each of those catalogs has its own
eventid numbering; I thought maybe one of them might also contain the gcmt eventid as
an event parameter (as opposed to primary key).


Hi Lion,

(2) We currently have no “clients” for the spud mts or the GCMT website. These would most likely require some HTML parsing which tend to be tedious to maintain.

Should anyone need to programmatically access data products in SPUD there is no need to parse HTML, there is a whole web service interface for SPUD. From the SPUD landing page, click Help => Spudservices user guide and you get to:


The usage can get complicated because the products themselves are complicated, but simple things like pulling a GCMT out based on our internal ID or the GCMT ID are easy, that’s how Syngine does it internally.

For example, getting the NDK for a GCMT based on the GCMT ID is this:



Thanks Chad! - the delineation between obspy/syngine/iris web services is a bit murky for me.

It seems I can just do:

import requests
response = requests.get(‘http://ds.iris.edu/spudservice/momenttensor/gcmtid/C201802061550A/ndk’)

and then parse response.content to get the event info.


@Chad - Also thanks from me! I was not aware of the SPUD API. I’ll probably add a client to ObsPy as I have a personal need for this.

@Mike - you can also directly read the ndk file with

cat = obspy.read_events(“http://ds.iris.edu/spudservice/momenttensor/gcmtid/C201802061550A/ndk”)

which will parse it to ObsPy’s event class.


Hi Lion,
I did stumble on your ndk parser, but I don’t see that it has methods to return lat,lon,origin, moment tensor.
It’s not clear to me if I need to convert ndk to quakeml to see everything (?)

cat = read_events(‘http://ds.iris.edu/spudservice/momenttensor/gcmtid/C201802061550A/ndk’)
events = cat.events
for event in events:
origin = event.preferred_origin // This looks like an id to use with some other catalog ??


<bound method Event.preferred_origin of Event(resource_id=ResourceIdentifier(id=“smi:local/ndk/C201802061550A/event”), event_type=‘earthquake’, event_type_certainty=‘known’, preferred_origin_id=ResourceIdentifier(id=“smi:local/ndk/C201802061550A/origin#cmtorigin”), preferred_magnitude_id=ResourceIdentifier(id=“smi:local/ndk/C201802061550A/magnitude#moment_mag”), preferred_focal_mechanism_id=ResourceIdentifier(id=“smi:local/ndk/C201802061550A/focal_mechanism”))>

Hi Mike,

within ObsPy it does not really matter that much if your data originated as QuakeML or an NDK (or any of the other supported formats). They all are parsed to the same objects. The event object is more or less a verbatim copy of QuakeML’s data model as it is the most comprehensive of all formats.

Regarding your issue: its a method you have to call. I prefer to do (as preferred children might not be set):

origin = event.preferred_origin() or event.origins[0]

origin.latitude, origin.longitude, origin.time, …

fm = event.preferred_focal_mechanism() or event.focal_mechanisms[0]

mt = fm.moment_tensor.tensor