# obspy.core.stream.Stream.normalize

`Stream.``normalize`(global_max=False)

  Normalize all Traces in the Stream.

  By default all traces are normalized separately to their respective absolute maximum. By setting `global_max=True` all traces get normalized to the global maximum of all traces.

  Parameters: | global_max If set to `True`, all traces are normalized with respect to the global maximum of all traces in the stream instead of normalizing every trace separately.

  Note

  If `data.dtype` of a trace was integer it is changing to float.

  Note

  This operation is performed in place on the actual data arrays. The raw data is not accessible anymore afterwards. To keep your original data, use `copy()` to create a copy of your stream object. This also makes an entry with information on the applied processing in `stats.processing` of every trace.

  Example

  Make a Stream with two Traces:

      >>> from obspy import Trace, Stream
      >>> tr1 = Trace(data=np.array([0, -3, 9, 6, 4]))
      >>> tr2 = Trace(data=np.array([0.3, -0.5, -0.8, 0.4, 0.3]))
      >>> st = Stream(traces=[tr1, tr2])

  All traces are normalized to their absolute maximum and processing information is added:

      >>> st.normalize()
      <...Stream object at 0x...>
      >>> st[0].data
      array([ 0.        , -0.33333333,  1.        ,  0.66666667,  ...])
      >>> print(st[0].stats.processing[0])
      ObsPy ... normalize(norm=None)
      >>> st[1].data
      array([ 0.375, -0.625, -1.   ,  0.5  ,  0.375])
      >>> print(st[1].stats.processing[0])
      ObsPy ...: normalize(norm=None)

  Now let’s do it again normalize all traces to the stream’s global maximum:

      >>> tr1 = Trace(data=np.array([0, -3, 9, 6, 4]))
      >>> tr2 = Trace(data=np.array([0.3, -0.5, -0.8, 0.4, 0.3]))
      >>> st = Stream(traces=[tr1, tr2])

      >>> st.normalize(global_max=True)
      <...Stream object at 0x...>
      >>> st[0].data
      array([ 0.        , -0.33333333,  1.        ,  0.66666667,  ...])
      >>> print(st[0].stats.processing[0])
      ObsPy ...: normalize(norm=9)
      >>> st[1].data
      array([ 0.03333333, -0.05555556, -0.08888889,  0.04444444,  ...])
      >>> print(st[1].stats.processing[0])
      ObsPy ...: normalize(norm=9)

### 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)