From fe807d637d984c129da3b0ee8419dc8b3ef4b892 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=93=D0=B5=D1=80=D0=BC=D0=B0=D0=BD=20=D0=A1=D0=B5=D0=BC?= =?UTF-8?q?=D0=B5=D0=BD=D0=BE=D0=B2?= Date: Fri, 24 Mar 2023 02:19:51 +0300 Subject: [PATCH] Added calculate freq using LTE TDD bands in earfcn2freq function --- utils/eu_arfcn_calc.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/utils/eu_arfcn_calc.py b/utils/eu_arfcn_calc.py index 440bb95..36f65a9 100755 --- a/utils/eu_arfcn_calc.py +++ b/utils/eu_arfcn_calc.py @@ -455,10 +455,15 @@ def earfcn2freq(band, dl_earfcn=None, ul_earfcn=None): out: tuple (float downlink_freq, float uplink_freq) ''' NDL_Offset = table_earfcn[band]['NDL_Offset'] - NUL_Offset = table_earfcn[band]['NUL_Offset'] - duplex_spacing = abs(table_earfcn[band]['FDL_Low']-table_earfcn[band]['FUL_Low']) + if table_earfcn[band].__contains__('NUL_Offset'): + NUL_Offset = table_earfcn[band]['NUL_Offset'] + if table_earfcn[band].__contains__('FUL_Low'): + ful_low = table_earfcn[band]['FUL_Low'] + else: + ful_low = 0 + duplex_spacing = abs(table_earfcn[band]['FDL_Low']-ful_low) FDL_Low = table_earfcn[band]['FDL_Low'] - FUL_Low = table_earfcn[band]['FUL_Low'] + FUL_Low = ful_low downlink_freq = uplink_freq = None if dl_earfcn is not None: downlink_freq = FDL_Low + 0.1 * (dl_earfcn-NDL_Offset) @@ -468,6 +473,10 @@ def earfcn2freq(band, dl_earfcn=None, ul_earfcn=None): uplink_freq = downlink_freq - duplex_spacing elif downlink_freq is None and uplink_freq is not None: downlink_freq = downlink_freq + duplex_spacing + + if FUL_Low == 0: + uplink_freq = 0 + return (downlink_freq, uplink_freq) if __name__ == "__main__":