Commit 1a404442 authored by Fabian Kovac's avatar Fabian Kovac
Browse files

[b] rounding time windows

parent b1cec9c0
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
# Title: Data Preparation for LINK Configs and Transmissions # Title: Data Preparation for LINK Configs and Transmissions
# Author: Fabian Kovac <ds191008@fhstp.ac.at> # Author: Fabian Kovac <ds191008@fhstp.ac.at>
# Team: University of Applied Sciences St. Pölten # Team: University of Applied Sciences St. Pölten
# Version: 2.1 # Version: 2.2
# Last changed: 2021-07-05 # Last changed: 2021-07-15
# #
import sys import sys
...@@ -14,7 +14,6 @@ import datetime ...@@ -14,7 +14,6 @@ import datetime
import numpy as np import numpy as np
import pandas as pd import pandas as pd
from pandas.tseries.offsets import Minute
def parse_arguments() -> argparse.Namespace: def parse_arguments() -> argparse.Namespace:
...@@ -456,7 +455,7 @@ def prep() -> None: ...@@ -456,7 +455,7 @@ def prep() -> None:
df_link['BEGINTIME'] = df_link['BEGINTIME'].dt.tz_localize('Europe/Vienna').dt.tz_convert('UTC').dt.tz_localize(None) df_link['BEGINTIME'] = df_link['BEGINTIME'].dt.tz_localize('Europe/Vienna').dt.tz_convert('UTC').dt.tz_localize(None)
_log('Converted BEGINTIME to UTC') _log('Converted BEGINTIME to UTC')
# fix 15min time-lag in transmissions # fix 15min timelag in transmissions
df_link['BEGINTIME'] = df_link['BEGINTIME'] - pd.Timedelta(15, unit = 'min') df_link['BEGINTIME'] = df_link['BEGINTIME'] - pd.Timedelta(15, unit = 'min')
_log('Fixed 15min timelag in transmissions') _log('Fixed 15min timelag in transmissions')
...@@ -472,7 +471,7 @@ def prep() -> None: ...@@ -472,7 +471,7 @@ def prep() -> None:
_log('Created PMIN and PMAX of REMOTERXLEVEL') _log('Created PMIN and PMAX of REMOTERXLEVEL')
# convert 3min windows to 15min windows # convert 3min windows to 15min windows
group_cols = [df_link['BEGINTIME'].dt.floor('15Min'), 'RADIOLINKID'] group_cols = [df_link['BEGINTIME'].dt.round('15Min'), 'RADIOLINKID']
agg_cols = { agg_cols = {
'PMIN' : 'min', 'PMIN' : 'min',
'PMAX' : 'max', 'PMAX' : 'max',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment