# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# +
# #!/usr/bin/python

import os
import sys
import shutil
import traceback

import matplotlib.pyplot as plt
import numpy as np
import logging

from mobile_insight.monitor import OfflineReplayer
from uplink_booster_analyzer import lte_measurement_analyzer
from uplink_booster_analyzer import goodsol_analyzer

def lte_phy_analysis():
    src = OfflineReplayer()
    src.set_input_path("0520_1535/diag_log_20210520_153607_35cb84f3b2b56db9efc172f207e22eb9_Google-Pixel_45005.mi2log")
    src.set_input_path(sys.argv[1])
    # print (sys.argv[1])

    phy_analyzer = goodsol_analyzer.MyAnalyzer()
    phy_analyzer.set_source(src)

    meas_analyzer = lte_measurement_analyzer.LteMeasurementAnalyzer()
    meas_analyzer.set_source(src)

    src.run()

    return phy_analyzer, meas_analyzer


phy, meas = lte_phy_analysis()
# print stats.all_packets
# print stats.cum_err_block
# print stats.cum_block

print("SR subframe number: ", phy.sr_sfn)
print("SR RB slots: ", phy.rb_slot1, phy.rb_slot2)
print("Ul BW: ", phy.lte_ul_bw/1000000)
print("Ul BW utilized: ", phy.lte_ul_grant_utilized/1000000)

print('RSSI list: ', meas.serv_cell_rsrp)
# -



StarcoderdataJupyterScriptsDedupFiltered