krischer / instaseis

Instant high-frequency seismograms from an AxiSEM database
http://instaseis.net
Other
49 stars 23 forks source link

Add "Instaseis-MU" header to the /seismograms route #23

Closed krischer closed 8 years ago

krischer commented 8 years ago

Only for requests where it makes sense. See iris-edu/irisws-syngine#10.

CTrabant commented 8 years ago

Please define for what kind of request this makes sense.

The DMC's middleware is ready to be adapted to pass along this header.

krischer commented 8 years ago

I just implemented it. It actually makes sense for all seismograms that can be returned by the /seismograms route. It depends on the source location and that is always identical for a single request so you can just always forward the Instaseis-Mu header. Its also documented here: http://instaseis.net/routes/seismograms.html

CTrabant commented 8 years ago

Is there any way to query for a model-source Instaseis-Mu value without making a seismograms request?

Turns out that passing along this header, using the first one of potentially many HTTP requests made by the middleware, is harder than I was hoping. It'd be a lot better to lookup the value before making seismogram request(s). I can work on it if needed.

krischer commented 8 years ago

Hmm...I could add a new route that returns the shear modules for a given depth.

Alternatively we could tabulate the values as it only depends on the event depth for the models of the syngine service and you come up with something of your own.

Nonetheless this, for now, is only a nice-to-have feature. It would be required if people want to calculate their own finite sources from some file formats building them up from point sources, each requested from the syngine service.

CTrabant commented 8 years ago

Let's forgo a new route, and I'll adapt the middleware.

Thinking out loud for my own sake: the issue here is that miniSEED is streamed directly through the middleware with no easy opportunity to catch the first header and pass it along. This is nice because there is no buffering and minimal memory use by the middleware. On the other hand the SAC data is buffered for each request in order to re-form all backend requests into a single archive. So changing the miniSEED to do the same would make it just as "bad" as the SAC. Since only a single receiver and limited number of components are in each request the maximum size is well bounded and not really that bad. This would allow cherry-picking of the first Instaseis-Mu header to be pushed into the output stream.

krischer commented 8 years ago

Done in iris-edu/irisws-syngine#10 and added to instaseis in 049bbcd6ef521159710cd5f3b07d9bb70223960e.