problem with the creation of a valid resource identifier fixed (still problematic, see #145)

This commit is contained in:
Sebastian Wehling-Benatelli 2015-02-13 11:36:09 +01:00
parent c35eea4588
commit 759697add8

View File

@ -153,8 +153,8 @@ def createPick(origintime, picknum, picktime, eventnum, cinfo, phase, station,
return pick return pick
def createArrival(pickresID, eventnum, cinfo, phase, station, authority_id, def createArrival(origintime, pickresID, eventnum, cinfo, phase, station,
azimuth=None, dist=None): authority_id, azimuth=None, dist=None):
''' '''
createArrival - function to create an Obspy Arrival createArrival - function to create an Obspy Arrival
:param pickresID: Resource identifier of the created pick :param pickresID: Resource identifier of the created pick
@ -177,9 +177,7 @@ def createArrival(pickresID, eventnum, cinfo, phase, station, authority_id,
:type dist: float or int, optional :type dist: float or int, optional
:return: An ObsPy :class: `~obspy.core.event.Arrival` object :return: An ObsPy :class: `~obspy.core.event.Arrival` object
''' '''
arriID = 'arrival/' + eventnum + '/' + station + '/{0}'.format(phase) arriresID = createResourceID(origintime, 'arrival', authority_id, eventnum)
arriresID = ope.ResourceIdentifier(id=arriID)
arriresID.convertIDToQuakeMLURI(authority_id=authority_id)
arrival = ope.Arrival() arrival = ope.Arrival()
arrival.resource_id = arriresID arrival.resource_id = arriresID
arrival.creation_info = cinfo arrival.creation_info = cinfo