Commit 47fcc23a authored by Fabian Kovac's avatar Fabian Kovac
Browse files

[i] added speed and bitrates to link df

parent 1e33cdc4
...@@ -430,11 +430,11 @@ def prep() -> None: ...@@ -430,11 +430,11 @@ def prep() -> None:
# convert RXFREQUENCY and TXFREQUENCY to float and from MHz to GHz # convert RXFREQUENCY and TXFREQUENCY to float and from MHz to GHz
# check if columns exists (only present with 2021-05) # check if columns exists (only present with 2021-05)
if 'RXFREQUENCY' in df_config.columns and 'TXFREQUENCY' in df_config.columns: if 'TXFREQUENCY' in df_config.columns and 'RXFREQUENCY' in df_config.columns:
df_config['RXFREQUENCY'] = df_config['RXFREQUENCY'].astype('float')
df_config['RXFREQUENCY'] = df_config['RXFREQUENCY']/1000
df_config['TXFREQUENCY'] = df_config['TXFREQUENCY'].astype('float') df_config['TXFREQUENCY'] = df_config['TXFREQUENCY'].astype('float')
df_config['TXFREQUENCY'] = df_config['TXFREQUENCY']/1000 df_config['TXFREQUENCY'] = df_config['TXFREQUENCY']/1000
df_config['RXFREQUENCY'] = df_config['RXFREQUENCY'].astype('float')
df_config['RXFREQUENCY'] = df_config['RXFREQUENCY']/1000
_log('Converted RXFREQUENCY and TXFREQUENCY to float and GHz') _log('Converted RXFREQUENCY and TXFREQUENCY to float and GHz')
...@@ -469,7 +469,15 @@ def prep() -> None: ...@@ -469,7 +469,15 @@ def prep() -> None:
# 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.floor('15Min'), 'RADIOLINKID']
agg_cols = {'TXLEVEL' : 'mean', 'REMOTERXLEVEL' : 'mean', 'PMIN' : 'min', 'PMAX' : 'max'} agg_cols = {
'TXLEVEL' : 'mean',
'REMOTERXLEVEL' : 'mean',
'PMIN' : 'min',
'PMAX' : 'max',
'SPEED' : 'mean',
'CURRTXBITRATE' : 'mean',
'CURRRXBITRATE' : 'mean'
}
df_link = df_link.groupby(group_cols).agg(agg_cols).reset_index() df_link = df_link.groupby(group_cols).agg(agg_cols).reset_index()
_log('Converted 3min windows to 15min windows') _log('Converted 3min windows to 15min windows')
...@@ -508,6 +516,9 @@ def prep() -> None: ...@@ -508,6 +516,9 @@ def prep() -> None:
'TXLEVEL' : 'TxLevel', 'TXLEVEL' : 'TxLevel',
'MEANLINKDIFFLEVEL' : 'MeanLinkDiffLevel', 'MEANLINKDIFFLEVEL' : 'MeanLinkDiffLevel',
'DIFFLEVEL' : 'DiffLevel', 'DIFFLEVEL' : 'DiffLevel',
'SPEED' : 'Speed',
'CURRTXBITRATE' : 'TxBitrate',
'CURRRXBITRATE' : 'RxBitrate',
'LONGITUDE_A' : 'XStart', 'LONGITUDE_A' : 'XStart',
'LATITUDE_A' : 'YStart', 'LATITUDE_A' : 'YStart',
'LONGITUDE_MID' : 'XMid', 'LONGITUDE_MID' : 'XMid',
...@@ -519,10 +530,10 @@ def prep() -> None: ...@@ -519,10 +530,10 @@ def prep() -> None:
} }
# check if RXFREQUENCY and TXFREQUENCY exists (only present with 2021-05) # check if RXFREQUENCY and TXFREQUENCY exists (only present with 2021-05)
if 'RXFREQUENCY' in df_link.columns and 'TXFREQUENCY' in df_link.columns: if 'TXFREQUENCY' in df_link.columns and 'RXFREQUENCY' in df_link.columns:
name_cols.update({ name_cols.update({
'RXFREQUENCY' : 'RxFrequency', 'TXFREQUENCY' : 'TxFrequency',
'TXFREQUENCY' : 'TxFrequency' 'RXFREQUENCY' : 'RxFrequency'
}) })
df_link = df_link.rename(columns = name_cols).reindex(columns = list(name_cols.values())) df_link = df_link.rename(columns = name_cols).reindex(columns = list(name_cols.values()))
......
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