bug in obspy.neries?

Dear obspy users,

I wonder if I haven't come across a bug in obspy.neries.
If i get the latest events in list format, there is an event which is duplicated (result is at end of text):
We can see twice event 20120314_0000010 with origin 775108 and there is no difference between the two entries.
If I get the result in xml format, this entry is not duplicated, the result is identical to what the webservice returns, so it seems to be specific to the list format output processing of the obspy.neries package.
Not critical, so I'm just posting this info in case it's useful.

Best regards,

Oliver

Sample showing error run in ipython :

In [1]: import pkg_resources

In [2]: pkg_resources.require('obspy.neries')
Out[2]:
[obspy.neries 0.5.1 (/usr/lib/python2.7/site-packages/obspy.neries-0.5.1-py2.7.egg),
  suds 0.4 (/usr/lib/python2.7/site-packages/suds-0.4-py2.7.egg),
  obspy.core 0.6.2 (/usr/lib/python2.7/site-packages/obspy.core-0.6.2-py2.7.egg),
  numpy 1.6.1 (/usr/lib/python2.7/site-packages)]

In [3]: from obspy.neries import Client

In [4]: client = Client()

In [5]: events = client.getLatestEvents(format='list')

In [6]: for elem in events: print elem
{'author': u'KAN', 'event_id': u'20120314_0000012', 'origin_id': 775109, 'longitude': 42.713, 'datetime': UTCDateTime(2012, 3, 14, 5, 49, 39), 'depth': -5.0, 'magnitude': 3.1, 'magnitude_type': u'ml', 'latitude': 37.481, 'flynn_region': u'TURKEY-SYRIA-IRAQ BORDER REGION'}
{'author': u'KAN', 'event_id': u'20120314_0000011', 'origin_id': 775101, 'longitude': 43.373, 'datetime': UTCDateTime(2012, 3, 14, 5, 36, 27), 'depth': -5.7, 'magnitude': 2.6, 'magnitude_type': u'ml', 'latitude': 37.784, 'flynn_region': u'TURKEY-IRAQ BORDER REGION'}
{'author': u'NEIR', 'event_id': u'20120314_0000009', 'origin_id': 775095, 'longitude': 161.105, 'datetime': UTCDateTime(2012, 3, 14, 5, 8, 28), 'depth': -107.2, 'magnitude': 4.9, 'magnitude_type': u'mb', 'latitude': -10.272, 'flynn_region': u'SOLOMON ISLANDS'}
{'author': u'NEIR', 'event_id': u'20120314_0000008', 'origin_id': 775093, 'longitude': -95.191, 'datetime': UTCDateTime(2012, 3, 14, 5, 5, 40), 'depth': -118.8, 'magnitude': 4.0, 'magnitude_type': u'mb', 'latitude': 17.865, 'flynn_region': u'VERACRUZ, MEXICO'}
{'author': u'MIX', 'event_id': u'20120314_0000010', 'origin_id': 775108, 'longitude': 142.49, 'datetime': UTCDateTime(2012, 3, 14, 4, 43, 2), 'depth': -40.0, 'magnitude': 4.8, 'magnitude_type': u'mb', 'latitude': 25.198, 'flynn_region': u'VOLCANO ISLANDS, JAPAN REGION'}
{'author': u'NEIR', 'event_id': u'20120314_0000010', 'origin_id': 775097, 'longitude': 142.56, 'datetime': UTCDateTime(2012, 3, 14, 4, 43, 2), 'depth': -40.2, 'magnitude': 4.8, 'magnitude_type': u'mb', 'latitude': 25.14, 'flynn_region': u'VOLCANO ISLANDS, JAPAN REGION'}
{'author': u'GSRC', 'event_id': u'20120314_0000010', 'origin_id': 775107, 'longitude': 142.43, 'datetime': UTCDateTime(2012, 3, 14, 4, 43, 2), 'depth': -50.0, 'magnitude': 4.9, 'magnitude_type': u'mb', 'latitude': 25.17, 'flynn_region': u'VOLCANO ISLANDS, JAPAN REGION'}
{'author': u'GFZ', 'event_id': u'20120314_0000010', 'origin_id': 775088, 'longitude': 142.8, 'datetime': UTCDateTime(2012, 3, 14, 4, 43, 2), 'depth': -10.0, 'magnitude': 4.8, 'magnitude_type': u'm ', 'latitude': 25.4, 'flynn_region': u'VOLCANO ISLANDS, JAPAN REGION'}
{'author': u'MIX', 'event_id': u'20120314_0000010', 'origin_id': 775108, 'longitude': 142.49, 'datetime': UTCDateTime(2012, 3, 14, 4, 43, 2), 'depth': -40.0, 'magnitude': 4.8, 'magnitude_type': u'mb', 'latitude': 25.198, 'flynn_region': u'VOLCANO ISLANDS, JAPAN REGION'}
{'author': u'DDA', 'event_id': u'20120314_0000006', 'origin_id': 775083, 'longitude': 28.996, 'datetime': UTCDateTime(2012, 3, 14, 4, 12, 48), 'depth': -5.6, 'magnitude': 3.8, 'magnitude_type': u'ml', 'latitude': 39.126, 'flynn_region': u'WESTERN TURKEY'}

