Open
Description
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]