krischer / instaseis

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

Export velocity model #50

Open sstaehler opened 7 years ago

sstaehler commented 7 years ago

Feature proposal:

Does anyone else think, it's a good idea? Should be pretty straightforward, and I can implement it in the next weeks.

krischer commented 7 years ago

Great idea!

If you want a direct path to ObsPy you have to generate this object here: https://github.com/obspy/obspy/blob/master/obspy/taup/velocity_model.py#L18

Otherwise you could also generate one of the supported text file format and then just use TauPCreate. Might be a bit more generically useful.

A side note: There is actually no proper 1D model handling in ObsPy and that would be very nice to have. So if you want to take the time to cook up something more generic please open an issue on the obspy github to discuss it :)

martinvandriel commented 7 years ago

How would you do it? Assume it's a 1D model? We do not strictly assume this anywhere yet but in principle allow for lateral variations in the AxiSEM run. Hence we also store the model on the mesh and not as a 1D model in the databases.

Of course, the 1D modelname is readily in the file and could be used with the 1D model class from the salvus mesher to do a bunch of stuff (but not yet writing to other file formats).

sstaehler commented 7 years ago

Well, the simplemost solution would be to traverse along the axis, read out the velocities of all points there and create a reasonable parameterisation from it.

I would very much like it to work with arbitrary models, esp. ones that are not the Earth...

Of course, if the user has enabled lateral variations, traversing the axis will not work. I would probably add a flag to the output file whether lateral variation had been switched on and throw an exception then. Another solution would be to use the median of all elements in depth range (d + Deltad), but that's not fool proof either.