Browse Source

ids io: Update Waveform result for easier information access

master
mmetz 1 week ago
parent
commit
01840efdde
  1. 49
      src/io/ids.py

49
src/io/ids.py

@ -12,7 +12,8 @@ from pyrocko import orthodrome as pod, util as putil, moment_tensor as pmt
from pyrocko.cake import earthradius, d2m
from pyrocko.guts import Float, Int, List, Object, StringChoice, Tuple
from pyrocko.guts_array import Array
from pyrocko.model import GNSSCampaign, GNSSComponent, GNSSStation, Station
from pyrocko.model import \
GNSSCampaign, GNSSComponent, GNSSStation, Station, Channel
from pyrocko.trace import Trace, snuffle
from pyrocko.gf.seismosizer import map_anchor, Location
@ -42,6 +43,52 @@ class WaveformResult(Location):
optional=True,
help='Azimuth from source hypocenter to station in [deg].')
@property
def network(self):
if not self.nslc:
return ''
return self.nslc[0]
@property
def station(self):
if not self.nslc:
return ''
return self.nslc[1]
@property
def location(self):
if not self.nslc:
return ''
return self.nslc[2]
@property
def channel(self):
if not self.nslc:
return ''
return self.nslc[3]
def nsl(self):
return (self.network, self.station, self.channel)
def to_pyrocko_station(self):
return Station(
lat=self.lat,
lon=self.lon,
north_shift=self.north_shift,
east_shift=self.east_shift,
depth=self.depth,
elevation=self.elevation,
network=self.network,
station=self.station,
location=self.location)
def to_pyrocko_channel(self):
return Channel(name=self.channel)
class WaveformResultList(Object):
results = List.T(

Loading…
Cancel
Save