GeoNet / fdsn

FDSN Web Services
MIT License
17 stars 15 forks source link

get_station bombs out on response request #56

Closed iceseismic closed 7 years ago

iceseismic commented 7 years ago

Using beta-service,

inventory = client.get_stations(station="ALRZ", level="channel") works fine,
but inventory = client.get_stations(station="ALRZ", level="response") completely bombs out with problems with paz

mabznz commented 7 years ago

Ahhh, I've just written that up at:

https://wiki.geonet.org.nz/display/~b.mabbett/Beta+FDSN+Station+Web+Service+Problem+Defintion#BetaFDSNStationWebServiceProblemDefintion-EmptyPolesZerosentitycausesbuginObspy

It's a problem with empty Entities being produced by beta service I believe. First appears for empty PolesZero entity but could be larger problem.

nbalfour commented 7 years ago

To summarise, it appears that the FDSN station webservice is adding empty elements for poles and zeros when they don't exist in the source stationXML. Need to only add elements if they exist. @junghao can you follow up on this, you can talk to @mabznz if you have questions.

gclitheroe commented 7 years ago

should be fixed and deployed

nbalfour commented 7 years ago

@mabznz, can you please test this to confirm the issue is resolved? Thanks

mabznz commented 7 years ago

Can confirm this was an issue with obspy for both python 2 and 3 but is now fixed with change.

#! /usr/bin/python3.5
from obspy.clients.fdsn import Client
client = Client(base_url='http://beta-service.geonet.org.nz/')
inventory = client.get_stations(network="NZ",level="response")
byron@byron-Latitude-E7250:~/obspy$ ./beta_fsdn_stations.py 
Inventory created at 2017-05-24T14:14:25.000000Z
    Created by: Delta

    Sending institution: GeoNet (WEL(GNS_Test))
    Contains:
        Networks (1):
            NZ
        Stations (915):
            NZ.A11...