obspy.core.stream.Stream.rotate
- Stream.rotate(method, back_azimuth=None, inclination=None, inventory=None, **kwargs)[source]
Rotate stream objects.
- Parameters:
method (str) –
Determines the rotation method.
'->ZNE': Rotates data from three components into Z, North- andEast-components based on the station metadata (e.g. borehole stations). Uses mandatory
inventoryparameter (provide either anInventoryorParserobject) and ignoresback_azimuthandinclinationparameters. Additional kwargs will be passed on to_rotate_to_zne()(use if other components than["Z", "1", "2"]and["1", "2", "3"]need to be rotated). Trims common channels used in rotation to time spans that are available for all three channels (i.e. cuts away parts for which one or two channels used in rotation do not have data).'NE->RT': Rotates the North- and East-components of aseismogram to radial and transverse components.
'RT->NE': Rotates the radial and transverse components of aseismogram to North- and East-components.
'ZNE->LQT': Rotates from left-handed Z, North, and East systemto LQT, e.g. right-handed ray coordinate system.
'LQT->ZNE': Rotates from LQT, e.g. right-handed ray coordinatesystem to left handed Z, North, and East system.
back_azimuth (float, optional) – Depends on the chosen method. A single float, the back azimuth from station to source in degrees. If not given,
stats.back_azimuthwill be used. It will also be written after the rotation is done.inclination (float, optional) – Inclination of the ray at the station in degrees. Only necessary for three component rotations. If not given,
stats.inclinationwill be used. It will also be written after the rotation is done.inventory (
InventoryorParser) – Inventory or SEED Parser with metadata of channels.
Example to rotate unaligned borehole instrument data based on station inventory (a dataless SEED
Parsercan also be provided, see details for optioninventory):>>> from obspy import read, read_inventory >>> st = read("/path/to/ffbx_unrotated_gaps.mseed") >>> inv = read_inventory("/path/to/ffbx.stationxml") >>> st.rotate(method="->ZNE", inventory=inv) <obspy.core.stream.Stream object at 0x...>