XspecKFactory#
- class jinwu.spectrum.XspecKFactory[source]#
Bases:
objectK 计算工厂 + 缓存。
get_K(…): 返回 K,如缓存未命中则调用 XSPEC 计算并存入缓存。 Return K; compute via XSPEC if cache miss, then store.
get_K_with_values(…): 返回 (K, rate, flux) 元组。 Return (K, rate, flux) tuple.
clear(): 清空缓存。 Clear the cache.
Methods Summary
clear()get_K(*, arf, rmf, background, model, ...[, ...])get_K_with_values(*, arf, rmf, background, ...)返回 (K, rate, flux) 元组
Methods Documentation
- get_K(*, arf: str | Path, rmf: str | Path, background: str | Path | None, model: str, params: Tuple[float, ...], band: Tuple[float, float], exposure: float | int | floating | integer, back_exposure: float | int | floating | integer | None, xspec_abund: str, xspec_xsect: str, xspec_cosmo: str, allow_prompting: bool = False) float[source]#
- get_K_with_values(*, arf: str | Path, rmf: str | Path, background: str | Path | None, model: str, params: Tuple[float, ...], band: Tuple[float, float], exposure: float | int | floating | integer, back_exposure: float | int | floating | integer | None, xspec_abund: str, xspec_xsect: str, xspec_cosmo: str, allow_prompting: bool = False) Tuple[float, float, float][source]#
返回 (K, rate, flux) 元组
参数与 get_K 相同
返回: - K: rate/flux 转化因子 [cts/(erg/cm²)] - rate: 带内计数率 [cts/s] - flux: 带内能通量 [erg/cm²/s]