uafgeotools / mtuq

moment tensor uncertainty quantification
BSD 2-Clause "Simplified" License
68 stars 23 forks source link

Error reading SAC files local network #284

Open indraPLM opened 1 week ago

indraPLM commented 1 week ago

Dear All,

I am newbie for using MTUQ software. I interest to use MTUQ to estimate moment tensor crustal earthquake magnitude ranging from4 to 5.5 . I tried to use SAC files seismic records from our local seismic network. Unfortunately, it's seem I get problem in reading the SAC files. Here is the error message: (mtuq) sysop@sysop:~/mtuq/examples$ python SerialGridSearch.DoubleCouple.py Reading data...

Traceback (most recent call last): File "/home/indra/mtuq/examples/SerialGridSearch.DoubleCouple.py", line 137, in data = read(path_data, format='sac', ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/indra/mtuq/mtuq/init.py", line 95, in read return _readers()[format](path, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/indra/mtuq/mtuq/io/readers/SAC.py", line 79, in read assert preliminary_origin==_get_origin(stream, event_id) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AssertionError

Meanwhile, when I only use single station SAC File, the SerialGridSearch.DoubleCouple.py run well and could process for obtaining green function. Hopefully, I could get advise and suggestion to fix the problem. Warm Regards

Indra Gunawan

rmodrak commented 1 week ago

@indraPLM,

It looks like the assertion is a sort of sanity check of the hypocenter and origin time metadata present in the SAC headers. The idea is to check that waveforms from two different events are not accidentally being used in the same inversion. Aside from this sanity check, the SAC origin headers are not actually used by MTUQ.

After double checking that you are reading in the correct SAC files, I would feel free just to comment out this assertion.

(I could imagine different scenarios that would give rise to false positives, e.g. origin headers are present for some SAC files but absent for others. As a result, we might consider raising a warning rather than an error?)

Best regards Ryan

indraPLM commented 1 week ago

Dear Ryan,

Really, I don't know well, how to fix the problem.
I already compared SAC header from our SAC Files with data/example/2009040720125535. It seems all features in SAC header are available. Here I attached our SAC files, perhaps you could try.

Warm Regards Indra Gunawan 20221121062110565.zip

rmodrak commented 1 week ago

You could try commenting out the assertion from the traceback

On Fri, Nov 22, 2024 at 6:10 AM indraPLM @.***> wrote:

Dear Ryan,

Really, I don't know well, how to fix the problem. I already compared SAC header from our SAC Files with data/example/2009040720125535. It seems all features in SAC header are available. Here I attached our SAC files, perhaps you could try.

Warm Regards Indra Gunawan 20221121062110565.zip https://github.com/user-attachments/files/17870558/20221121062110565.zip

— Reply to this email directly, view it on GitHub https://github.com/uafgeotools/mtuq/issues/284#issuecomment-2493730752, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCGSSUDAKQPIZH35EPTPTT2B4ULZAVCNFSM6AAAAABSGIPMROVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOJTG4ZTANZVGI . You are receiving this because you commented.Message ID: @.***>

indraPLM commented 1 week ago

Ok I get it. It seem reading SAC files and mtuq are running well.

Thank you so much.

rmodrak commented 1 week ago

Great, glad to hearOn Nov 22, 2024, at 7:01 AM, indraPLM @.***> wrote: Ok I get it. It seem work to read SAC files and mtuq is running well. Thank you so much.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>