File size: 5,981 Bytes
939b332 da28aa0 68eb0fd 939b332 68eb0fd 002ceab 9d69630 002ceab 939b332 9b16706 86110dd 01dd930 86110dd bb3e08f 9b16706 9cd5e21 9b16706 86110dd cbbcd31 9b16706 cbbcd31 9b16706 cbbcd31 01dd930 701ad60 939b332 56d8047 bb3e08f a9f4212 bb3e08f ccb28f5 57fe85f ccb28f5 9a4fe9c 9b16706 9a4ad92 263b2ce 57fe85f cbbcd31 ef5e989 939b332 9b16706 939b332 fbf7879 c58bec1 337f0be fbf7879 4662aef fbf7879 c58bec1 fbf7879 56f36cc |
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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 |
import numpy as np
import pandas as pd
# url = "https://raw.githubusercontent.com/DavMelchi/STORAGE/refs/heads/main/physical_db/physical_database.csv"
url = r"./physical_db/physical_database.csv"
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(url)
physical = physical[
[
"Code_Sector",
"Azimut",
"Longitude",
"Latitude",
"Hauteur",
"City",
"Adresse",
"Commune",
"Cercle",
]
]
return physical
class UtilsVars:
sector_mapping = {4: 1, 5: 2, 6: 3, 11: 1, 12: 2, 13: 3, 81: 1, 82: 2, 83: 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: "TRX_TCH"}
oml_lte_freq_band = {
"L1800": "OML E-UTRA Band 3 - 20MHz",
"L800": "OML E-UTRA Band 20 - 20MHz",
"L2300": "OML E-UTRA Band 43 - 20MHz",
"L2600": "OML E-UTRA Band 7 - 20MHz",
}
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",
}
color_mapping = {
"U900": "7fff0000",
"U2100": "7f00ff00",
"G900": "7fff0000",
"G1800": "7f00ff00",
"L800": "7fff0000",
"L1800": "7f00ff00",
"L2300": "7f00ffff",
"L2600": "7f0000ff",
}
size_mapping = {
"U900": 100,
"U2100": 120,
"G900": 100,
"G1800": 120,
"L800": 100,
"L1800": 120,
"L2300": 90,
"L2600": 80,
}
wcdma_band = {
3004: "U900",
3006: "U900",
10787: "U2100",
10837: "U2100",
10812: "U2100",
}
bsc_name = {
403698: "MBSCTST",
403699: "MBSC01",
403701: "MBSC04",
403702: "MBSC03",
403703: "MBSC02",
406283: "MBSKTL01",
406284: "MBSSEG01",
406308: "MBSSK0S1",
}
final_lte_database = ""
final_gsm_database = ""
final_wcdma_database = ""
final_trx_database = ""
final_mrbts_database = ""
final_invunit_database = ""
final_mal_database = ""
gsm_dfs = []
wcdma_dfs = []
lte_dfs = []
all_db_dfs = []
all_db_dfs_names = []
final_all_database = None
atoll_dfs = []
final_atoll_database = None
final_nice_database = None
neighbors_database = ""
file_path = ""
gsm_kml_file = None
wcdma_kml_file = None
lte_kml_file = None
# physisal_db = get_physical_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"
elif "L2600" in text:
return "L2600"
return np.nan # or return None
class GsmAnalysisData:
total_number_of_bsc = 0
total_number_of_cell = 0
number_of_site = 0
number_of_cell_per_bsc = pd.DataFrame()
number_of_site_per_bsc = pd.DataFrame()
number_of_bts_name_empty = 0
number_of_bcf_name_empty = 0
number_of_bcch_empty = 0
bts_administate_distribution = pd.DataFrame()
trx_administate_distribution = pd.DataFrame()
number_of_trx_per_bsc = pd.DataFrame()
number_of_cell_per_lac = pd.DataFrame()
number_of_site_per_lac = pd.DataFrame()
trx_frequency_distribution = pd.DataFrame()
class WcdmaAnalysisData:
total_number_of_rnc = 0
total_number_of_wcel = 0
number_of_site = 0
number_of_site_per_rnc = 0
number_of_cell_per_rnc = pd.DataFrame()
number_of_empty_wbts_name = 0
number_of_empty_wcel_name = 0
wcel_administate_distribution = pd.DataFrame()
psc_distribution = pd.DataFrame()
number_of_cell_per_lac = pd.DataFrame()
number_of_site_per_lac = pd.DataFrame()
class LteFddAnalysisData:
total_number_of_lncel = 0
total_number_of_site = 0
number_of_empty_lncel_name = 0
number_of_empty_lncel_cellname = 0
number_of_empty_lnbts_name = 0
number_of_cell_per_band = pd.DataFrame()
phycellid_distribution = pd.DataFrame()
rootsequenceindex_distribution = pd.DataFrame()
lncel_administate_distribution = pd.DataFrame()
number_of_cell_per_tac = pd.DataFrame()
class LteTddAnalysisData:
total_number_of_lncel = 0
total_number_of_site = 0
number_of_empty_lncel_name = 0
number_of_empty_lncel_cellname = 0
number_of_empty_lnbts_name = 0
number_of_cell_per_band = pd.DataFrame()
phycellid_distribution = pd.DataFrame()
rootsequenceindex_distribution = pd.DataFrame()
lncel_administate_distribution = pd.DataFrame()
number_of_cell_per_tac = pd.DataFrame()
class SiteAnalysisData:
total_number_of_site = 0
total_munber_of_gsm_site = 0
total_number_of_wcdma_site = 0
total_number_of_lte_site = 0
gsm_bands_distribution = pd.DataFrame()
wcdma_bands_distribution = pd.DataFrame()
lte_bands_distribution = pd.DataFrame()
all_bands_distribution = pd.DataFrame()
number_of_trx_per_site_distribution = pd.DataFrame()
|