Skip to content

Commit

Permalink
Calculate distance/azimuth in SAC output
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-iris committed Jul 3, 2023
1 parent 3304089 commit ea0c05f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pyweed/waveforms_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ def to_sac_stream(self, st, waveform):
tr = SACTrace.from_obspy_trace(st[0])
tr.kevnm = waveform.event_description[:16]
event = waveform.event_ref()
origin = None
if not event:
LOGGER.warn("Lost reference to event %s", waveform.event_description)
else:
Expand Down Expand Up @@ -482,6 +483,9 @@ def to_sac_stream(self, st, waveform):
tr.cmpaz = channel.azimuth
tr.cmpinc = channel.dip + 90
tr.kinst = channel.sensor.description[:8]
if origin and channel:
# Calculate distances/azimuths
tr.lcalda = True
return Stream([tr.to_obspy_trace()])


Expand Down

1 comment on commit ea0c05f

@adam-iris
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should fix #125

Please sign in to comment.