Skip to content

Commit

Permalink
Fix bug in azimuthal gap calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
acarapetis committed Jul 28, 2022
1 parent e2f4958 commit c58702e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def get_package_data(base_dir, sub_dir, base_items):

setup(
name = 'Wphase',
version = '0.3',
version = '0.3.1',
packages = ['wphase', 'wphase.psi'],
author = 'Geoscience Australia',
description = 'Wphase calculations and web interface.',
Expand Down
8 changes: 6 additions & 2 deletions wphase/psi/seismoutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ def get_azimuths(meta, trlist, loc):
Return the azimuths in degrees given metadata dict, list of
station ids and location of the epicentre.
'''
return [gps2dist_azimuth(loc[0], loc[1], meta[t]['latitude'], meta[t]['longitude'])
for t in trlist]
return [
gps2dist_azimuth(loc[0], loc[1], meta[t]["latitude"], meta[t]["longitude"])[2]
for t in trlist
]

def station_pruning(meta, trlist, cutoffs=[1.,2.,5], units='deg'):
'''
Expand Down Expand Up @@ -79,6 +81,8 @@ def azimuthal_gap(azis):
if len(azis) < 2:
return 360.
azis = np.asarray(azis) % 360
if len(azis.shape) != 1:
raise ValueError("Input to azimuthal_gap must be a one-dimensional array!")
azis.sort()
gaps = (azis - np.roll(azis, 1)) % 360
return gaps.max()
Expand Down

0 comments on commit c58702e

Please sign in to comment.