Dear Oliver,

all results of the "list" format is directly retrieved from the NERIES
portal - the only thing we do within ObsPy is converting it from a JSON
format into a list of dicts which should not add any new or duplicate
entries.

Additionally I can't reproduce this anymore as it seems to be fixed in
the database of NERIES itself.

So neither

events = client.getLatestEvents(format='list', num=2500)
[ev for ev in events if ev['origin_id']==775108]

nor

events = client.getEventDetail('20120314_0000010', format='list')
len(events)

4

[ev for ev in events if ev['origin_id']==775108]

returns an event with origin_id 775108 - therefore something has been
corrected within the database and I can't reproduce this.

Also just checking for duplicate origin_ids within this 2500 event list
was negative. So I'm out of options for now. However should you ever
have the issue again - please enable the debug option during client
initialization

client = Client(debug=True)

this will show the actual HTTP request to the NERIES portal, e.g.

events = client.getLatestEvents(format='list')

result into

Requesting
http://www.seismicportal.eu/services/event/latest?num=10&format=json

than you may call this URL directly and see if any duplicates are coming
back from the original source.

Cheers,
Robert

Dear obspy users,

I wonder if I haven't come across a bug in obspy.neries.
If i get the latest events in list format, there is an event which is
duplicated (result is at end of text):
We can see twice event 20120314_0000010 with origin 775108 and there is
no difference between the two entries.
If I get the result in xml format, this entry is not duplicated, the
result is identical to what the webservice returns, so it seems to be
specific to the list format output processing of the obspy.neries package.
Not critical, so I'm just posting this info in case it's useful.

Best regards,

Oliver

Sample showing error run in ipython :

In [1]: import pkg_resources

In [2]: pkg_resources.require('obspy.neries')
Out[2]:
[obspy.neries 0.5.1
(/usr/lib/python2.7/site-packages/obspy.neries-0.5.1-py2.7.egg),
suds 0.4 (/usr/lib/python2.7/site-packages/suds-0.4-py2.7.egg),
obspy.core 0.6.2
(/usr/lib/python2.7/site-packages/obspy.core-0.6.2-py2.7.egg),
numpy 1.6.1 (/usr/lib/python2.7/site-packages)]

In [3]: from obspy.neries import Client

In [4]: client = Client()

In [5]: events = client.getLatestEvents(format='list')

