gloria.Cauchy#

class gloria.Cauchy(*, width)[source]#

A Cauchy shaped profile.

For a given time \(t\) the profile can be described by

\[f(t) = \frac{1}{4\cdot \left(t-t_0 \right)^2 / w^2 + 1}\]

with width=w being a constructor parameter as well as t_anchor=t_0 the input of generate(). The following plot illustrates the Cauchy function.

Example plot of a Cauchy function.
Parameters:

width (pandas.Timedelta | str) – Temporal width of the Cauchy function given as pandas.Timedelta or string representing such.

Methods

classmethod from_dict(profile_dict)[source]#

Creates a Cauchy object from a dictionary.

The key-value pairs of the dictionary must correspond to the constructor arguments of the profile.

Parameters:

profile_dict (dict[str, Any]) – Dictionary containing all profile fields

Returns:

Cauchy object with fields from profile_dict

Return type:

Cauchy

generate(timestamps, t_anchor)[source]#

Generate a time series with a single Cauchy profile.

Parameters:
  • timestamps (pandas.Series) – The input timestamps at which the Cauchy profile is to be evaluated.

  • t_anchor (pandas.Timestamp) – Location of the Cauchy profile’s mode.

  • self (Self)

Returns:

The output time series including the Cauchy profile with amplitude 1.

Return type:

pandas.Series

to_dict()[source]#

Converts the Cauchy profile to a JSON-serializable dictionary.

Returns:

Dictionary containing all profile fields including an extra profile_type = "Cauchy" item.

Return type:

dict[str, Any]

Parameters:

self (Self)