delta in obspy?

Dear obspy list members and users,

Is there a function in obspy which allows to compute the distance in degrees between an event and a station given their coordinates?
If already implemented it would be of great use with obspy.taup.taup.getTravelTime. I've had look through the obspy code, but I can't find anything like it. Have I missed it?

Thanks.

Best regards,

Oliver

Checkout obspy.core.util.gps2DistAzimuth

Cheers,
Martin

Dear Martin,

I’d seen that, but from the website () : DEPRECATED. Use instead. and I can’t find a trace of it in obspy.core. What am I doing wrong? Thanks. Regards, Oliver On 02/12/2011 16:30, Martin van Driel wrote:

Hi Oliver,

as Martin already said there is gps2DistAzimuth in
obspy.core.util.geodetics
(Home · obspy/obspy Wiki · GitHub)
using the Vincenty Inverse Solution of Geodesics on the Ellipsoid.
However this formulare is known to have issues at andipodal points.
The function gps2DistAzimuth will use as an alternative the python
library geographiclib which works correct for those points.

Best regards,
Robert

PS: docs for obspy.core.util seems not to work atm - I'll fix that.

Dear obspy list members and users,

Is there a function in obspy which allows to compute the distance
in degrees between an event and a station given their coordinates?
If already implemented it would be of great use with
obspy.taup.taup.getTravelTime. I've had look through the obspy
code, but I can't find anything like it. Have I missed it?

Thanks.

Best regards,

Oliver

- --
Dr. Robert Barsch

Ludwig-Maximilians-Universität München
Department of Earth and Environmental Sciences, Geophysics
Theresienstr. 41/IV
D-80333 Munich
Germany

Tel: +49 (0) 89 2180 4201
Fax: +49 (0) 89 2180 9942010
Mail: barsch@geophysik.uni-muenchen.de

Dear Robert,

OK, thanks for the precision, that's what I had missed.

Best regards,

Oliver

I just see, that he was acutally asking for the distance in degrees, we are both talking about distance in km. I guess in degrees is a lot easier, because it does not depend on the elipsoid. Do we have sth for that as well?

Martin

afaik not - but there is the IRIS Web Service function distaz
(http://docs.obspy.org/packages/autogen/obspy.iris.client.Client.distaz.html)
and ofc plenty space in obspy.core.util.geodetics for new custom
functions :wink:

Cheers,
Robert

- --
Dr. Robert Barsch

Ludwig-Maximilians-Universität München
Department of Earth and Environmental Sciences, Geophysics
Theresienstr. 41/IV
D-80333 Munich
Germany

Tel: +49 (0) 89 2180 4201
Fax: +49 (0) 89 2180 9942010
Mail: barsch@geophysik.uni-muenchen.de

Hi all,

there actually is a function that performs the distance calculation on a spherical
Earth using the Vincenty formula. It's included in obspy.taup:

http://docs.obspy.org/packages/autogen/obspy.taup.taup.locations2degrees.html

It also works for antipodal points but it is of course only an approximation.
Nevertheless it should be accurate enough for doing calculations with obspy.taup.

@Oliver: I attached a script that I have laying around that does pretty much exactly what
I think you intend to do.

Best wishes,

Lion

get_earthquake.py (1.76 KB)

Dear obspy list members,

Sorry for not replying earlier. Thank you very much for your help Martin, Robert and Lion.

Indeed, I was looking for the angluar distance since that’s what obspy.taup.taup.getTravelTimes asks for.

locations2degrees seems good for me. I’m a bit confused by the reference to geopy on the page as it seems geopy doesn’t provide the distance in degrees but along the surface (great circle or Vincenty formula), I might have missed a function in the code? Anyway, locations2degrees is a goot start.

Thanks a lot.

Best regards,

Oliver