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:
# convert RXFREQUENCY and TXFREQUENCY to float and from MHz to GHz
# check if columns exists (only present with 2021-05)
if 'RXFREQUENCY' in df_config.columns and 'TXFREQUENCY' in df_config.columns:
df_config['RXFREQUENCY'] = df_config['RXFREQUENCY'].astype('float')
df_config['RXFREQUENCY'] = df_config['RXFREQUENCY']/1000
if 'TXFREQUENCY' in df_config.columns and 'RXFREQUENCY' in df_config.columns:
df_config['TXFREQUENCY'] = df_config['TXFREQUENCY'].astype('float')
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')
......@@ -469,7 +469,15 @@ def prep() -> None:
# convert 3min windows to 15min windows
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()
_log('Converted 3min windows to 15min windows')
......@@ -508,6 +516,9 @@ def prep() -> None:
'TXLEVEL' : 'TxLevel',
'MEANLINKDIFFLEVEL' : 'MeanLinkDiffLevel',
'DIFFLEVEL' : 'DiffLevel',
'SPEED' : 'Speed',
'CURRTXBITRATE' : 'TxBitrate',
'CURRRXBITRATE' : 'RxBitrate',
'LONGITUDE_A' : 'XStart',
'LATITUDE_A' : 'YStart',
'LONGITUDE_MID' : 'XMid',
......@@ -519,10 +530,10 @@ def prep() -> None:
}
# 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({
'RXFREQUENCY' : 'RxFrequency',
'TXFREQUENCY' : 'TxFrequency'
'TXFREQUENCY' : 'TxFrequency',
'RXFREQUENCY' : 'RxFrequency'
})
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