Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong phase outputs in case of multiple phase detections #145

Open
alirezaniki opened this issue Dec 7, 2022 · 2 comments
Open

Wrong phase outputs in case of multiple phase detections #145

alirezaniki opened this issue Dec 7, 2022 · 2 comments

Comments

@alirezaniki
Copy link

Dear @smousavi05
I am having a problem with EQT outputs (output CSV file). The problem arises when there are two S or P detections with different probabilities in a 1-minute trace and EQT (seems like) outputs the first one regardless of their probabilities. The attached figure is an example:

NZ02_ZU_BH_2000-01-01T05:46:00 000000Z

and here is the output:

NZ02_ZU_BH_2000-01-01T05:46:00.000000Z, ,NZ02,BH,25.0,26.0,-27.0,2000-01-01 05:46:07.110000,2000-01-01 05:46:24.620000,0.92,,2000-01-01 05:46:07.420000,0.86,,6.7,2000-01-01 05:46:20.490000,0.22,,1.0

Do you have any suggestions on this?
Thanks in advance

@alirezaniki alirezaniki changed the title Bug in EQT outputs Wrong phase outputs in case of multiple phase detections Dec 7, 2022
@alirezaniki
Copy link
Author

It seems EQT prioritizes the closest detected S phase to the P phase regardless of probabilities, causing the above issue. replacing the below line of Eqt_utils.py (1949):
candidate_Ss = {list(candidate_Ss.keys())[0] : candidate_Ss[list(candidate_Ss.keys())[0]]}
with the following line:
candidate_Ss = {max(candidate_Ss, key=candidate_Ss.get): max(candidate_Ss.values())}

prioritizes the probabilities over P-S distances and solves the issue.

@smousavi05
Copy link
Owner

@alirezaniki thanks for the update. Yes, this sounds like a good fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants