pytesmo.time_series package

Submodules

pytesmo.time_series.anomaly module

Created on June 20, 2013

@author: Alexander Gruber Alexander.Gruber@geo.tuwien.ac.at

pytesmo.time_series.anomaly.calc_anomaly(Ser, window_size=35, climatology=None)[source]

Calculates the anomaly of a time series (Pandas series). Both, climatology based, or moving-average based anomalies can be calculated

Parameters:

Ser : pandas.Series (index must be a DateTimeIndex)

window_size : float, optional

The window-size [days] of the moving-average window to calculate the anomaly reference (only used if climatology is not provided) Default: 35 (days)

climatology : pandas.Series (index: 1-366), optional

if provided, anomalies will be based on the climatology

timespann : [timespan_from, timespan_to], datetime.datetime(y,m,d), optional

If set, only a subset

Returns:

anomaly : pandas.Series

Series containing the calculated anomalies

pytesmo.time_series.anomaly.calc_climatology(Ser, moving_avg_orig=5, moving_avg_clim=30, median=False, timespan=None)[source]

Calculates the climatology of a data set

Parameters:

Ser : pandas.Series (index must be a DateTimeIndex or julian date)

moving_avg_orig : float, optional

The size of the moving_average window [days] that will be applied on the input Series (gap filling, short-term rainfall correction) Default: 5

moving_avg_clim : float, optional

The size of the moving_average window [days] that will be applied on the calculated climatology (long-term event correction) Default: 35

median : boolean, optional

if set to True, the climatology will be based on the median conditions

timespan : [timespan_from, timespan_to], datetime.datetime(y,m,d), optional

Set this to calculate the climatology based on a subset of the input Series

Returns:

climatology : pandas.Series

Series containing the calculated climatology

pytesmo.time_series.filtering module

Created on Oct 16, 2013

@author: Christoph Paulik christoph.paulik@geo.tuwien.ac.at

pytesmo.time_series.filtering.moving_average(Ser, window_size=1)[source]

Applies a moving average (box) filter on an input time series

Parameters:

Ser : pandas.Series (index must be a DateTimeIndex or julian date)

window_size : float, optional

The size of the moving_average window [days] that will be applied on the input Series Default: 1

Returns:

Ser : pandas.Series

moving-average filtered time series

pytesmo.time_series.filters module

Created on Oct 16, 2013

Fast cython functions for calculating various filters

@author: Christoph Paulik christoph.paulik@geo.tuwien.ac.at

pytesmo.time_series.filters.boxcar_filter(ndarray in_data, ndarray in_jd, float window=1, double nan=-999999.0)

Calculates exponentially filtered time series using a boxcar filter - basically a moving average calculation

Parameters:

in_data : double numpy.array

input data

in_jd : double numpy.array

julian dates of input data

window : int

characteristic time used for calculating the weight

nan : double

nan values to exclude from calculation

pytesmo.time_series.filters.exp_filter(ndarray in_data, ndarray in_jd, int ctime=10, double nan=-999999.0)

Calculates exponentially smoothed time series using an iterative algorithm

Parameters:

in_data : double numpy.array

input data

in_jd : double numpy.array

julian dates of input data

ctime : int

characteristic time used for calculating the weight

nan : double

nan values to exclude from calculation

pytesmo.time_series.plotting module

Module contents