# obspy.core.stream.Stream.rotate

`Stream.``rotate`(method, back_azimuth=None, inclination=None, inventory=None, **kwargs)

  Rotate stream objects.

  Parameters: | method (str) Determines the rotation method. `'->ZNE'`: Rotates data from three components into Z, North- and East-components based on the station metadata (e.g. borehole stations). Uses mandatory `inventory` parameter (provide either an `Inventory` or `Parser` object) and ignores `back_azimuth` and `inclination` parameters. 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 a seismogram to radial and transverse components. `'RT->NE'`: Rotates the radial and transverse components of a seismogram to North- and East-components. `'ZNE->LQT'`: Rotates from left-handed Z, North, and East system to LQT, e.g. right-handed ray coordinate system. `'LQT->ZNE'`: Rotates from LQT, e.g. right-handed ray coordinate system 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_azimuth` will 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.inclination` will be used. It will also be written after the rotation is done. inventory (`Inventory` or `Parser`) Inventory or SEED Parser with metadata of channels.

  Example to rotate unaligned borehole instrument data based on station inventory (a dataless SEED `Parser` can also be provided, see details for option `inventory`):

      >>> 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...>

### Thank you!

We would like to thank our contributors, whose efforts make this software what it is. These people have helped by writing code and documentation, and by testing. They have created and maintained this product, its associated libraries and applications, our build tools and our web sites.

#### Contributors

- Ackerley, Nick
- Allgeyer, Sebastien
- Ammon, Charles J.
- Antunes, Emanuel
- Arnarsson, Ólafur St.
- Bank, Markus
- Barsch, Robert
- Behr, Yannik
- Bernardi, Fabrizio
- Bernauer, Felix
- Bes de Berc, Maxime
- Beyreuther, Moritz
- Boltz, Shawn
- Bonaimé, Sébastien
- Carothers, Lloyd
- Chamberlain, Calum
- Chambers, Derrick
- Chen, Zhao
- Clark, Adam
- Danecek, Peter
- Egdorf, Sven
- Engels, Fabian
- Ermert, Laura
- Eulenfeld, Tom

- Fabbri, Tommaso
- Falco, Nicholas
- Fee, Jeremy
- Grellier, Clément
- Grunberg, Marc
- Hammer, Conny
- Heimann, Sebastian
- Heiniger, Lukas
- Hope, Gaute
- Igel, Heiner
- Inza, Adolfo
- Isken, Marius
- Ketchum, David
- Koymans, Mathijs
- Kremers, Simon
- Kress, Victor
- Krieger, Lars
- Krischer, Lion
- Kula, Damian
- Käufl, Paul
- Köhler, Andreas
- Lecocq, Thomas
- Leeman, John
- Legovini, Paride

- Lesage, Philippe
- Li, Yulin
- Lomax, Anthony
- Lopes, Rui L.
- MacCarthy, Jonathan
- Maggi, Alessia
- Martin, Henri
- Medlin, Andrew
- Megies, Tobias
- Meschede, Matthias
- Michelini, Alberto
- Miller, Nathaniel C.
- Morgenstern, Bernhard
- Nof, Ran Novitsky
- Panning, Mark P.
- Parker, Tom
- Pestourie, Romain
- Rapagnani, Giovanni
- Reyes, Celso
- Ringler, Adam
- Rothenhäusler, Nicolas
- Russo, Emiliano
- Sales de Andrade, Elliott

- Satriano, Claudio
- Saul, Joachim
- Scheingraber, Chris
- Schneider, Simon
- Sippl, Christian
- Snoke, Arthur
- Stange, Stefan
- Stähler, Simon C.
- Sullivan, Benjamin
- Tian, Dongdong
- Trabant, Chad
- Trani, Luca
- Uieda, Leonardo
- Walker, Andrew
- Walther, Marcus
- Wassermann, Joachim
- Williams, Mark C.
- Winkelman, Andrew
- Zaccarelli, Riccardo
- Zad, Seyed Kasra Hosseini
- Zhu, Lijun
- van Driel, Martin
- van Wijk, Kasper

#### Funds

ObsPy was partially funded by the

- German Science Foundation (DFG) via grant DFG IG 16/9-1
- German Ministry for Education and Research (BMBF), GEOTECHNOLOGIEN grant 03G0646H.
- NERA project (Network of European Research Infrastructures for Earthquake Risk Assessment and Mitigation) under the European Community's Seventh Framework Programme (FP7/2007-2013) grant agreement n° 262330
- Leibniz Institute for Applied Geophysics (LIAG)
- VERCE EU-FP7 project (no. 283543)