krischer / instaseis

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

Components in obspy stream are labeled wrong #10

Closed ghost closed 9 years ago

ghost commented 9 years ago

When using get_seismograms() to store wavefields as an obspy stream, the component labeling is wrong.

Here is the (correct) result when using the GUI: instaseis_gui

Here is the result when using the code provided below: obspy_stream

If this is compared with the output from the GUI, it is clear that simply N and E are switched/labeled wrong in the obspy stream. This is the code that has been used to store the obspy stream:

import instaseis

db = instaseis.open_db("/import/neptun-seismology/instaseis/ak135f/")
rec = instaseis.Receiver(latitude=-0.2,longitude=34.5)
src = instaseis.Source(latitude=0.0,longitude=35.0, depth_in_m=2000, m_rr=0, m_tt=0, m_pp=0, m_rt=0, m_rp=0, m_tp=1.0e17)

sm = db.get_seismograms(source=src,receiver=rec, kind='displacement', components=('Z','N','E'))

sm.plot()
kasra-hosseini commented 9 years ago

@martinvandriel Can it be due to the _labelmap (line 352) in _instaseisgui.py? Here is the code:

label_map = {0: {"z": "vertical", "n": "east", "e": "north"},
             1: {"z": "vertical", "n": "radial", "e": "transverse"}}

Here "n" is mapped to "east" and "e" is mapped to "north". Not sure about the reason and whether this is the case for non-gui get_seismogram.

martinvandriel commented 9 years ago

Interesting. I would say it's wrong in the GUI though: instaseis_gui So probably you are right, Kasra.

ghost commented 9 years ago

You're right. The GUI is wrong, the traces in the obspy streams are labeled correctly.