def create_table(num_slot_per_sf=None, max_n=None, ilst=None, factor=None): num_symb_per_slot = 14 num_symb_per_sf = num_symb_per_slot * num_slot_per_sf total_sf = 5 total_symb = total_sf * num_slot_per_sf * num_symb_per_slot num_symb = total_symb row_hf = ["half frame" for i in range(num_symb)] row_sf = [f"subframe {i//num_symb_per_sf}" for i in range(num_symb)] row_slot = [f"slot {i//num_symb_per_slot}" for i in range(num_symb)] row_symb = [i % num_symb_per_slot for i in range(num_symb)] data = [[i for i in range(num_symb)]] class_data = ["" for i in range(num_symb)] for n in range(max_n + 1): for i in ilst: idx = i + factor * n set_class(class_data, idx) class_data = [class_data] a1 = None x = [row_hf, row_sf, row_slot, row_symb] x = [row_sf, row_slot] x = [row_sf] y = None caption = None return ztable.create_htable(a1=a1, x=x, y=y, data=data, class_data=class_data, caption=caption, num_merge_rows=None, num_merge_cols=None)
def create_table2(num_slot_per_sf=None, max_n=None, ilst=None, factor=None): num_symb_per_slot = 14 num_symb_per_sf = num_symb_per_slot * num_slot_per_sf total_sf = 5 # total_symb = total_sf * num_slot_per_sf * num_symb_per_slot # num_symb = total_symb data = [[row * num_symb_per_slot + i for i in range(num_symb_per_slot)] for row in range(total_sf * num_slot_per_sf)] data = [["" for i in range(num_symb_per_slot)] for row in range(total_sf * num_slot_per_sf)] class_data = [["" for i in range(num_symb_per_slot)] for row in range(total_sf * num_slot_per_sf)] total_idx = 0 for n in range(max_n + 1): for i in ilst: idx = i + factor * n r, c = divmod(idx, num_symb_per_slot) class_data[r][c] = "start" data[r][c] = total_idx class_data[r][c] = f"idx{total_idx%2}" for j in (1, 2, 3): r, c = divmod(idx + j, num_symb_per_slot) class_data[r][c] = "ssb" # data[r][c] = total_idx class_data[r][c] = f"idx{total_idx%2}" total_idx += 1 if total_idx == 64: break a1 = [["subframe", "slot"], ["subframe", "slot"]] x = [["symbol"] * num_symb_per_slot, [i for i in range(num_symb_per_slot)]] y0 = [sf for sf in range(total_sf) for slot in range(num_slot_per_sf)] y1 = [slot for sf in range(total_sf) for slot in range(num_slot_per_sf)] y = [y0, y1] if num_slot_per_sf == 1: a1 = [["subframe"], ["subframe"]] y = [y0] caption = "SSB Burst half frame" return ztable.create_htable(a1=a1, x=x, y=y, data=data, class_data=class_data, caption=caption, num_merge_rows=None, num_merge_cols=None)
def create_table(mu, num_symb=14): num_sf = 1 num_slot = 2**mu scs = 15 * num_slot ms_per_slot = 1 / num_slot ms_per_symb = ms_per_slot / num_symb ms_per_symb = int(ms_per_symb * 1000 * 1000) ms_per_symb = f"{ms_per_symb}ns" rb_khz = scs * 12 a1 = [['subcarrier']] * 3 a1 = None sf_row_x = [ f"subframe" for sf in range(num_sf) for slot in range(num_slot) for symb in range(num_symb) ] slot_row_x = [ f"slot{slot}" for sf in range(num_sf) for slot in range(num_slot) for symb in range(num_symb) ] symb_row_x = [ hex(symb)[-1] for sf in range(num_sf) for slot in range(num_slot) for symb in range(num_symb) ] # x = [sf_row_x, slot_row_x, symb_row_x] x = [slot_row_x, symb_row_x] x = [slot_row_x] sc_col_rb = [f"{scs}kHz<br>*<br>12" for sc in reversed(range(12))] sc_col_rb = [f"{rb_khz}<br>kHz<br>" for sc in reversed(range(12))] # sc_col_y = [f"{sc}" for sc in reversed(range(12))] # y = [sc_col_rb, sc_col_y] y = [sc_col_rb] class_data = [[ f'mu{mu}-{num_symb} slot{col//num_symb%10%2}' for col in range(num_sf * num_slot * num_symb) ] for row in range(12)] caption = f"μ={mu}, scs={scs}kHz, 1sf=(1ms, {num_slot}slot, {num_symb*num_slot}symbol), 1slot={ms_per_slot}ms, 1symbol={ms_per_symb}" document['zone-output'] <= ztable.create_htable(a1=a1, x=x, y=y, data=None, class_data=class_data, caption=caption, num_merge_rows=None, num_merge_cols=None)
def main(event): document['zone-output'].clear() a1, x, y = None, None, None x, result = codebook.Codebook(cfg).get_table() x = x[:-2] + x[-1:] result = [row[:-2] + row[-1:] for row in result] y = list(range(len(result))) document['zone-output'] <= ztable.create_htable(a1=a1, x=x, y=y, data=result, class_data=None, caption='', num_merge_rows=None, num_merge_cols=None) window.MathJax.Hub.Queue(["Typeset", window.MathJax.Hub])