File size: 2,146 Bytes
939b332
 
 
 
 
 
 
 
 
 
 
 
 
1589f78
939b332
 
 
 
 
 
86110dd
01dd930
 
86110dd
939b332
86110dd
 
 
 
 
 
 
01dd930
 
 
 
 
 
 
939b332
 
 
56d8047
57fe85f
 
263b2ce
57fe85f
939b332
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import numpy as np
import pandas as pd


def get_physical_db():
    """
    Reads the physical_database.csv file from the physical_db directory and
    returns a pandas DataFrame containing only the columns 'Code_Sector',
    'Azimut', 'Longitude', 'Latitude', and 'Hauteur'.

    Returns:
        pd.DataFrame: A DataFrame containing the filtered columns.
    """
    physical = pd.read_csv(r"./physical_db/physical_database.csv")
    physical = physical[["Code_Sector", "Azimut", "Longitude", "Latitude", "Hauteur"]]
    return physical


class UtilsVars:
    sector_mapping = {4: 1, 5: 2, 6: 3, 11: 1, 12: 2, 13: 3}
    type_cellule = {1: "Macro Cell 1800", 0: "Macro Cell 900"}
    oml_band_frequence = {1: "OML BAND GSM 1800", 0: "OML BAND GSM 900"}
    gsm_band = {1: "G1800", 0: "G900"}
    configuration_schema = {1: "EGPRS 1800", 0: "EGPRS 900"}
    channeltype_mapping = {4: "BCCH", 3: "TCH"}
    porteuse_mapping = {
        3004: "OML UTRA Band VIII",
        3006: "OML UTRA Band VIII",
        10812: "OML UTRA Band I",
        10787: "OML UTRA Band I",
        10837: "OML UTRA Band I",
    }
    wcdma_band = {
        3004: "U900",
        3006: "U900",
        10787: "U2100",
        10837: "U2100",
        10812: "U2100",
    }
    final_lte_database = ""
    final_gsm_database = ""
    final_wcdma_database = ""
    final_trx_database = ""
    all_db_dfs = []
    final_all_database = ""
    neighbors_database = ""
    file_path = ""
    physisal_db = get_physical_db()


# print(UtilsVars.physisal_db)


def get_band(text):
    """
    Extract the band from the given string.

    Parameters
    ----------
    text : str
        The string to extract the band from.

    Returns
    -------
    str or np.nan
        The extracted band, or NaN if the text was not a string or did not contain
        any of the recognized bands (L1800, L2300, L800).
    """
    if isinstance(text, str):  # Check if text is a string
        if "L1800" in text:
            return "L1800"
        elif "L2300" in text:
            return "L2300"
        elif "L800" in text:
            return "L800"
    return np.nan  # or return None