Skip to content

Commit

Permalink
Fix computing epicentral distance
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiodsf committed Oct 12, 2021
1 parent 9a5aa65 commit 8dc7e4f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nllgrid/NLLGrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,9 @@ def get_value(self, x, y, z, array=None):
# Special case of 2D grids: y is epicentral distance
# note: this doesn't work for GLOBAL grids
if self.nx <= 2:
y = np.sqrt(x**2 + y**2)
# note: sta_x and sta_y are 0 if not defined in grid header
# (e.g., for model grids)
y = np.sqrt((x-self.sta_x)**2 + (y-self.sta_y)**2)
x = self.x_orig
min_x, max_x, min_y, max_y, min_z, max_z = self.get_extent()
if not (min_x <= x <= max_x and min_y <= y <= max_y and
Expand Down

0 comments on commit 8dc7e4f

Please sign in to comment.