Skip to content

Timeseries

Utilities for time series

GravityTimeSeries

Bases: TimeSeries

A time series of gravity values

Parameters:

Name Type Description Default
obj Series | DataFrame

Input data, see :class:TimeSeries.

required
height float

Measurement height, in meters.

None
vgg float

Vertical gravity gradient, in nm/s² per meter.

None

has_error property

True, if column of error values exists

meta property

Dict of meta attibutes

y property

Main value column

y_err property

Error value column

adev(taus='auto', mrate=None)

Calculate the Allan deviation

Parameters:

Name Type Description Default
taus str | array

Time interval values tau to calculate the Allan deviation at.

'auto'
mrate float | str

Measurement rate, in Hz.

None

Returns:

Type Description
Series

Allan deviation

chunks(freq='1D')

Itervate over time series by intervals

Parameters:

Name Type Description Default
freq str

Duration of time intervals, e. g. "1D" for day intervals.

'1D'

Yields:

Type Description
TimeSeries

Segment of this time series

mask(*args, **kwargs)

Mask samples by a condition and return as new TimeSeries

mean()

Mean, standard deviation and standard error of the mean

Mean, standard deviation and SEM are weighted, if the time series has an error column. See weighted_mean.

Returns:

Name Type Description
mean float

Mean value.

std float

Standard deviation.

sem float

Standard error of the mean.

mean_std()

Mean gravity value with standard deviation as error

Returns:

Type Description
AbsGValue

Absolute gravity value.

plot(fmt=None, ax=None, y0=None, **kwargs)

Plot gravity time series

plot_adev(mrate=None, ax=None, **kwargs)

Plot the Allan deviation

plot_chunks(freq='1D', ylim=None, **kwargs)

Plot time series in chunks

plot_mean(sem=False, std=False, y0=None, ax=None, **kwargs)

Plot mean, standard deviation and standard error of the mean (SEM)

resample(interval, min_count=None, err='sem', **kwargs)

Resample time series to new interval duration

See interval_means().

Parameters:

Name Type Description Default
interval str

Resampling interval, e.g. "1h".

required
min_count int | float

Minimum number of samples required in interval. Intervals with fewer samples are evaluated as NaN.

None
err str

Statistical function to use for error column. Options are "sem" (standard error of the mean) and "std" (standard deviation).

'sem'
kwargs dict

Keyword arguments to be updated on resulting TimeSeries. Unspecified keywords are inherited.

{}

Returns:

Type Description
TimeSeries

Time series of resampled data.

std()

Standard deviation

to_csv(path, float_format='%.2f', **kwargs)

Save to a CSV file

transfer(h)

Transfer to another height using VGG

Parameters:

Name Type Description Default
h float

New height, in meters.

required

Returns:

Type Description
GravityTimeSeries

Height transferred gravity data.

TimeSeries

A wrapper of pandas.Series for time series

Parameters:

Name Type Description Default
obj (Series, DataFrame)

Input data object with a time index. When passing a pandas.DataFrame, it is expected to have a data column y and optional columns y_err. When passing a 1-dim. series, it is converted to a pandas.DataFrame with one column named y.

required
**kwargs dict

Optional keyword arguments to be used for plotting.

{}

has_error property

True, if column of error values exists

meta property

Dict of meta attibutes

y property

Main value column

y0 property

Plot y-axis offset

y_err property

Error value column

adev(taus='auto', mrate=None)

Calculate the Allan deviation

Parameters:

Name Type Description Default
taus str | array

Time interval values tau to calculate the Allan deviation at.

'auto'
mrate float | str

Measurement rate, in Hz.

None

Returns:

Type Description
Series

Allan deviation

chunks(freq='1D')

Itervate over time series by intervals

Parameters:

Name Type Description Default
freq str

Duration of time intervals, e. g. "1D" for day intervals.

'1D'

Yields:

Type Description
TimeSeries

Segment of this time series

mask(*args, **kwargs)

Mask samples by a condition and return as new TimeSeries

mean()

Mean, standard deviation and standard error of the mean

Mean, standard deviation and SEM are weighted, if the time series has an error column. See weighted_mean.

Returns:

Name Type Description
mean float

Mean value.

std float

Standard deviation.

sem float

Standard error of the mean.

plot(fmt=None, ax=None, y0=None, errorbars=True, min_count=None, **kwargs)

Plot

Parameters:

Name Type Description Default
fmt str

Plot style

None
ax Axes

Plot axes

None
y0 float

Y-axis offset to be applied to data. Acquired from y0 property, if unspecified.

None
errorbars bool

Plot errorbars, if possible.

True
min_count int | float

Minimum number of samples in an interval, given by column y_count, for a point to be plotted. Fractional values are considered relative to maximum count. Ignored, if there is no column y_count.

None
kwargs dict

Arguments to be passed to Matplotlib.

{}

plot_adev(mrate=None, ax=None, **kwargs)

Plot the Allan deviation

plot_chunks(freq='1D', ylim=None, **kwargs)

Plot time series in chunks

plot_mean(sem=False, std=False, y0=None, ax=None, **kwargs)

Plot mean, standard deviation and standard error of the mean (SEM)

resample(interval, min_count=None, err='sem', **kwargs)

Resample time series to new interval duration

See interval_means().

Parameters:

Name Type Description Default
interval str

Resampling interval, e.g. "1h".

required
min_count int | float

Minimum number of samples required in interval. Intervals with fewer samples are evaluated as NaN.

None
err str

Statistical function to use for error column. Options are "sem" (standard error of the mean) and "std" (standard deviation).

'sem'
kwargs dict

Keyword arguments to be updated on resulting TimeSeries. Unspecified keywords are inherited.

{}

Returns:

Type Description
TimeSeries

Time series of resampled data.

std()

Standard deviation