MCPcopy Create free account

hub / github.com/Tong89/smartNode / functions

Functions1,201 in github.com/Tong89/smartNode

↓ 2 callersMethodinit_pools
(self, leo_sats, all_gs, geo_relays)
backend/resources.py:14
↓ 2 callersFunctionj2_arg_perigee_rate
近地点幅角 (ω) 因 J2 引起的长期进动速率 (rad/s)。 公式:: dω/dt = (3/2) * n * J2 * (R_e/p)² * (2 - (5/2)*sin²(i)) 参数 ---- a : float 轨道
backend/physics/propagator.py:113
↓ 2 callersFunctionj2_mean_anomaly_rate_correction
平近点角 (M) 因 J2 引起的长期修正速率 (rad/s),在平均角速度 n 基础上的附加量。 公式(J2 对平均角速度的一阶修正):: dM/dt|J2 = (3/2) * n * J2 * (R_e/p)² * sqrt(1-e²) * (1 - (3/2)*si
backend/physics/propagator.py:140
↓ 2 callersFunctionjwt_secret
()
backend/auth.py:32
↓ 2 callersFunctionlink_budget_direct
LEO 卫星→地面站直连链路预算。 Parameters ---------- distance_km : float LEO 卫星到地面站斜距 (km)。 antenna_type : str 地面站天线频段("Ka" / "X"
backend/comms/link_budget.py:406
↓ 2 callersFunctionlink_budget_relay
LEO→GEO→地面站中继链路预算(返回瓶颈链路结果)。 Parameters ---------- dist_leo_geo_km : float LEO 到 GEO 斜距 (km)。 dist_geo_gs_km : float
backend/comms/link_budget.py:461
↓ 2 callersFunctionload_scenario
加载场景资源定义,返回 dict(ground_stations, leo_satellites, geo_relays, data_types)。 leo_satellites 还原为 OrbitalElements 对象;其余保持 dict 结构以兼容现有引擎。
backend/scenario.py:51
↓ 2 callersFunctionneedsCreate
* 判断给定节点 id 是否应该新建(不在索引中)或仅更新位置。
frontend/tests/app.unit.test.js:350
↓ 2 callersMethodpublish
Publish an event to all active subscribers. ``event_type`` should be one of ``"snapshot"`` or ``"event"``. ``data`` must be
backend/stream.py:48
↓ 2 callersMethodread_file
(path)
backend/persistence/event_log.py:58
↓ 2 callersMethodsave
将引擎当前资源配置序列化为场景字典。 Parameters ---------- engine: ``SimulationEngine`` 实例。 name: 场景名称(可选,便于人类识
backend/scenario.py:102
↓ 2 callersFunctionscan_loss_db
计算相控阵偏轴扫描损耗(dB)。 采用余弦扫描损耗模型: L_scan(dB) = −20·log10(cos(θ_scan)) 其中 θ_scan 为目标方向与天线法线方向之间的夹角(0°=法线方向)。 对于仰角系统(法线指向天顶): c
backend/comms/beam_pointing.py:71
↓ 2 callersFunctionscan_loss_factor
偏轴扫描损耗对应的功率因子(线性,<=1.0)。 Returns ------- float 功率因子 0 < factor <= 1.0; factor=1.0 表示无损耗(正对法线),越小表示损耗越大。
backend/comms/beam_pointing.py:122
↓ 2 callersFunctionstartTicker
()
frontend/src/composables/use-playback.ts:72
↓ 2 callersMethodstart_simulation
启动仿真线程
backend/core.py:580
↓ 2 callersMethodto_dict
(self)
backend/scheduling/trace.py:43
↓ 2 callersFunctionupsertCoverageEllipse
* Upsert a coverage ellipse (circle) entity on the ground surface. * Uses Cesium's `ellipse` primitive so the circle drapes on the globe. * *
frontend/src/composables/use-cesium-scene.ts:266
↓ 2 callersFunctionvalidate_count_update
(data, lo=None, hi=None)
backend/schemas.py:73
↓ 1 callersFunction_achievable_rate_mbps
调制+编码约束的可达速率 (Mbps)。 取香农容量与调制硬约束的最小值,保证不超物理上限。
backend/comms/link_budget.py:570
↓ 1 callersMethod_apply_link_assignment
(self, req, satellite, link)
backend/core.py:1192
↓ 1 callersFunction_build_snapshot
Build a compact situational snapshot from the simulation engine.
backend/stream.py:106
↓ 1 callersMethod_check_future_ground_station_pass
检查卫星在max_delay时间内是否有地面站过境机会
backend/core.py:1903
↓ 1 callersMethod_check_qos_bandwidth
QoS 带宽保障校验。 - low QoS:拥塞(>= LOW_QOS_REJECT_THRESHOLD)时拒绝; - medium QoS:不拒绝,但会在速率层面限速(由 apply_qos_rate_cap 负责); - high QoS:始终允
backend/scheduling/qos.py:162
↓ 1 callersMethod_check_security
安全级约束校验。
backend/scheduling/qos.py:148
↓ 1 callersMethod_check_time_window_resources
⭐ 检查用户指定时间段内的资源可用性 Args: req: 请求对象(包含start_time, end_time) satellite: 分配的卫星 Returns
backend/core.py:1395
↓ 1 callersFunction_coerce
(template, raw)
backend/config.py:163
↓ 1 callersFunction_create_metrics
Instantiate all Prometheus metric objects once.
backend/metrics.py:89
↓ 1 callersMethod_current_link_available
(self, req, sat_pos)
backend/core.py:1189
↓ 1 callersFunction_distance_km
计算两颗卫星之间的三维欧氏距离 (km)。
backend/comms/laser_isl.py:453
↓ 1 callersFunction_format_sse
Format a single SSE frame.
backend/stream.py:180
↓ 1 callersMethod_generate_random_leo
动态生成随机LEO卫星轨道
backend/core.py:2359
↓ 1 callersMethod_get_propagator
惰性构建并缓存 Propagator 实例。
backend/orbit.py:93
↓ 1 callersMethod_handle_removed_satellites
处理被移除卫星上的请求 - 重新分配或拒绝
backend/core.py:2093
↓ 1 callersMethod_high_qos_reserve_violated
当有高 QoS 请求在队列中时,检查预留带宽是否已被占满。 若任意中继的可用带宽低于 HIGH_QOS_RESERVE_RATIO * total, 则判定预留被侵占,拒绝低 QoS 请求进入。
backend/scheduling/qos.py:199
↓ 1 callersFunction_identity_key
()
backend/ratelimit.py:39
↓ 1 callersFunction_init_otel
Attempt to configure OpenTelemetry Flask instrumentation.
backend/metrics.py:346
↓ 1 callersMethod_init_schema
创建场景库表(幂等)。
backend/store.py:75
↓ 1 callersMethod_init_schema
(self)
backend/persistence/db.py:20
↓ 1 callersFunction_interp_p838
在 P.838 表格中按对数插值求 (k, α)(H/V 极化平均)。 Returns ------- (k, alpha) : tuple[float, float] 比雨衰系数 k 和指数 α,用于 γ_R = k · R^α。
backend/comms/atmosphere.py:70
↓ 1 callersFunction_load_golden
()
tests/test_orbital.py:30
↓ 1 callersMethod_occupy_satellite_only
(self, req_id, sat_id)
backend/core.py:1950
↓ 1 callersMethod_propagate_kepler
开普勒二体解析传播(可选 J2 摄动修正),返回 (lat°, lon°, alt m)。 当 ``self.j2_perturbation`` 为 ``True``(默认)时,在二体开普勒传播基础上 叠加 J2 带谐系数引起的长期摄动修正: *
backend/orbit.py:122
↓ 1 callersMethod_propagate_sgp4
(self, t: datetime)
backend/physics/propagator.py:366
↓ 1 callersFunction_random_payload
生成随机但结构合法的请求载荷。
tests/load/locustfile.py:44
↓ 1 callersFunction_real_routes
(app)
tests/test_openapi_contract.py:11
↓ 1 callersFunction_register_stub_endpoint
Register a /metrics endpoint that returns 501 when prometheus_client is absent.
backend/metrics.py:334
↓ 1 callersFunction_register_v1_aliases
()
backend/api.py:1715
↓ 1 callersMethod_reroute_transmission
(self, req, satellite, sat_pos)
backend/core.py:1195
↓ 1 callersFunction_resolve_log_format
从环境变量 LOG_FORMAT 解析输出格式,默认 console。
backend/logging_config.py:57
↓ 1 callersFunction_resolve_log_level
从环境变量解析日志级别,默认 INFO。 优先级:SMARTNODE_LOG_LEVEL > LOG_LEVEL > 默认 INFO。 统一使用带 SMARTNODE_ 前缀的变量;LOG_LEVEL 作为向后兼容回退。
backend/logging_config.py:43
↓ 1 callersFunction_save_golden
将更新后的黄金快照写回磁盘。
tests/test_regression_golden.py:101
↓ 1 callersFunction_select_modulation
根据 C/N0 和带宽,贪心选择可满足 BER≤1e-6 的最高阶调制方式。 遍历顺序从高阶到低阶,返回首个 Eb/N0 超过门限的调制方式; 若均不满足则降级到 BPSK。
backend/comms/link_budget.py:551
↓ 1 callersMethod_select_with_patched_types
使用经安全约束过滤后的 allowed_links 执行贪心选链。 仅复用 GreedyMaxRateStrategy 内部逻辑,避免修改全局 DATA_TYPES。
backend/scheduling/qos.py:293
↓ 1 callersFunctionabort
()
frontend/src/api/client.test.ts:207
↓ 1 callersMethodapply_qos_rate_cap
对低 QoS 请求在拥塞时施加速率上限。 高/中 QoS 或非拥塞状态下返回原始速率,低 QoS 在拥塞时截断到 LOW_QOS_CONGESTION_RATE_CAP。 Args: req: 传输请求。
backend/scheduling/qos.py:122
↓ 1 callersMethodapply_rate
将扫描损耗折算到可达速率 (Mbps)。 Parameters ---------- base_rate_mbps : float 无扫描损耗的基准可达速率 (Mbps)。 azimuth_deg : floa
backend/comms/beam_pointing.py:539
↓ 1 callersFunctionauthenticate_user
(username, password)
backend/auth.py:37
↓ 1 callersMethodcheck_admission
准入检查入口。 Returns: (True, None) — 允许调度; (False, reason_str) — 拒绝,并附带标准化原因字符串。
backend/scheduling/qos.py:83
↓ 1 callersFunctioncheck_scan_range
检查目标方位角/仰角是否落入扫描范围。 Parameters ---------- azimuth_deg : float 目标方位角(度)。对于相控阵天线,通常以天线法线为零点, 范围约 ±60°(即 ``scan_range["azimu
backend/comms/beam_pointing.py:37
↓ 1 callersMethodcompute
计算两颗卫星间的激光 ISL 链路。 Parameters ---------- sat1_pos : dict 卫星1位置,含 ``lat``(度)、``lon``(度)、``alt``(米)。 sat2_p
backend/comms/laser_isl.py:188
↓ 1 callersFunctioncompute_ber
BER 近似估算(AWGN 信道,无编码)。 - BPSK / QPSK: BER = Q(√(2·Eb/N0)) ≈ 0.5·erfc(√(Eb/N0)) - 8PSK : BER ≈ (2/3)·erfc(√(Eb/N0·sin²(π/8))) - 16A
backend/comms/link_budget.py:343
↓ 1 callersFunctioncompute_capacity_mbps
香农信道容量 (Mbps)。 C = BW · log2(1 + SNR) Parameters ---------- snr_db : float 信噪比 (dB)。 bandwidth_hz : float 带宽 (Hz
backend/comms/link_budget.py:380
↓ 1 callersFunctioncompute_cn0
计算 C/N0 (dBHz)。 C/N0 = EIRP(dBW) - L(dB) + G/T(dB/K) - k(dBW/K/Hz) Parameters ---------- eirp_dbw : float 发射 EIRP (dBW)。
backend/comms/link_budget.py:299
↓ 1 callersFunctioncompute_doppler_shift
计算卫星与地面站之间的多普勒频移。 多普勒频移由卫星 ECEF 速度矢量在视线方向(地面站 → 卫星)上的投影确定: Δf = f₀ × (−v_r) / c 其中 v_r 为径向速度分量,约定朝向地面站(接近)为正,远离为负; 因此频移符号:接近 → Δf
backend/physics/geometry.py:152
↓ 1 callersFunctioncompute_ebn0
由 C/N0 与信息速率计算 Eb/N0 (dB)。 Eb/N0 = C/N0 - 10·log10(Rb) Parameters ---------- cn0_db_hz : float C/N0 (dBHz)。 rate_bps : f
backend/comms/link_budget.py:321
↓ 1 callersFunctioncompute_fspl_db
自由空间路径损耗 (dB)。 FSPL = 20·log10(4π·d·f / c) Parameters ---------- distance_m : float 斜距(米)。 frequency_hz : float
backend/comms/link_budget.py:277
↓ 1 callersFunctionconfigure_logging
配置 structlog 与标准库 logging。 调用一次即可;重复调用幂等(structlog.configure 可安全重入)。
backend/logging_config.py:66
↓ 1 callersFunctionconfigured_api_key
()
backend/auth.py:67
↓ 1 callersFunctioncreate_refresh_token
(sub, role)
backend/auth.py:54
↓ 1 callersMethodcurrent_link_available
(self, req, sat_pos)
backend/scheduling/scheduler.py:38
↓ 1 callersFunctioncurrent_role
()
backend/rbac.py:16
↓ 1 callersFunctiondebug_api_enabled
是否开启调试接口(默认关闭)。生产环境不暴露内部状态。
backend/config.py:30
↓ 1 callersFunctiondrawRequestLinks
( req: TransmissionRequest & { satellite_id?: string; selected_ground_station?: string;
frontend/src/composables/use-cesium-scene.ts:202
↓ 1 callersFunctionenu_from_ecef
将以地面站为原点的 ECEF 差矢量投影到 ENU 框架。 参数 ---- dx, dy, dz : float ECEF 差矢量各分量(km),定义为 sat_ecef - gs_ecef。 gs_lat_rad : float 地
backend/physics/geometry.py:46
↓ 1 callersFunctionfetchData
()
frontend/src/api/endpoints.ts:72
↓ 1 callersFunctionfetchHealth
()
frontend/src/api/endpoints.ts:64
↓ 1 callersFunctionfetchResourceStatus
()
frontend/src/api/endpoints.ts:88
↓ 1 callersFunctionfetchResourceTimeline
()
frontend/src/api/endpoints.ts:105
↓ 1 callersFunctionfetchResourceUtilization
()
frontend/src/api/endpoints.ts:96
↓ 1 callersFunctionfetchSystemInfo
()
frontend/src/api/endpoints.ts:80
↓ 1 callersFunctionfetch_by_catnr
按 NORAD 卫星编号(CATNR)拉取 TLE 条目。 参数 ---- catnr : int NORAD 卫星目录编号(如 25544 为 ISS)。 force_refresh : bool 强制刷新,忽略缓存。 返
backend/physics/tle_source.py:273
↓ 1 callersFunctionfetch_group
按星座分组名称拉取 TLE 条目。 首先尝试从 Celestrak 在线拉取;若拉取失败或超时,则回退到本地缓存。 若既无网络也无缓存,返回空列表并记录警告。 参数 ---- group : str 星座/分组标识,例如 ``"starli
backend/physics/tle_source.py:218
↓ 1 callersFunctionfmtTime
(seconds: number)
frontend/src/composables/use-playback.ts:57
↓ 1 callersFunctionfrom_geo_satellite
从 GEO_RELAY_SATELLITES 配置条目创建 BeamPointing 实例。 Parameters ---------- geo : dict ``GEO_RELAY_SATELLITES`` 列表中的一个条目,含 ``antenna`` 与
backend/comms/beam_pointing.py:610
↓ 1 callersFunctionfrom_opportunistic_station
从 OPPORTUNISTIC_STATIONS 配置条目创建 BeamPointing 实例。 Parameters ---------- station : dict ``OPPORTUNISTIC_STATIONS`` 列表中的一个条目,含 ``pha
backend/comms/beam_pointing.py:588
↓ 1 callersMethodfrom_orbital_elements
由 :class:`~backend.orbit.OrbitalElements` 创建二体传播器。 若 oe 对象带有 ``tle_line1`` / ``tle_line2`` 属性且非空,则优先走 SGP4。
backend/physics/propagator.py:309
↓ 1 callersMethodfrom_tle
由 TLE 两行根数构造 OrbitalElements,轨道根数从 TLE 解析填充。 SGP4 传播时直接使用 TLE 数据;轨道根数字段仅用于回退和元数据。 参数 ---- name : str 卫星名
backend/orbit.py:194
↓ 1 callersMethodfrom_yaml
从 YAML(或 JSON)字符串反序列化场景字典。 YAML 是 JSON 的超集,因此可接受纯 JSON 输入。 若 PyYAML 不可用则自动尝试 JSON 解析。
backend/scenario.py:240
↓ 1 callersFunctiongaseous_attenuation_db
计算大气气体吸收衰减 A_gas (dB),按 ITU-R P.676-12 极简模型。 包含两个主吸收分量: - 氧气 (O₂):Zennith 特征衰减约 0.005–0.008 dB/km(1–40 GHz),60 GHz 附近强吸收峰 - 水汽 (H₂O):22.2
backend/comms/atmosphere.py:188
↓ 1 callersFunctiongenerate
()
backend/api.py:706
↓ 1 callersFunctiongenerate_golden
重新生成所有场景快照并覆盖写回 golden/scenario_snapshots.json。 调用方式:: python tests/test_regression_golden.py --update-golden
tests/test_regression_golden.py:283
↓ 1 callersMethodget_all_requests
获取所有用户请求 (不包括背景任务)
backend/core.py:2124
↓ 1 callersMethodget_altitude
(self)
backend/orbit.py:106
↓ 1 callersFunctionget_api_key
()
backend/config.py:46
↓ 1 callersFunctionget_cache_status
返回本地 TLE 缓存目录的状态摘要。 返回 ---- dict 包含以下字段: - ``cache_dir`` (str): 缓存目录绝对路径 - ``entries`` (list): 每个缓存文件的摘要列表
backend/physics/tle_source.py:324
↓ 1 callersMethodget_requests_paginated
返回带分页、过滤与排序的请求列表。 Args: page: 页码(从 1 开始) page_size: 每页条目数(1-200) status: 按状态过滤(pending/accepted/transmitt
backend/core.py:2132
↓ 1 callersMethodget_schedule
(self, resource_type, resource_id, current_time, time_range=3600)
backend/resources.py:102
↓ 1 callersFunctionget_seed
从环境变量 SMARTNODE_SEED 读取随机种子(未设置返回 None=非确定性)。
backend/config.py:59
↓ 1 callersMethodget_system_data
获取系统完整数据 - 优化锁持有时间
backend/core.py:2214
↓ 1 callersFunctioninit_auth
注册全局鉴权钩子。
backend/auth.py:86
← previousnext →201–300 of 1,201, ranked by callers