# http://pyrocko.org - GPLv3 # # The Pyrocko Developers, 21st Century # ---|P------/S----------~Lg----------
geographic_midpoint_locations
raise NotImplementedError
def nstations(self): return len(self.get_stations())
if not self.get_stations(): return False return True
super().clear() self._stations = None
dists = [] for source in sources: for station in self.get_stations(): dists.append( source.distance_to(station))
return num.min(dists), num.max(dists)
return []
automap.add_stations(self.get_stations())
optional=True, help='List of files with station coordinates in Pyrocko format.')
optional=True, help='List of files with station coordinates in StationXML format.')
model.Station.T(), optional=True, help='List of Pyrocko stations.')
stations = self.get_stations() if not stations: return self._parent.get_center_latlon()
return geographic_midpoint_locations(self.get_stations())
stations = self.get_stations() if not stations: return self._parent.get_radius()
clat, clon = self.get_center_latlon() radii = distance_accurate50m_numpy( clat, clon, [st.effective_lat for st in stations], [st.effective_lon for st in stations])
return float(radii.max())
if self._stations is None:
stations = []
if self.stations_paths: for filename in self.stations_paths: stations.extend( load_stations(filename))
if self.stations_stationxml_paths: for filename in self.stations_stationxml_paths: sxml = stationxml.load_xml(filename=filename) stations.extend( sxml.get_pyrocko_stations())
if self.stations: stations.extend(self.stations)
self._stations = stations
return self._stations
stations = self.get_stations() return stations[istation].nsl()
default=100*km, help='Radius of the station circle in km.')
default=0., help='Start azimuth of circle [deg]. ' 'Default is a full circle, 0 - 360 deg')
default=360., help='End azimuth of circle [deg]. ' 'Default is a full circle, 0 - 360 deg')
default=10, help='Number of evenly spaced stations.')
default='CI', help='Network name.')
default=['BHE', 'BHN', 'BHZ'], help='Seismic channels to generate. Default: BHN, BHE, BHZ.')
default=False, help='Rotate circle away by half a station distance.')
if self._stations is None: if self.channels: channels = [model.station.Channel(c) for c in self.channels] else: channels = None
azimuths = num.linspace( self.azi_start*d2r, self.azi_end*d2r, self.nstations, endpoint=False)
if self.shift_circle: swath = (self.azi_end - self.azi_start)*d2r azimuths += swath / self.nstations / 2.
lat, lon = self.get_center_latlon()
stations = [] for istation, azi in enumerate(azimuths): net, sta, loc = self.nsl(istation)
station = model.Station( net, sta, loc, lat=lat, lon=lon, north_shift=num.cos(azi) * self.radius, east_shift=num.sin(azi) * self.radius, channels=channels)
stations.append(station)
self._stations = stations
return self._stations
return self.network_name, 'S%03i' % (istation + 1), ''
return self.radius
super().clear() self._stations = None
default=10, help='Number of randomly distributed stations.')
default='CO', help='Network name')
optional=True, default=['BHE', 'BHN', 'BHZ'], help='Seismic channels to generate. Default: BHN, BHE, BHZ')
return self.network_name, 'S%03i' % (istation + 1), '',
if self._stations is None:
if self.channels: channels = [model.station.Channel(c) for c in self.channels] else: channels = None
stations = [] for istation in range(self.nstations): lat, lon, north_shift, east_shift, depth = map( float, self.get_coordinates(istation))
net, sta, loc = self.nsl(istation) station = model.Station( net, sta, loc, lat=lat, lon=lon, north_shift=north_shift, east_shift=east_shift, depth=depth, channels=channels)
stations.append(station)
self._stations = stations
return self._stations |