usgs / groundmotion-processing

Parsing and processing ground motion data
Other
54 stars 42 forks source link

process_events() takes origin dict as argument, but workspace holds ObsPy Origin object #202

Closed baagaard-usgs closed 5 years ago

baagaard-usgs commented 5 years ago

There is an inconsistency between how the origin is stored in the workspace and the origin argument for process_streams(). The workspace holds the earthquake metadata within QuakeML, so StreamWorkspace.getEvent() retiurns an ObsPy Event which holds an Origin object. However, the processing.process_streams() function takes the origin as a dict. I don't see a simple way to translate from one to the other.

In general there seems to be some inconsistency in how earthquake metadata is being passed around. Some places expect a dictionary and others expect an ObsPy Event object. I propose that we use ObsPy objects since this is how things are stored in the workspace.

mhearne-usgs commented 5 years ago

@baagaard-usgs This doesn't address the consistency issue, but we do have a function for converting a dictionary to an Obspy Event object:

https://github.com/usgs/groundmotion-processing/blob/master/gmprocess/event.py#L35

emthompson-usgs commented 5 years ago

I'm assigning this to Release 1.0 project because I think it is important and we should address this soon.

emthompson-usgs commented 5 years ago

Closed by #237.