Closed Jollyfant closed 7 years ago
Here is my script, fyi:
import requests
import datetime
import io
from obspy import read
MEDIATOR_URL = "http://mediator-devel.ethz.ch/fdsnws/dataselect/1/query?"
QUERY = "&".join([
"channel=LHZ",
"net=IV,FR",
"start=2017-01-01T00:00:00",
"end=2017-01-01T01:00:00"
])
for i in range(5):
print "Making request %d" % i
r = requests.get(MEDIATOR_URL + QUERY)
print "nBytes: %d" % len(r.content)
print read(io.BytesIO(r.content))
if r.status_code == 200:
print "Request OK"
else:
print "Error request code: %d" % r.status_code
Hi Mathijs, thanks for letting us know!
Fixed in ac8d30821b328539f87e9e55d54bf2cbdc236c57. This was a tricky one! It turned out that when reading from the mseed streams, the buffer size cannot be constant, but has to be the real record size. Otherwise incomplete records can be written to the output mseed file.
Oh yeah. The flexibility of mSEED can sometimes be useful and tricky at the same time. Nice work!
I'm not too deep in the code but can you please explain why it is necessary to read the records anyway? If I am not mistaken, the federator could merge mSEED from different sources by just concatenating the individual service responses one after the other, as long as they are complete when written.
Good question. Balancing between memory footprint and thread waiting time? Just relying on Andres' design here...
Hi guys sorry to jump in here but this gives me quite some concerns... I would definitely avoid unnecessary I/O operations as they could create serious bottlenecks. I fully understand and support reuse of software whenever possible provided this does not put strict constraints on our infrastructure. In this case I see a critical behavior that could affect the overall performance. In my view this is a point that requires further investigation and possibly improvements. Please don't forget that our final aim is to have a solid and stable system and the mediator is a crucial component.
Sure, Luca, i can confirm that we share the aim of a solid and stable system, and that we are committed to tackle issues where they manifest.
Hi guys, I was trying to federator requesting all LHZ channels from networks FR and IV. Individually it works fine but when I ask for both at the same time the service response is unpredictable (I'm making the same request multiple times):
I think somewhere in the concatenation of the mSEED from different sources there is a problem.
Best, Mathijs