In [6]: for elem in events: print elem
{'author': u'KAN', 'event_id': u'20120314_0000012', 'origin_id': 775109,
'longitude': 42.713, 'datetime': UTCDateTime(2012, 3, 14, 5, 49, 39),
'depth': -5.0, 'magnitude': 3.1, 'magnitude_type': u'ml', 'latitude':
37.481, 'flynn_region': u'TURKEY-SYRIA-IRAQ BORDER REGION'}
{'author': u'KAN', 'event_id': u'20120314_0000011', 'origin_id': 775101,
'longitude': 43.373, 'datetime': UTCDateTime(2012, 3, 14, 5, 36, 27),
'depth': -5.7, 'magnitude': 2.6, 'magnitude_type': u'ml', 'latitude':
37.784, 'flynn_region': u'TURKEY-IRAQ BORDER REGION'}
{'author': u'NEIR', 'event_id': u'20120314_0000009', 'origin_id':
775095, 'longitude': 161.105, 'datetime': UTCDateTime(2012, 3, 14, 5, 8,
28), 'depth': -107.2, 'magnitude': 4.9, 'magnitude_type': u'mb',
'latitude': -10.272, 'flynn_region': u'SOLOMON ISLANDS'}
{'author': u'NEIR', 'event_id': u'20120314_0000008', 'origin_id':
775093, 'longitude': -95.191, 'datetime': UTCDateTime(2012, 3, 14, 5, 5,
40), 'depth': -118.8, 'magnitude': 4.0, 'magnitude_type': u'mb',
'latitude': 17.865, 'flynn_region': u'VERACRUZ, MEXICO'}
{'author': u'MIX', 'event_id': u'20120314_0000010', 'origin_id': 775108,
'longitude': 142.49, 'datetime': UTCDateTime(2012, 3, 14, 4, 43, 2),
'depth': -40.0, 'magnitude': 4.8, 'magnitude_type': u'mb', 'latitude':
25.198, 'flynn_region': u'VOLCANO ISLANDS, JAPAN REGION'}
{'author': u'NEIR', 'event_id': u'20120314_0000010', 'origin_id':
775097, 'longitude': 142.56, 'datetime': UTCDateTime(2012, 3, 14, 4, 43,
2), 'depth': -40.2, 'magnitude': 4.8, 'magnitude_type': u'mb',
'latitude': 25.14, 'flynn_region': u'VOLCANO ISLANDS, JAPAN REGION'}
{'author': u'GSRC', 'event_id': u'20120314_0000010', 'origin_id':
775107, 'longitude': 142.43, 'datetime': UTCDateTime(2012, 3, 14, 4, 43,
2), 'depth': -50.0, 'magnitude': 4.9, 'magnitude_type': u'mb',
'latitude': 25.17, 'flynn_region': u'VOLCANO ISLANDS, JAPAN REGION'}
{'author': u'GFZ', 'event_id': u'20120314_0000010', 'origin_id': 775088,
'longitude': 142.8, 'datetime': UTCDateTime(2012, 3, 14, 4, 43, 2),
'depth': -10.0, 'magnitude': 4.8, 'magnitude_type': u'm ', 'latitude':
25.4, 'flynn_region': u'VOLCANO ISLANDS, JAPAN REGION'}
{'author': u'MIX', 'event_id': u'20120314_0000010', 'origin_id': 775108,
'longitude': 142.49, 'datetime': UTCDateTime(2012, 3, 14, 4, 43, 2),
'depth': -40.0, 'magnitude': 4.8, 'magnitude_type': u'mb', 'latitude':
25.198, 'flynn_region': u'VOLCANO ISLANDS, JAPAN REGION'}
{'author': u'DDA', 'event_id': u'20120314_0000006', 'origin_id': 775083,
'longitude': 28.996, 'datetime': UTCDateTime(2012, 3, 14, 4, 12, 48),
'depth': -5.6, 'magnitude': 3.8, 'magnitude_type': u'ml', 'latitude':
39.126, 'flynn_region': u'WESTERN TURKEY'}

_______________________________________________
obspy-users mailing list
obspy-users@lists.sevor.de
ObsPy Forum

- --
Dr. Robert Barsch

EGU Office Munich
Luisenstr. 37
80333 Munich
Germany

Phone: +49-89-21806549
Fax: +49-89-218017855
eMail: barsch@egu.eu

Dear Robert,

Thank you for your detailed reply. I will enable debug should I ever come across the same event in the future. I probably just stumbled upon a freak error in the NERIES database before it was corrected. I should have taken more time to double check before reporting, sorry for the inconvenience.

Best regards,

Oliver