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

array_thresh baz estimate range issue #38

Open
liamtoney opened this issue Apr 7, 2022 · 0 comments
Open

array_thresh baz estimate range issue #38

liamtoney opened this issue Apr 7, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@liamtoney
Copy link
Member

From @kfmckee:

I found a small issue with array_processing.tools.generic.array_thresh. The back-azimuth estimates are from 0-360, so if az_volc+-az_diff are greater than 360 or less than 0, they are excluded from the sorting process. I wrote up a work around and figured I would share. Not the prettiest, but seems to work.

    if az_volc - az_diff < 0:
        for j in range(np.size(az)):
            if az[j] > 180:
                az[j] = az[j] - 360
        az_good = np.where((az >= az_volc - az_diff) & (az <= az_volc + az_diff))[0]
        for j in range(np.size(az)):
            if az[j] < 0:
                az[j] = az[j] + 360
    elif az_volc + az_diff > 360:
        for j in range(np.size(az)):
            if az[j] < 180:
                az[j] = az[j] + 360
        az_good = np.where((az >= az_volc - az_diff) & (az <= az_volc + az_diff))[0]
        for j in range(np.size(az)):
            if az[j] > 360:
                az[j] = az[j] - 360
    else:
        az_good = np.where((az >= az_volc - az_diff) & (az <= az_volc + az_diff))[0]
@liamtoney liamtoney added the bug Something isn't working label Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant