Utils Module

The utils module includes helper functions. The module currently contains a single function to help users convert numeric indexes to datetime indexes. Additional helper functions could be added at a later date.

matlab_to_datetime

Convert MATLAB datenum format to Python datetime

excel_to_datetime

Convert Excel datenum format to Python datetime

get_statistics

Calculate mean, max, min and stdev statistics of continuous data for a given statistical window.

vector_statistics

Function used to calculate statistics for vector/directional channels based on routine from Campbell data logger and Yamartino algorithm

unwrap_vector

Function used to unwrap vectors into 0-360 deg range

magnitude_phase

Retuns magnitude and phase in two or three dimensions.

unorm

Calculates the root mean squared value given three arrays.

handle_caching

Handles caching of data to avoid redundant network requests or computations.

clear_cache

Clears the cache.

upcrossing

Finds the zero upcrossing points.

peaks

Finds the peaks between zero crossings.

troughs

Finds the troughs between zero crossings.

heights

Calculates the height between zero crossings.

periods

Calculates the period between zero crossings.

custom

Applies a custom function to the timeseries data between upcrossing points.

to_numeric_array

Convert input data to a numeric array, ensuring all elements are numeric.

convert_to_dataset

Converts the given data to an xarray.Dataset.

convert_to_dataarray

Converts the given data to an xarray.DataArray.

convert_nested_dict_and_pandas

Recursively searches inside nested dictionaries for pandas DataFrames to convert to xarray Datasets.