update at 2026-10-12 15:14:13
This commit is contained in:
5
web/py/fiber_delay_sim/core/__init__.py
Normal file
5
web/py/fiber_delay_sim/core/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
"""算法核心层:signal / fiber / acquisition / fitting(全部 Pyodide 兼容)。"""
|
||||
|
||||
from . import signal, fiber, acquisition, fitting
|
||||
|
||||
__all__ = ["signal", "fiber", "acquisition", "fitting"]
|
||||
101
web/py/fiber_delay_sim/core/acquisition.py
Normal file
101
web/py/fiber_delay_sim/core/acquisition.py
Normal file
@@ -0,0 +1,101 @@
|
||||
"""测量链仿真:前端展宽 → 采样 → 噪声 → ADC 量化(仅依赖 numpy)。
|
||||
|
||||
物理顺序对应 docs/实现方案.md §7.2。
|
||||
"""
|
||||
|
||||
import numpy as np
|
||||
|
||||
|
||||
def snr_to_sigma(snr_db, peak):
|
||||
"""峰值定义的信噪比 → 噪声标准差:σ = peak · 10^(−SNR/20)。"""
|
||||
return float(peak) * 10.0 ** (-float(snr_db) / 20.0)
|
||||
|
||||
|
||||
def gaussian_response(t, y, sigma_ns):
|
||||
"""模拟前端有限带宽:与高斯冲激响应卷积(sigma_ns<=0 时原样返回)。
|
||||
|
||||
sigma_ns 参考值 1.373 ns(原项目 Fisher 分析中的系统响应,报告 5.4.5)。
|
||||
"""
|
||||
if sigma_ns is None or sigma_ns <= 0:
|
||||
return y
|
||||
t = np.asarray(t, dtype=float)
|
||||
y = np.asarray(y, dtype=float)
|
||||
dt = t[1] - t[0]
|
||||
half = max(1, int(np.ceil(4.0 * sigma_ns / dt)))
|
||||
k = (np.arange(2 * half + 1) - half) * dt
|
||||
kernel = np.exp(-0.5 * (k / sigma_ns) ** 2)
|
||||
kernel = kernel / kernel.sum()
|
||||
padded = np.pad(y, half, mode="edge")
|
||||
return np.convolve(padded, kernel, mode="valid")
|
||||
|
||||
|
||||
def quantize_adc(y, bits, fullscale):
|
||||
"""理想 ADC 均匀量化:LSB = fullscale / (2^bits − 1)。"""
|
||||
lsb = float(fullscale) / (2 ** int(bits) - 1)
|
||||
return np.round(np.asarray(y, dtype=float) / lsb) * lsb
|
||||
|
||||
|
||||
def sample_points(t_cont, y_cont, t0_ns, dt_ns, n_samples):
|
||||
"""理想采样:t_k = t0 + k·Δt 处线性插值取值。"""
|
||||
ts = float(t0_ns) + float(dt_ns) * np.arange(int(n_samples))
|
||||
return ts, np.interp(ts, np.asarray(t_cont, dtype=float), np.asarray(y_cont, dtype=float))
|
||||
|
||||
|
||||
def run_single_channel(t_cont, y_cont, params, rng):
|
||||
"""单通道测量链(M0)。
|
||||
|
||||
params:
|
||||
dt_ns 采样间隔(默认 10)
|
||||
t0_ns 触发位置(默认 0)
|
||||
window_ns 记录窗口(决定采样点数)
|
||||
snr_db 信噪比(None → 无噪声)
|
||||
bits ADC 位数(None → 不量化)
|
||||
fullscale ADC 满量程(None → 2×峰值)
|
||||
bandwidth_sigma_ns 前端高斯响应宽度(0 → 不展宽)
|
||||
jitter_ns 时钟抖动标准差(默认 0)
|
||||
返回 dict(全部纯数据)。
|
||||
"""
|
||||
p = dict(params)
|
||||
t_cont = np.asarray(t_cont, dtype=float)
|
||||
y_cont = np.asarray(y_cont, dtype=float)
|
||||
|
||||
dt = float(p.get("dt_ns", 10.0))
|
||||
t0 = float(p.get("t0_ns", 0.0))
|
||||
window = float(p.get("window_ns", t_cont[-1] - t_cont[0]))
|
||||
n_samples = int(round(window / dt))
|
||||
|
||||
# 1) 前端带宽
|
||||
y_bw = gaussian_response(t_cont, y_cont, p.get("bandwidth_sigma_ns", 0.0))
|
||||
|
||||
# 2) 采样(含可选时钟抖动)
|
||||
ts = t0 + dt * np.arange(n_samples)
|
||||
jitter = float(p.get("jitter_ns", 0.0))
|
||||
if jitter > 0:
|
||||
ts_eff = ts + rng.normal(0.0, jitter, size=n_samples)
|
||||
else:
|
||||
ts_eff = ts
|
||||
y_clean = np.interp(ts_eff, t_cont, y_bw)
|
||||
|
||||
# 3) 噪声(模拟域)
|
||||
snr_db = p.get("snr_db")
|
||||
peak = float(np.max(y_bw)) if np.max(y_bw) > 0 else 1.0
|
||||
sigma = snr_to_sigma(snr_db, peak) if snr_db is not None else 0.0
|
||||
y_meas = y_clean + (rng.normal(0.0, sigma, size=n_samples) if sigma > 0 else 0.0)
|
||||
|
||||
# 4) ADC 量化(数字域)
|
||||
bits = p.get("bits")
|
||||
if bits is not None:
|
||||
fs = p.get("fullscale") or 2.0 * peak
|
||||
y_meas = quantize_adc(y_meas, bits, fs)
|
||||
|
||||
return {
|
||||
"t_samples": ts,
|
||||
"y_clean": y_clean,
|
||||
"y_samples": y_meas,
|
||||
"sigma": sigma,
|
||||
"snr_db": snr_db,
|
||||
"bits": bits,
|
||||
"n_samples": n_samples,
|
||||
"jitter_ns": jitter,
|
||||
"bandwidth_sigma_ns": float(p.get("bandwidth_sigma_ns", 0.0) or 0.0),
|
||||
}
|
||||
138
web/py/fiber_delay_sim/core/fiber.py
Normal file
138
web/py/fiber_delay_sim/core/fiber.py
Normal file
@@ -0,0 +1,138 @@
|
||||
"""光纤延时与采样相位设计(仅依赖 numpy,浏览器可运行)。
|
||||
|
||||
物理关系(研究报告 2.4 节):
|
||||
δ = L·n_g/c 传播延时;n_g=1.468 时 1 m ≈ 4.90 ns
|
||||
φ = δ mod Δt 延时对采样周期取余 → 等效采样相位
|
||||
δk = k·(S − Δt/N) 原项目设计式:S=50 ns 片段定位间隔,N=4 相位
|
||||
"""
|
||||
|
||||
import itertools
|
||||
import numpy as np
|
||||
|
||||
C_LIGHT = 299_792_458.0 # m/s
|
||||
N_G_QUARTZ = 1.468 # 石英光纤群折射率(报告 2.4.1)
|
||||
DT_DEFAULT = 10.0 # ns,高速 ADC 采样间隔
|
||||
S_LOCATOR_DEFAULT = 50.0 # ns,四段波形片段的定位间隔(报告 2.4.2)
|
||||
|
||||
# 原项目名义四组(报告 2.4.2 / 附录 A.4)
|
||||
NOMINAL_LENGTHS_M = [0.0, 9.70, 19.40, 29.10]
|
||||
NOMINAL_DELAYS_NS = [0.0, 47.5, 95.0, 142.5] # 精确设计值 δk = k(S−Δt/N)
|
||||
|
||||
|
||||
def delay_from_length(length_m, n_g=N_G_QUARTZ):
|
||||
"""长度 → 传播延时(ns)。"""
|
||||
return float(length_m) * n_g / C_LIGHT * 1e9
|
||||
|
||||
|
||||
def length_from_delay(delay_ns, n_g=N_G_QUARTZ):
|
||||
"""延时(ns)→ 光纤长度(m)。"""
|
||||
return float(delay_ns) * 1e-9 * C_LIGHT / n_g
|
||||
|
||||
|
||||
def phase_in_period(delay_ns, dt_ns=DT_DEFAULT):
|
||||
"""延时对采样周期取余 → 等效相位(ns)。"""
|
||||
return float(delay_ns) % float(dt_ns)
|
||||
|
||||
|
||||
def forward_design(lengths_m=None, delays_ns=None, n_g=N_G_QUARTZ, dt_ns=DT_DEFAULT):
|
||||
"""正向设计:长度(或设计延时)→ 延时、相位、等效网格与均匀性。
|
||||
|
||||
delays_ns 优先(名义延时 47.5/95/142.5 是精确设计值;
|
||||
名义长度 9.70/19.40/29.10 m 是其四舍五入的反算结果)。
|
||||
"""
|
||||
if delays_ns is None:
|
||||
if lengths_m is None:
|
||||
raise ValueError("lengths_m 与 delays_ns 至少提供一个")
|
||||
delays = [delay_from_length(L, n_g) for L in lengths_m]
|
||||
lengths = [float(L) for L in lengths_m]
|
||||
else:
|
||||
delays = [float(d) for d in delays_ns]
|
||||
lengths = [length_from_delay(d, n_g) for d in delays]
|
||||
|
||||
n = len(delays)
|
||||
phases = [phase_in_period(d, dt_ns) for d in delays]
|
||||
order = sorted(range(n), key=lambda i: phases[i])
|
||||
sorted_phases = [phases[i] for i in order]
|
||||
|
||||
ideal_step = dt_ns / n if n else 0.0
|
||||
gaps = [b - a for a, b in itertools.pairwise(sorted_phases)]
|
||||
if n:
|
||||
gaps.append(sorted_phases[0] + dt_ns - sorted_phases[-1]) # 循环闭合间隔
|
||||
gap_dev = [g - ideal_step for g in gaps]
|
||||
|
||||
return {
|
||||
"n_channels": n,
|
||||
"n_g": n_g,
|
||||
"dt_ns": float(dt_ns),
|
||||
"channels": [
|
||||
{"index": i, "length_m": lengths[i], "delay_ns": delays[i], "phase_ns": phases[i]}
|
||||
for i in range(n)
|
||||
],
|
||||
"phases_ns": phases, # 按通道顺序
|
||||
"sorted_phases_ns": sorted_phases, # 按时间先后排序 → 等效采样网格
|
||||
"order_index": order, # 排序后对应的原通道号
|
||||
"uniformity": {
|
||||
"ideal_step_ns": ideal_step,
|
||||
"gaps_ns": gaps,
|
||||
"max_gap_dev_ns": max((abs(x) for x in gap_dev), default=0.0),
|
||||
"rms_gap_dev_ns": float(np.sqrt(np.mean(np.square(gap_dev)))) if gap_dev else 0.0,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
def inverse_design(target_phases_ns, dt_ns=DT_DEFAULT, n_g=N_G_QUARTZ,
|
||||
s_locator_ns=S_LOCATOR_DEFAULT, max_m=15):
|
||||
"""反向设计:目标相位 → 候选延时/长度与推荐解。
|
||||
|
||||
- 目标为均匀网格 j·Δt/N 时,给出构造式推荐解 δk = k·(S − Δt/N)
|
||||
(复现原项目方案:0/2.5/5/7.5 ns → 0/142.5/95/47.5 ns → 0/29.10/19.40/9.70 m);
|
||||
- 目标非均匀时,返回每相位候选表并提示网格不均匀(这本身是教学点)。
|
||||
"""
|
||||
targets = sorted({round(float(p) % float(dt_ns), 12) for p in target_phases_ns})
|
||||
n = len(targets)
|
||||
tol = 1e-9 * max(1.0, float(dt_ns))
|
||||
|
||||
ideal_grid = [float(dt_ns) * j / n for j in range(n)]
|
||||
is_uniform = all(abs(tg - idl) <= tol for tg, idl in zip(targets, ideal_grid))
|
||||
|
||||
result = {
|
||||
"n_channels": n,
|
||||
"dt_ns": float(dt_ns),
|
||||
"n_g": n_g,
|
||||
"target_phases_ns": targets,
|
||||
"is_uniform_grid": is_uniform,
|
||||
"candidates": [], # 每相位候选:[{phase_ns, m, delay_ns, length_m}]
|
||||
"recommended": None, # 均匀网格时的构造式推荐
|
||||
"construction": None,
|
||||
}
|
||||
|
||||
for ph in targets:
|
||||
cand = []
|
||||
for m in range(int(max_m) + 1):
|
||||
delay = ph + m * float(dt_ns)
|
||||
cand.append({
|
||||
"phase_ns": ph, "m": m,
|
||||
"delay_ns": delay,
|
||||
"length_m": length_from_delay(delay, n_g),
|
||||
})
|
||||
result["candidates"].append(cand)
|
||||
|
||||
if is_uniform and n >= 2:
|
||||
step = float(s_locator_ns) - float(dt_ns) / n
|
||||
rec = []
|
||||
for j, ph in enumerate(targets):
|
||||
k = (n - j) % n # j=0(φ=0)→k=0;j=1→k=n-1;… 复现原项目逐级递推
|
||||
delay = k * step
|
||||
rec.append({
|
||||
"phase_ns": ph, "k": k, "delay_ns": delay,
|
||||
"length_m": length_from_delay(delay, n_g),
|
||||
})
|
||||
# 校验:推荐延时反算相位应等于目标相位
|
||||
for entry in rec:
|
||||
assert abs(phase_in_period(entry["delay_ns"], dt_ns) - entry["phase_ns"]) < 1e-6
|
||||
result["recommended"] = rec
|
||||
result["construction"] = (
|
||||
f"δk = k·(S − Δt/N),S={float(s_locator_ns):g} ns,Δt/N={float(dt_ns)/n:g} ns"
|
||||
)
|
||||
|
||||
return result
|
||||
145
web/py/fiber_delay_sim/core/fitting.py
Normal file
145
web/py/fiber_delay_sim/core/fitting.py
Normal file
@@ -0,0 +1,145 @@
|
||||
"""寿命拟合:非线性最小二乘(单/双指数)、对数线性、稳健拟合(仅依赖 numpy/scipy.optimize)。
|
||||
|
||||
算法对比设计见 docs/实现方案.md §7.5:
|
||||
- 对数线性需先扣基线,对数变换使低信噪比尾部噪声权重失真(教学点);
|
||||
- NLS 为基准算法:理想无噪数据应零偏差复现设定寿命(对应原项目"标准拟合"验证)。
|
||||
"""
|
||||
|
||||
import numpy as np
|
||||
from scipy.optimize import curve_fit, least_squares
|
||||
|
||||
|
||||
def _single_exp(t, A, tau, B):
|
||||
return A * np.exp(-t / tau) + B
|
||||
|
||||
|
||||
def _double_exp(t, A1, tau1, A2, tau2, B):
|
||||
return A1 * np.exp(-t / tau1) + A2 * np.exp(-t / tau2) + B
|
||||
|
||||
|
||||
def initial_guess_single(t, y):
|
||||
"""单指数自动初值:尾段均值作基线、首点定幅度、半衰点定 tau。"""
|
||||
t = np.asarray(t, dtype=float)
|
||||
y = np.asarray(y, dtype=float)
|
||||
tail_n = max(1, len(y) // 5)
|
||||
B0 = float(np.mean(y[-tail_n:]))
|
||||
A0 = float(y[0] - B0)
|
||||
if A0 <= 0:
|
||||
A0 = max(float(np.max(y) - B0), 1e-9)
|
||||
half = B0 + A0 / 2.0
|
||||
below = np.where(y <= half)[0]
|
||||
t_half = float(t[below[0]]) if len(below) else float(t[len(t) // 2])
|
||||
tau0 = max(t_half / np.log(2.0), 1e-3)
|
||||
return [A0, tau0, B0]
|
||||
|
||||
|
||||
def fit_single_exp_nls(t, y, p0=None):
|
||||
"""单指数 + 常数基线的非线性最小二乘拟合。"""
|
||||
t = np.asarray(t, dtype=float)
|
||||
y = np.asarray(y, dtype=float)
|
||||
if p0 is None:
|
||||
p0 = initial_guess_single(t, y)
|
||||
popt, pcov = curve_fit(
|
||||
_single_exp, t, y, p0=p0,
|
||||
bounds=([0.0, 1e-9, -np.inf], [np.inf, np.inf, np.inf]),
|
||||
maxfev=50000,
|
||||
)
|
||||
resid = y - _single_exp(t, *popt)
|
||||
perr = np.sqrt(np.abs(np.diag(pcov)))
|
||||
return {
|
||||
"model": "single_exp_baseline",
|
||||
"A": float(popt[0]), "tau": float(popt[1]), "B": float(popt[2]),
|
||||
"A_err": float(perr[0]), "tau_err": float(perr[1]), "B_err": float(perr[2]),
|
||||
"rmse": float(np.sqrt(np.mean(resid ** 2))),
|
||||
"residual": resid,
|
||||
"popt": [float(v) for v in popt],
|
||||
}
|
||||
|
||||
|
||||
def fit_log_linear(t, y, tail_frac=0.2, b=None):
|
||||
"""对数线性拟合:ln(I−B) 对 t 线性回归 → tau = −1/slope。
|
||||
|
||||
b=None 时用尾段均值估计基线(注意:对 B=0 的纯信号,尾段估计本身
|
||||
就引入偏差——这正是"基线估计误差"教学点,见 docs/实现方案.md §7.5);
|
||||
b 已知时直接使用(此时对数线性与 NLS 在理想数据上数学等价)。
|
||||
返回剔除的非正点数(对数前需 I−B>0),供教学观察。
|
||||
"""
|
||||
t = np.asarray(t, dtype=float)
|
||||
y = np.asarray(y, dtype=float)
|
||||
if b is None:
|
||||
tail_n = max(1, int(len(y) * tail_frac))
|
||||
B = float(np.mean(y[-tail_n:]))
|
||||
baseline_estimated = True
|
||||
else:
|
||||
B = float(b)
|
||||
baseline_estimated = False
|
||||
yy = y - B
|
||||
mask = yy > 0
|
||||
dropped = int(np.sum(~mask))
|
||||
if mask.sum() < 2:
|
||||
return {"model": "log_linear", "tau": None, "A": None, "B_est": B,
|
||||
"baseline_estimated": baseline_estimated,
|
||||
"dropped_points": dropped, "n_used": int(mask.sum())}
|
||||
slope, intercept = np.polyfit(t[mask], np.log(yy[mask]), 1)
|
||||
tau = -1.0 / slope if slope < 0 else None
|
||||
return {
|
||||
"model": "log_linear",
|
||||
"tau": float(tau) if tau else None,
|
||||
"A": float(np.exp(intercept)),
|
||||
"B_est": B,
|
||||
"baseline_estimated": baseline_estimated,
|
||||
"dropped_points": dropped,
|
||||
"n_used": int(mask.sum()),
|
||||
}
|
||||
|
||||
|
||||
def fit_double_exp_nls(t, y, p0=None):
|
||||
"""双指数 + 常数基线 NLS(M4 复现蒙特卡洛用)。
|
||||
|
||||
初值策略:先单指数拟合,快成分取 0.2·A、0.1·tau。
|
||||
"""
|
||||
t = np.asarray(t, dtype=float)
|
||||
y = np.asarray(y, dtype=float)
|
||||
if p0 is None:
|
||||
s = fit_single_exp_nls(t, y)
|
||||
p0 = [0.2 * s["A"], max(0.1 * s["tau"], 1e-3), 0.8 * s["A"], s["tau"], s["B"]]
|
||||
popt, pcov = curve_fit(
|
||||
_double_exp, t, y, p0=p0,
|
||||
bounds=([0, 1e-6, 0, 1e-6, -np.inf], [np.inf, np.inf, np.inf, np.inf, np.inf]),
|
||||
maxfev=100000,
|
||||
)
|
||||
resid = y - _double_exp(t, *popt)
|
||||
perr = np.sqrt(np.abs(np.diag(pcov)))
|
||||
return {
|
||||
"model": "double_exp_baseline",
|
||||
"A1": float(popt[0]), "tau1": float(popt[1]),
|
||||
"A2": float(popt[2]), "tau2": float(popt[3]), "B": float(popt[4]),
|
||||
"tau1_err": float(perr[1]), "tau2_err": float(perr[3]),
|
||||
"rmse": float(np.sqrt(np.mean(resid ** 2))),
|
||||
"residual": resid,
|
||||
"popt": [float(v) for v in popt],
|
||||
}
|
||||
|
||||
|
||||
def fit_single_exp_robust(t, y, loss="soft_l1", f_scale=None):
|
||||
"""稳健拟合(扩展功能):least_squares + huber/soft_l1 损失。"""
|
||||
t = np.asarray(t, dtype=float)
|
||||
y = np.asarray(y, dtype=float)
|
||||
p0 = initial_guess_single(t, y)
|
||||
if f_scale is None:
|
||||
f_scale = max(float(np.std(np.diff(y))) * 2.0, 1e-9)
|
||||
|
||||
def resid_fn(p):
|
||||
A, tau, B = p
|
||||
return A * np.exp(-t / tau) + B - y
|
||||
|
||||
res = least_squares(
|
||||
resid_fn, p0, bounds=([0.0, 1e-9, -np.inf], [np.inf, np.inf, np.inf]),
|
||||
loss=loss, f_scale=f_scale, max_nfev=50000,
|
||||
)
|
||||
return {
|
||||
"model": f"single_exp_robust_{loss}",
|
||||
"A": float(res.x[0]), "tau": float(res.x[1]), "B": float(res.x[2]),
|
||||
"rmse": float(np.sqrt(np.mean(res.fun ** 2))),
|
||||
"success": bool(res.success),
|
||||
}
|
||||
49
web/py/fiber_delay_sim/core/signal.py
Normal file
49
web/py/fiber_delay_sim/core/signal.py
Normal file
@@ -0,0 +1,49 @@
|
||||
"""荧光衰减信号模型与真值预设(仅依赖 numpy,浏览器可运行)。
|
||||
|
||||
三套预设的来源与区别见 docs/项目说明.md §3.2 / §6:
|
||||
- "monte_carlo" 报告 5.4.4 蒙特卡洛仿真真值(快成分 0.60 ns 为仿真设定值)
|
||||
- "single" 单指数教学版(YAG:Ce 标称衰减 52.8 ns)
|
||||
- "measured_ref" 实测参考(附图 A1 标注寿命;权重原始材料未给出,沿用 0.16/0.84 为假设值)
|
||||
"""
|
||||
|
||||
import numpy as np
|
||||
|
||||
PRESETS = {
|
||||
"monte_carlo": {"A1": 0.16, "tau1": 0.60, "A2": 0.84, "tau2": 52.80, "B0": 0.0, "B1": 0.0},
|
||||
"single": {"A1": 0.0, "tau1": None, "A2": 1.0, "tau2": 52.8, "B0": 0.0, "B1": 0.0},
|
||||
"measured_ref": {"A1": 0.16, "tau1": 5.0, "A2": 0.84, "tau2": 52.5, "B0": 0.0, "B1": 0.0},
|
||||
}
|
||||
|
||||
|
||||
def resolve_preset(preset, tau=None, amplitude=1.0, b0=0.0, b1=0.0):
|
||||
"""按预设名取参数;允许覆盖 tau/幅度/基线(单指数预设)。"""
|
||||
if preset not in PRESETS:
|
||||
raise ValueError(f"未知预设 {preset!r},可选:{list(PRESETS)}")
|
||||
p = dict(PRESETS[preset])
|
||||
if preset == "single":
|
||||
if tau is not None:
|
||||
p["tau2"] = float(tau)
|
||||
p["A2"] = float(amplitude)
|
||||
if b0:
|
||||
p["B0"] = float(b0)
|
||||
if b1:
|
||||
p["B1"] = float(b1)
|
||||
return p
|
||||
|
||||
|
||||
def generate(t, params):
|
||||
"""荧光衰减信号 I(t) = A1·exp(-t/tau1) + A2·exp(-t/tau2) + B0 + B1·t。
|
||||
|
||||
tau 为 None 或幅度为 0 时对应项不参与(单指数退化)。
|
||||
"""
|
||||
t = np.asarray(t, dtype=float)
|
||||
y = np.full(t.shape, float(params.get("B0", 0.0))) + float(params.get("B1", 0.0)) * t
|
||||
a1 = float(params.get("A1", 0.0))
|
||||
tau1 = params.get("tau1")
|
||||
if a1 != 0.0 and tau1:
|
||||
y = y + a1 * np.exp(-t / float(tau1))
|
||||
a2 = float(params.get("A2", 0.0))
|
||||
tau2 = params.get("tau2")
|
||||
if a2 != 0.0 and tau2:
|
||||
y = y + a2 * np.exp(-t / float(tau2))
|
||||
return y
|
||||
Reference in New Issue
Block a user