# obspy.core.trace.Trace.taper

`Trace.``taper`(max_percentage, type='hann', max_length=None, side='both', **kwargs)

  Taper the trace.

  Optional (and sometimes necessary) options to the tapering function can be provided as kwargs. See respective function definitions in Supported Methods section below.

  Parameters: | type (str) Type of taper to use for detrending. Defaults to `'hann'`. See the Supported Methods section below for further details. max_percentage (None, float) Decimal percentage of taper at one end (ranging from 0. to 0.5). max_length (None, float) Length of taper at one end in seconds. side (str) Specify if both sides should be tapered (default, “both”) or if only the left half (“left”) or right half (“right”) should be tapered.

  Note

  To get the same results as the default taper in SAC, use max_percentage=0.05 and leave type as hann.

  Note

  If both max_percentage and max_length are set to a float, the shorter tape length is used. If both max_percentage and max_length are set to None, the whole trace will be tapered.

  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 trace object. This also makes an entry with information on the applied processing in `stats.processing` of this trace.

  Supported Methods

  `'cosine'`
    Cosine taper, for additional options like taper percentage see: `obspy.signal.invsim.cosine_taper()`.
  `'barthann'`
    Modified Bartlett-Hann window. (uses: `scipy.signal.barthann()`)
  `'bartlett'`
    Bartlett window. (uses: `scipy.signal.bartlett()`)
  `'blackman'`
    Blackman window. (uses: `scipy.signal.blackman()`)
  `'blackmanharris'`
    Minimum 4-term Blackman-Harris window. (uses: `scipy.signal.blackmanharris()`)
  `'bohman'`
    Bohman window. (uses: `scipy.signal.bohman()`)
  `'boxcar'`
    Boxcar window. (uses: `scipy.signal.boxcar()`)
  `'chebwin'`
    Dolph-Chebyshev window. (uses: `scipy.signal.chebwin()`)
  `'flattop'`
    Flat top window. (uses: `scipy.signal.flattop()`)
  `'gaussian'`
    Gaussian window with standard-deviation std. (uses: `scipy.signal.gaussian()`)
  `'general_gaussian'`
    Generalized Gaussian window. (uses: `scipy.signal.general_gaussian()`)
  `'hamming'`
    Hamming window. (uses: `scipy.signal.hamming()`)
  `'hann'`
    Hann window. (uses: `scipy.signal.hann()`)
  `'kaiser'`
    Kaiser window with shape parameter beta. (uses: `scipy.signal.kaiser()`)
  `'nuttall'`
    Minimum 4-term Blackman-Harris window according to Nuttall. (uses: `scipy.signal.nuttall()`)
  `'parzen'`
    Parzen window. (uses: `scipy.signal.parzen()`)
  `'slepian'`
    Slepian window. (uses: `scipy.signal.slepian()`)
  `'triang'`
    Triangular window. (uses: `scipy.signal.triang()`)

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