# Event information from catalog object

**URL:** <https://discourse.obspy.org/t/event-information-from-catalog-object/208>\
**Category:** Users Mailing List Archive\
**Tags:** archive\
**Created:** [September 5, 2013, 4:33pm UTC](https://discourse.obspy.org/t/event-information-from-catalog-object/208 "2013-09-05T16:33:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pattylin](https://discourse.obspy.org/letter_avatar_proxy/v4/letter/p/f17d59/32.png) [@pattylin](https://discourse.obspy.org/u/pattylin)\
**Post date:** [September 5, 2013, 4:33pm UTC](https://discourse.obspy.org/t/event-information-from-catalog-object/208/1 "2013-09-05T16:33:13Z")

</div>

Hi All,

I would like to get event information separately.

details:

#!/usr/bin/env python  
from obspy.iris import Client  
from obspy import UTCDateTime  
client = Client()  
starttime = UTCDateTime("2011-04-11")  
endtime = UTCDateTime("2011-04-12")  
EVTs = client.getEvents(starttime=starttime, endtime=endtime, minmag=6.7)  
print(EVTs)

output:  
In [7]: print(EVTs)  
1 Event(s) in Catalog:  
2011-04-11T08:16:12.730000Z | +37.001, +140.401 | 6.7 MW

I try to get time / lat/ lon/ depth/ ma as its attribute.  
I cannot find it.

In [8]: EVTs.  
EVTs.append EVTs.copy EVTs.description EVTs.filter EVTs.write  
EVTs.clear EVTs.count EVTs.events EVTs.plot  
EVTs.comments EVTs.creation\_info EVTs.extend EVTs.resource\_id

any one knows how to call those parameters separately?

Thank you so much.

Cheers,  
Patty

---

<div class="post-metadata">

**Author:** ![Emily\_Wolin](https://discourse.obspy.org/letter_avatar_proxy/v4/letter/e/838e76/32.png) [@Emily\_Wolin](https://discourse.obspy.org/u/Emily_Wolin)\
**Post date:** [September 5, 2013, 5:56pm UTC](https://discourse.obspy.org/t/event-information-from-catalog-object/208/2 "2013-09-05T17:56:30Z")

</div>

Hi Patty,  
I have not worked with Event objects very much, but it looks like you can access the attributes you want in this way:  
Your EVTs object is a list of events (in this case, there is only one in the list).  
To create an object with just this event in it, and see its attributes, I did this:

In [8]: myevent=EVTs[0]

(try myevent. to see all of the attributes now…)

In [9]: myevent.origins  
Out[9]:  
[Origin  
resource\_id: ResourceIdentifier(resource\_id=“smi:[www.iris.edu/ws/event/query?originId=9535656](http://www.iris.edu/ws/event/query?originId=9535656)”)  
time: UTCDateTime(2011, 4, 11, 8, 16, 12, 730000)  
latitude: 37.001  
longitude: 140.401  
depth: 11.0  
creation\_info: CreationInfo(author=‘NEIC’)]

In [11]: myevent.origins[0][‘latitude’]  
Out[11]: 37.001

So it looks like each Event can have a list of different origins associated with it (though again, there is only one for this event). You could do a similar thing to get the longitude, time, and depth. The “magnitudes” attribute also seems to be structured in a similar way:

In [18]: myevent.magnitudes  
Out[18]:  
[Magnitude  
resource\_id: ResourceIdentifier(resource\_id=“smi:[www.iris.edu/ws/event/query?magnitudeId=14183133](http://www.iris.edu/ws/event/query?magnitudeId=14183133)”)  
mag: 6.7  
magnitude\_type: ‘MW’  
origin\_id: ResourceIdentifier(resource\_id=“smi:[www.iris.edu/ws/event/query?originId=7916388](http://www.iris.edu/ws/event/query?originId=7916388)”)  
creation\_info: CreationInfo(author=‘GCMT’)]

In [19]: myevent.magnitudes[0][‘mag’]  
Out[19]: 6.7

Hope that helps! If there is a better way of explaining or accessing Event attributes, please let me know…

Emily

---

<div class="post-metadata">

**Author:** ![pattylin](https://discourse.obspy.org/letter_avatar_proxy/v4/letter/p/f17d59/32.png) [@pattylin](https://discourse.obspy.org/u/pattylin)\
**Post date:** [September 5, 2013, 7:09pm UTC](https://discourse.obspy.org/t/event-information-from-catalog-object/208/3 "2013-09-05T19:09:34Z")

</div>

Hi Emily,

thank you so much.. This is what I am looking for.

It’s not so straightforward.  
did try EVTs[0].… but didn’t see the related attributes

thanks!!!

Cheers,  
Patty

---

<div class="post-metadata">

**Author:** ![megies](https://discourse.obspy.org/user_avatar/discourse.obspy.org/megies/32/9_2.png) [@megies](https://discourse.obspy.org/u/megies)\
**Post date:** [September 6, 2013, 8:29am UTC](https://discourse.obspy.org/t/event-information-from-catalog-object/208/4 "2013-09-06T08:29:46Z")

</div>

Hi Patty,

If you are puzzled by the setup of all the event related objects, I can  
recommend a look at the QuakeML standard. It is quite complex,  
admittedly, but it makes sense and the ObsPy Event structure is modeled  
pretty closely around it (as QuakeML is the standard Event/Catalog  
exchange format right now).

> **[REC](https://quake.ethz.ch/quakeml/docs/REC?action=AttachFile&do=view&target=QuakeML-BED-20130214a.pdf)**
>
> 20 B

best,  
Tobias
