uafgeotools / mtuq

moment tensor uncertainty quantification
BSD 2-Clause "Simplified" License
65 stars 22 forks source link

Using both HN? and BH? components for a single station #246

Open ammcpherson opened 5 months ago

ammcpherson commented 5 months ago

A somewhat niche case, but recently I was trying to use both the broadband components and the strong motion data from 2 stations, and discovered that MTUQ cannot handle this. I get the following error where both types of traces are present in my data directory:

Traceback (most recent call last): File "run_mtuq.py", line 179, in <module> data = read(path_data, File "/home/ammcpherson/REPOSITORIES/mtuq/mtuq/__init__.py", line 86, in read return _readers()[format](path, **kwargs) File "/home/ammcpherson/REPOSITORIES/mtuq/mtuq/io/readers/SAC.py", line 73, in read check_components(stream) File "/home/ammcpherson/REPOSITORIES/mtuq/mtuq/util/signal.py", line 212, in check_components raise Exception('Multiple %s components in stream' % component) Exception: Multiple R components in stream

It would be nice if MTUQ could handle this in a similar vein to how it handles multiple location codes, and use both the strong motion and broadband data in the inversion.

rmodrak commented 5 months ago

Did you try commenting out check_components by chance? It's possible though the runtime error just gets deferred. It could be the reason for check_components in the first place is that the misfit function is just not currently able to handle multiple components of the same type?

ammcpherson commented 4 months ago

Hi @rmodrak,

Sorry for the long time between responses. I'm coming back to this now.

I just commented out check_components in /mtuq/io/readers/SAC.py and MTUQ no longer crashes. However, this does not produce the desired waveform plots either:

Screen Shot 2024-02-28 at 11 13 48

The station in the red box are the stations for which we have both broadband and strong motion data. We'd like them to be both plotted in a similar manner to the stations in the blue box, for which we have 2 separate location codes for the same physical location