{ "cells": [ { "cell_type": "markdown", "id": "10a06db5", "metadata": {}, "source": [ "# Pre-processing Module – Usage Example\n", "\n", "This notebook provides an example of how to apply the functions included in the `pre_processing` module to an artificial dataset. \n", "You can generate this dataset by running the `generate_data.py` script located in the `/data` directory. \n", "A detailed description of the artificial dataset can be found in the [test_data](test_data.rst) page.\n", "\n", "The following code blocks make direct use of the functions from the `pre_processing` module, with the exception of `despiking_VM97()`. \n", "In that case, the function has been unpacked to reveal the effect of each iteration on the time series, allowing for a clearer understanding of its internal mechanism." ] }, { "cell_type": "code", "execution_count": 10, "id": "f77d3ef3", "metadata": {}, "outputs": [], "source": [ "# import libraries\n", "import numpy as np\n", "import pandas as pd\n", "import matplotlib.pyplot as plt\n", "import core as core\n", "import pre_processing as pre_processing" ] }, { "cell_type": "code", "execution_count": 2, "id": "35abd5cd", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| \n", " | u | \n", "v | \n", "w | \n", "T_s | \n", "
|---|---|---|---|---|
| Time | \n", "\n", " | \n", " | \n", " | \n", " |
| 2012-09-28 02:00:00.000 | \n", "1.333983 | \n", "1.950923 | \n", "-1.315317 | \n", "21.345880 | \n", "
| 2012-09-28 02:00:00.050 | \n", "3.913318 | \n", "3.113077 | \n", "0.963788 | \n", "20.241874 | \n", "
| 2012-09-28 02:00:00.100 | \n", "2.968685 | \n", "2.469642 | \n", "-1.189558 | \n", "19.199482 | \n", "
| 2012-09-28 02:00:00.150 | \n", "1.802636 | \n", "2.895592 | \n", "0.841644 | \n", "19.297309 | \n", "
| 2012-09-28 02:00:00.200 | \n", "2.039941 | \n", "2.993014 | \n", "-0.849563 | \n", "20.799291 | \n", "
| ... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
| 2012-09-28 02:59:59.800 | \n", "2.306694 | \n", "2.139521 | \n", "0.166791 | \n", "21.853908 | \n", "
| 2012-09-28 02:59:59.850 | \n", "1.747777 | \n", "2.585360 | \n", "0.969503 | \n", "20.976037 | \n", "
| 2012-09-28 02:59:59.900 | \n", "2.334571 | \n", "0.978542 | \n", "0.615828 | \n", "20.735504 | \n", "
| 2012-09-28 02:59:59.950 | \n", "2.406629 | \n", "2.581448 | \n", "-0.812357 | \n", "19.292241 | \n", "
| 2012-09-28 03:00:00.000 | \n", "1.229078 | \n", "2.900965 | \n", "-1.132447 | \n", "20.432471 | \n", "
71800 rows × 4 columns
\n", "