Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
oeigner
LINK - Forschungsprojekt Repo
Commits
47fcc23a
Commit
47fcc23a
authored
Jul 01, 2021
by
Fabian Kovac
Browse files
[i] added speed and bitrates to link df
parent
1e33cdc4
Changes
1
Hide whitespace changes
Inline
Side-by-side
FHSTP/prep.py
View file @
47fcc23a
...
...
@@ -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
'
R
XFREQUENCY'
in
df_link
.
columns
and
'
T
XFREQUENCY'
in
df_link
.
columns
:
if
'
T
XFREQUENCY'
in
df_link
.
columns
and
'
R
XFREQUENCY'
in
df_link
.
columns
:
name_cols
.
update
({
'
R
XFREQUENCY'
:
'
R
xFrequency'
,
'
T
XFREQUENCY'
:
'
T
xFrequency'
'
T
XFREQUENCY'
:
'
T
xFrequency'
,
'
R
XFREQUENCY'
:
'
R
xFrequency'
})
df_link
=
df_link
.
rename
(
columns
=
name_cols
).
reindex
(
columns
=
list
(
name_cols
.
values
()))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment