# http://pyrocko.org - GPLv3 # # The Pyrocko Developers, 21st Century # ---|P------/S----------~Lg----------
StringChoice, Int
''' Get component and azimuth for standard components R, T, Z, N, and E.
:param source: :py:class:`pyrocko.gf.Location` object :param target: :py:class:`pyrocko.gf.Location` object :param component: string ``'R'``, ``'T'``, ``'Z'``, ``'N'`` or ``'E'`` '''
_, bazi = source.azibazi_to(target)
azi, dip = { 'T': (bazi + 270., 0.), 'R': (bazi + 180., 0.), 'N': (0., 0.), 'E': (90., 0.), 'Z': (0., -90.)}[component]
return azi, dip
''' A seismogram computation request for a single component, including its post-processing parmeters. '''
optional=True, help='Measurement quantity type. If not given, it is guessed from the ' 'channel code. For some common cases, derivatives of the stored ' 'quantities are supported by using finite difference ' 'approximations (e.g. displacement to velocity or acceleration). ' '4th order central FD schemes are used.')
4, String.T(), default=('', 'STA', '', 'Z'), help='network, station, location and channel codes to be set on ' 'the response trace.')
default=0.0, help='station surface elevation in [m]')
optional=True, help='ID of Green\'s function store to use for the computation. ' 'If not given, the processor may use a system default.')
optional=True, help='sample rate to produce. ' 'If not given the GF store\'s default sample rate is used. ' 'GF store specific restrictions may apply.')
default='nearest_neighbor', help='Interpolation method between Green\'s functions. Supported are' ' ``nearest_neighbor`` and ``multilinear``')
default='enable', optional=True, help='disable/enable optimizations in weight-delay-and-sum operation')
optional=True, help='time of first sample to request in [s]. ' 'If not given, it is determined from the Green\'s functions.')
optional=True, help='time of last sample to request in [s]. ' 'If not given, it is determined from the Green\'s functions.')
optional=True, help='azimuth of sensor component in [deg], clockwise from north. ' 'If not given, it is guessed from the channel code.')
optional=True, help='dip of sensor component in [deg], ' 'measured downward from horizontal. ' 'If not given, it is guessed from the channel code.')
optional=True, help='frequency response filter.')
self.optimization, self.tmin, self.tmax, self.elevation, self.depth, self.north_shift, self.east_shift, self.lat, self.lon)
# guess from channel code # use most common SEED conventions here, however units have to be # guessed, because they are not uniquely defined by the conventions if cha[-2] in 'HL': # high gain, low gain seismometer return 'velocity' if cha[-2] == 'N': # accelerometer return 'acceleration' if cha[-2] == 'D': # hydrophone, barometer, ... return 'pressure' if cha[-2] == 'A': # tiltmeter return 'tilt' if cha[-2] == 'U': return 'displacement' if cha[-2] == 'V': return 'velocity' if cha == 'P': return 'pressure'
raise BadTarget('cannot guess measurement quantity type from channel ' 'code "%s"' % cha)
else: return ' '
raise BadTarget('cannot determine sensor component azimuth for ' '%s.%s.%s.%s' % self.codes)
raise BadTarget('cannot determine sensor component dip')
''' A computation request for a spatial multi-location target of static/geodetic quantities. ''' optional=True, default='displacement', help='Measurement quantity type, for now only `displacement` is' 'supported.')
default='nearest_neighbor', help='Interpolation method between Green\'s functions. Supported are' ' ``nearest_neighbor`` and ``multilinear``')
optional=True, help='time of the desired snapshot in [s], ' 'If not given, the first sample is taken. If the desired sample' ' exceeds the length of the Green\'s function store,' ' the last sample is taken.')
optional=True, help='ID of Green\'s function store to use for the computation. ' 'If not given, the processor may use a system default.')
self.coords5.shape, self.quantity, self.tsnapshot, self.interpolation)
def ntargets(self): ''' Number of targets held by instance. '''
''' Discretizes the multilocation target into a list of :class:`Target:`
:returns: :class:`Target` :rtype: list ''' Target( lat=float(self.coords5[i, 0]), lon=float(self.coords5[i, 1]), north_shift=float(self.coords5[i, 2]), east_shift=float(self.coords5[i, 3]), elevation=float(self.coords5[i, 4])))
src_lats = num_full_like(self.lats, fill_value=source.lat) src_lons = num_full_like(self.lons, fill_value=source.lon)
target_coords = self.get_latlon() target_lats = target_coords[:, 0] target_lons = target_coords[:, 1] return distance_accurate50m_numpy( src_lats, src_lons, target_lats, target_lons)
''' A computation request for a spatial multi-location target of static/geodetic quantities measured from a satellite instrument. The line of sight angles are provided and projecting post-processing is applied. ''' shape=(None,), dtype=float, serialize_as='base64-compat', help='Horizontal angle towards satellite\'s line of sight in radians.' '\n\n .. important::\n\n' ' :math:`0` is **east** and' ' :math:`\\frac{\\pi}{2}` is **north**.\n\n')
shape=(None,), dtype=float, serialize_as='base64-compat', help='Theta is look vector elevation angle towards satellite from' ' horizon in radians. Matrix of theta towards satellite\'s' ' line of sight.' '\n\n .. important::\n\n' ' :math:`-\\frac{\\pi}{2}` is **down** and' ' :math:`\\frac{\\pi}{2}` is **up**.\n\n')
raise AttributeError('LOS angles inconsistent with provided' ' coordinate shape.')
result=statics, theta=self.theta, phi=self.phi)
2, Int.T(), optional=False, help='Shape of the displacement vectors.')
elif scene.frame.spacing == 'degree': lats = scene.frame.gridN.data.flatten() + scene.frame.llLat lons = scene.frame.gridE.data.flatten() + scene.frame.llLon north_shifts = num.zeros(size) east_shifts = num.zeros(size)
lats=lats, lons=lons, north_shifts=north_shifts, east_shifts=east_shifts, theta=scene.theta.flatten(), phi=scene.phi.flatten(), shape=scene.shape, **kwargs)
result=statics, theta=self.theta, phi=self.phi, shape=self.scene.shape)
shift=float(statics['displacement.n'][ista])) shift=float(statics['displacement.e'][ista])) shift=-float(statics['displacement.d'][ista]))
lat=float(coords[ista, 0]), lon=float(coords[ista, 1]), east_shift=float(coords[ista, 2]), north_shift=float(coords[ista, 3]), elevation=float(coords[ista, 4]), north=north, east=east, up=up)
|