目录Contents
如何手工续作(不用 AI)How to continue by hand (without AI)
本页写给一个刚接触项目的人:读完之后,你应该能在不借助 AI 的情况下,复现关键数值、理解数据在哪、知道下一步做什么。所有命令都已在 lang 机器上实际运行过(只读命令真实运行,拟合命令只验证用法)。
This page is written for a newcomer: after reading it you should be able to reproduce the key numbers, find the data, and know what to do next — all without AI. Every command was actually run on lang (read-only commands run for real; fitting commands were verified for usage only).
机器与分工The machines and their roles
| 机器Machine | 角色Role | 注意Note |
|---|---|---|
| lang | 分析与 Sherpa 拟合(本手册所有命令都在 lang 上验证)Analysis and Sherpa fitting (every command on this page was verified on lang) | 共享机(32 核);当前有两个拟合任务在跑,新任务务必单线程Shared machine (32 cores); two fitting jobs are running now, so any new job must stay single-threaded |
| Virgo | 仅 SAS/ESAS 数据约减(obj.pi / back.pi / ARF / RMF),从不拟合SAS/ESAS data reduction only (obj.pi / back.pi / ARF / RMF); never fitting | 原始 ODF 与约减产品都在 Virgo;lang 通过 data/ 符号链接访问Raw ODF and reduced products live on Virgo; lang reaches them through the data/ symlink |
来源:E013/E014 BRIEF(.agent/jobs/2026-10-14-e013-joint-profile/BRIEF.md 与 ...-e014-nw-crosscheck/BRIEF.md)的「Fit on lang only」与数据路径约定;data 符号链接指向 ../../Data/XMM/M31_data。
Source: the "Fit on lang only" rule and data-path convention in the E013/E014 BRIEFs (.agent/jobs/2026-10-14-e013-joint-profile/BRIEF.md and ...-e014-nw-crosscheck/BRIEF.md); the data symlink points to ../../Data/XMM/M31_data.
数据、代码、结果在哪Where the data, code and results live
| 内容What | 路径(相对 /u/Lang3/program/M31CGM)Path (relative to /u/Lang3/program/M31CGM) |
|---|---|
| 原始 XMM 数据(22 个指向)Raw XMM data (22 pointings) | data/0800730101 ... 0800733101(符号链接symlink) |
| v19 拟合脚本v19 fitting script | background_spectrum_fitting_2T_basedon_obsid_v19.py |
| v19 逐 ObsID 会话与配置v19 per-ObsID sessions and configs | background_spectrum_fitting_2T_basedon_obsid_v19_mos14to20keV_excluded_hi4pi_nh_per_pointing/ |
| v19 测量汇总(冻结)v19 measurement tables (frozen) | independent_cgm_results_v19_mos14to20keV_excluded_hi4pi_nh_per_pointing/ |
| 论文草稿与公开镜像源Paper draft and public-mirror source | paper_apj_v19_cgmsum_draft/ |
| 决策、洞察、实验记录Decisions, insights, experiment logs | cognition-os/ |
| 当前讨论与快速检验Current discussion and quick checks | newangels3_discussion/ |
可直接复制的命令(均已验证)Copy-paste commands (all verified)
命令 1:复现形状上限快速检验(只读,几秒)Command 1: reproduce the quick shape-limit check (read-only, seconds)
读冻结的 v19 逐场流量表,重新做「轮廓是平的吗、外 NW 四场亮吗、M31 β 分量能有多大」的快速检验。输出与 newangels3_discussion/quick_shape_limit_20261014.txt 一致(该脚本也会重写同目录下两个 CSV——它们是派生文件;若不想覆盖,先备份)。
It reads the frozen v19 per-field flux table and re-runs the quick check "is the profile flat, are the outer-NW four bright, how large can an M31 beta component be". The output matches newangels3_discussion/quick_shape_limit_20261014.txt (the script also rewrites two derived CSVs in the same directory; back them up first if you do not want that).
cd /u/Lang3/program/M31CGM
/home/huangrui/software/miniconda3/bin/python newangels3_discussion/quick_shape_limit_20261014.py
实际输出(2026-10-14 运行):
Actual output (run 2026-10-14):
constant: chi2=11.99/13 p=0.529
linear in r: coef=[0.0126] sig=[1.92] chi2=8.31/12 dchi2=3.68
linear in b: coef=[0.151] sig=[2.49] chi2=5.77/12 dchi2=6.22
linear in r+b: coef=[0.0006 0.1471] sig=[0.06 1.59] chi2=5.77/11 dchi2=6.22
outer NW four (a posteriori): 1.114 +- 0.071
other ten: 0.870 +- 0.056
beta rc_kpc mw_model A20 A20_err A20_ul95_approx chi2 dof
0.4 4.0 const -0.1276 0.0751 0.1236 9.1031 12
0.4 4.0 linear_b 0.0122 0.1072 0.1886 5.7564 11
0.5 4.0 const -0.0737 0.0461 0.0758 9.4302 12
0.5 4.0 linear_b 0.0109 0.0638 0.1158 5.7402 11
0.6 4.0 const -0.0453 0.0304 0.0499 9.7635 12
0.6 4.0 linear_b 0.0092 0.0407 0.0761 5.7187 11
来源:newangels3_discussion/quick_shape_limit_20261014.py;输出与 newangels3_discussion/quick_shape_limit_20261014.txt 逐行一致。
Source: newangels3_discussion/quick_shape_limit_20261014.py; the output matches newangels3_discussion/quick_shape_limit_20261014.txt line by line.
命令 2:列出 v19 主样本 14 场表(只读)Command 2: list the v19 primary 14-field table (read-only)
一行一行看 14 个主样本场的半径、kT、norm、N_H 与吸收流量。也可以直接打开 CSV:independent_cgm_results_v19_mos14to20keV_excluded_hi4pi_nh_per_pointing/independent_cgm_v19_primary_dual_mos_measurements.csv(14 行 + 表头)。
Inspect, field by field, the radius, kT, norm, N_H and absorbed flux of the 14 primary fields. You can also open the CSV directly: independent_cgm_results_v19_mos14to20keV_excluded_hi4pi_nh_per_pointing/independent_cgm_v19_primary_dual_mos_measurements.csv (14 rows plus header).
cd /u/Lang3/program/M31CGM
/home/huangrui/software/miniconda3/bin/python -c "import pandas as pd; \
d = pd.read_csv('independent_cgm_results_v19_mos14to20keV_excluded_hi4pi_nh_per_pointing/independent_cgm_v19_primary_dual_mos_measurements.csv', dtype={'obsid': str}); \
print(d[['obsid','rproj_kpc','mwhalo_kt_keV','mwhalo_norm']].to_string(index=False))"
实际输出(节选前 5 行;norm 默认显示为 6 位小数):
Actual output (first 5 rows; the norm column prints 6 decimals by default):
obsid rproj_kpc mwhalo_kt_keV mwhalo_norm
0800730201 28.793728 0.167030 0.000005
0800730301 28.687554 0.164971 0.000005
0800730501 23.396669 0.167798 0.000005
0800730601 25.028293 0.219833 0.000004
0800730701 19.544786 0.222737 0.000002
来源:independent_cgm_results_v19_.../independent_cgm_v19_primary_dual_mos_measurements.csv(本页运行时的实际打印)。
Source: independent_cgm_results_v19_.../independent_cgm_v19_primary_dual_mos_measurements.csv (printed live when this page was written).
命令 3:运行一个 v19 生产拟合(只展示用法,不要运行)Command 3: run one v19 production fit (usage shown only — do NOT run)
v19 产品已冻结(读只读目录),重新拟合会覆盖冻结会话。如果你确实要重跑某个 ObsID(例如在新建的实验目录里),用法如下——参数是一个 10 位 ObsID,脚本会校验哈希、在 logs_obsid_fitting_v19_... 写日志。运行约需数分钟到更久(单 ObsID 多阶段拟合)。
The v19 products are frozen (their directory is read-only); re-fitting would overwrite the frozen sessions. If you truly need to re-run one ObsID (e.g. inside a new experiment directory), the usage is — one 10-digit ObsID argument; the script checks hashes and writes to logs_obsid_fitting_v19_.... Expect several minutes or more (multi-stage fit).
cd /u/Lang3/program/M31CGM
bash run_m31_cgm_v19_single_obsid.sh 0800730201
不带参数时的实际输出(证明用法行来自脚本本身):
Actual output without arguments (proving the usage line comes from the script):
Usage: run_m31_cgm_v19_single_obsid.sh 10_DIGIT_OBSID
脚本内部先做依赖检查(脚本/helper/N_H 表/HI4PI 图/验证器),再导出 CIAO 环境变量(run_m31_cgm_v19_single_obsid.sh 第 95–106 行),然后调用 background_spectrum_fitting_2T_basedon_obsid_v19.py。不要在 lang 上与正在运行的 E013/E014 任务并发重跑。
The script first checks dependencies (script/helper/N_H table/HI4PI map/validators), then exports the CIAO environment (lines 95–106 of run_m31_cgm_v19_single_obsid.sh), then calls background_spectrum_fitting_2T_basedon_obsid_v19.py. Do not re-run it concurrently with the E013/E014 jobs on lang.
来源:run_m31_cgm_v19_single_obsid.sh 第 1–30 行与 95–106 行(本页写作时读取)。
Source: run_m31_cgm_v19_single_obsid.sh lines 1–30 and 95–106 (read when this page was written).
命令 4:恢复一个 v19 Sherpa 会话(只展示,不要运行)Command 4: restore one v19 Sherpa session (shown only — do NOT run)
恢复(restore)会话是 E013 A1 与 E014 B3 的第一步。恢复本身只读,但脚本里任何 save() 或写文件都会破坏冻结状态——所以这里只展示。必须用 CIAO 的 Python(/home/huangrui/software/ciao-4.18/binexe/python3.12),并且要先导出 CIAO 环境变量,否则 from sherpa.astro import xspec 会报 ImportError: XSPEC support is not enabled(本页写作时实测确认)。
Restoring a session is the first step of E013 A1 and E014 B3. Restoring itself is read-only, but any save() or file write inside the script would break the frozen state — so this is shown only. You must use the CIAO Python (/home/huangrui/software/ciao-4.18/binexe/python3.12) and export the CIAO environment first; otherwise from sherpa.astro import xspec fails with ImportError: XSPEC support is not enabled (confirmed live while writing this page).
export HEADAS=/home/huangrui/software/ciao-4.18/bin
export ASCDS_INSTALL=/home/huangrui/software/ciao-4.18
export ASCDS_CALIB=/home/huangrui/software/ciao-4.18/data
export ASCDS_CONFIG=/home/huangrui/software/ciao-4.18/config
export ASCDS_BIN=/home/huangrui/software/ciao-4.18/bin
export PFILES="/u/Lang2/ai_tmp//pfiles;/home/huangrui/software/ciao-4.18/param"
export PYTHONHOME=/home/huangrui/software/ciao-4.18
export PYTHONPATH=/home/huangrui/software/ciao-4.18/lib/python3.12/site-packages
export LD_LIBRARY_PATH="/home/huangrui/software/ciao-4.18/lib:$LD_LIBRARY_PATH"
export MPLBACKEND=Agg
然后在 Python 里(恢复会话前先设置 XSPEC 物理配置,与 v19 脚本第 812–820 行一致):
Then in Python (set the XSPEC physics before restoring, matching lines 812–820 of the v19 script):
from sherpa.astro import xspec
xspec.set_xsabund('angr')
xspec.set_xsxsect('vern')
xspec.set_xsxset('APECROOT', '/home/huangrui/software/ciao-4.18/spectral/modelData/apec_v3.0.9')
import sherpa.astro.ui as ui
ui.restore('background_spectrum_fitting_2T_basedon_obsid_v19_mos14to20keV_excluded_hi4pi_nh_per_pointing/0800730201_spectrum.fitting')
print(ui.get_stat_name()) # chi2gehrels
print(ui.calc_stat()) # compare with the CSV column fit_stat (30.571259873047417)
判读:恢复后 calc_stat() 应与 CSV 的 fit_stat 一致(E013 验收标准 |Δ| ≤ 1e-3 相对)。0800730201 的 fit_stat = 30.571259873047417(21 dof)来自测量 CSV。
How to read it: after restore, calc_stat() must match the CSV column fit_stat (E013 acceptance |Δ| ≤ 1e-3 relative). For 0800730201, fit_stat = 30.571259873047417 (21 dof) comes from the measurement CSV.
来源:环境变量与 XSPEC 设置照抄 run_m31_cgm_v19_single_obsid.sh 第 95–106 行与 background_spectrum_fitting_2T_basedon_obsid_v19.py 第 812–820 行;fit_stat 与 dof 来自 independent_cgm_v19_all22_measurements.csv 的 0800730201 行;ImportError 文案为实测。
Source: the environment variables and XSPEC settings copy run_m31_cgm_v19_single_obsid.sh lines 95–106 and background_spectrum_fitting_2T_basedon_obsid_v19.py lines 812–820; fit_stat and dof from the 0800730201 row of independent_cgm_v19_all22_measurements.csv; the ImportError text was reproduced live.
新手必须遵守的规则Rules a newcomer must keep
- 临时文件只写到
/u/Lang2/ai_tmp/<你>/,绝不写/tmp、/var/tmp或家目录以外的磁盘根。Temp files go to/u/Lang2/ai_tmp/only; never/ /tmp,/var/tmp, or the root disk. - v19 产品已冻结:会话目录与测量 CSV 只读,不得覆盖、移动或重命名。The v19 products are frozen: the session directory and measurement CSVs are read-only; never overwrite, move, or rename them.
- MOS 1.4–2.0 keV 一律剔除(Al/Si 仪器线),拟合带为 0.4–1.4 + 2.0–8.0 keV;能量上限必须与代码和日志一致。MOS 1.4–2.0 keV is always excluded (the Al/Si instrumental lines); the fitted band is 0.4–1.4 + 2.0–8.0 keV, and the upper bound must match code and logs.
- N_H 用逐指向 HI4PI 值(15 arcmin 孔径平均,原子 N_HI),不用单一全样本值。N_H is per pointing from HI4PI (15-arcmin aperture mean, atomic N_HI), never one sample-wide value.
- 软质子(SP)与仪器线 norm 逐谱自由;任何天体物理联动假设必须显式声明。Soft-proton (SP) and instrumental-line norms stay free per spectrum; any astrophysical linking assumption must be stated explicitly.
- 共享的 0.175 keV 分量是 MW+M31 之和(CGMsum),绝不称它「纯 MW」或「纯 M31」。The shared 0.175 keV component is the MW+M31 sum (CGMsum); never call it "pure MW" or "pure M31".
- 非负分量的上限需要边界感知区间(profile likelihood 或模拟校准),不能用普通 F 检验。Limits on non-negative components need boundary-aware intervals (profile likelihood or simulation calibration), not a naive F-test.
- lang 共享:新任务
OMP/OPENBLAS/MKL_NUM_THREADS=1;不碰别人的进程,不用默认 tmux server。lang is shared: any new job setsOMP/OPENBLAS/MKL_NUM_THREADS=1; do not touch other processes and never use the default tmux server.
来源:规则 1/8 来自 TEMP_RULE 与 E013/E014 BRIEF 的 Rules 节;规则 2–7 来自 cognition-os/00_AI_BRIEFING.md「Methodology invariants」1–8 条;规则 7 另见 03_TRUST_TABLE.md「delta_stat F-test classification (D22)」。
Source: rules 1/8 from TEMP_RULE and the Rules sections of the E013/E014 BRIEFs; rules 2–7 from the "Methodology invariants" (items 1–8) of cognition-os/00_AI_BRIEFING.md; rule 7 also 03_TRUST_TABLE.md "delta_stat F-test classification (D22)".
编号计划:下一步怎么做The numbered plan: what to do next
步骤 1:等待并核对 E013 A1 曲面Step 1: wait for and check the E013 A1 surfaces
- 目标:20 个可恢复会话的逐场 Δstat(kT, norm) 曲面(E013 A1)。Goal: per-field Δstat(kT, norm) surfaces for the 20 restorable sessions (E013 A1).
- 输入:冻结 v19 会话 + independent_cgm_v19_all22_measurements.csv。Inputs: the frozen v19 sessions and independent_cgm_v19_all22_measurements.csv.
- 方法:按 E013 BRIEF 的网格(kT 0.155–0.200 × norm 11 点)逐点冻结再拟合其余参数。Method: per the E013 BRIEF grid (kT 0.155–0.200 × 11 norm points), freeze kT/norm and re-fit the rest.
- 成功判据:恢复回归 |Δstat| ≤ 1e-3 相对、通量比 0.99–1.01、无缺失格点。Success/failure: restore regression |Δstat| ≤ 1e-3 relative, flux ratio 0.99–1.01, no missing grid points.
- 时间:≤12 h 墙钟(≤6 workers)。Time: ≤12 h wall (≤6 workers).
- 先读:
.agent/jobs/2026-10-14-e013-joint-profile/BRIEF.md。Read first:.agent/jobs/2026-10-14-e013-joint-profile/BRIEF.md.
步骤 2:E013 A2 空间模型联合似然Step 2: the E013 A2 joint spatial-model likelihood
- 目标:MW(常数或线性 b)+ M31 β 项的谱级上限,替代 I033 的快速流量级上限。Goal: a spectral-level limit on MW (constant or linear in b) + an M31 beta term, superseding the quick flux-level limit of I033.
- 输入:A1 曲面 CSV。Inputs: the A1 surface CSVs.
- 方法:Σ_fields Δstat_i(kT, norm_i = N_MW(b_i) + A·g(r_i)),profile 掉 N_MW/梯度/kT,A=0 边界用模拟校准单侧上限。Method: Σ_fields Δstat_i(kT, norm_i = N_MW(b_i) + A·g(r_i)); profile over N_MW/the gradient/kT; calibrate one-sided limits at the A=0 boundary by simulation.
- 成功判据:给出 (r_c, β) 表上的 A 上限;与 I033 快速版同数量级为预期,差异需解释。Success/failure: a table of A limits over (r_c, β); the same order of magnitude as the quick I033 version is expected, and any difference must be explained.
- 时间:1–2 天(插值与模拟,CPU 轻量)。Time: 1–2 days (interpolation and simulations; light CPU).
- 先读:cognition-os/experiments/E013_joint_spatial_profile_likelihood.md。Read first: cognition-os/experiments/E013_joint_spatial_profile_likelihood.md.
步骤 3:读 E014 结果并跟进 D49 排队检验Step 3: read the E014 results and follow up the D49 queued tests
- 目标:外 NW 四场偏亮是天空结构、SWCX 还是仪器?——E014 已回答:都不是。剩余候选是残余软质子/仪器(SP 比值 3.1 但相关性弱,Spearman +0.35,p=0.22)、小于 15′ 的结构(RASS 孔径以下)、或统计涨落(a posteriori 2.7σ)。Goal: are the bright outer-NW fields sky structure, SWCX, or instrumental? — E014 answered: none of these. The remaining candidates are residual soft-proton/instrumental (SP ratio 3.1 but weak correlation, Spearman +0.35, p=0.22), structure below 15′ (under the RASS aperture), or a statistical fluctuation (a posteriori 2.7σ).
- 输入:E014 的 rass_per_field.csv、omni_per_field.csv、nuisance_per_field.csv(newangels3_discussion/E014_
/)。 Inputs: E014's rass_per_field.csv, omni_per_field.csv, nuisance_per_field.csv (newangels3_discussion/E014_/). - 方法:核对三个数——RASS R45 外四/其余十比值 0.91 ± 0.12 vs XMM 的 1.28(排除大尺度天空);R45 纬度斜率无 +15.6%/deg 梯度;OMNI 无外 NW 窗口超 4e8 cm⁻² s⁻¹(排除 SWCX)。然后做 D49 排队的检验 (a):对 0201/0301/0501/0601 加同期对照(0701/0801/1501/1601),在 lang 上用现有谱、把软质子折断幂律指数自由化重拟(不重处理数据)。Method: check three numbers — the RASS R45 outer-four/other-ten ratio 0.91 ± 0.12 vs the XMM 1.28 (large-scale sky excluded); no +15.6%/deg latitude slope in R45; no outer-NW OMNI window above 4e8 cm⁻² s⁻¹ (SWCX excluded). Then run D49's queued test (a): refit 0201/0301/0501/0601 plus the same-epoch controls (0701/0801/1501/1601) from the existing spectra on lang with the soft-proton broken power-law indices freed (no reprocessing).
- 成功判据:重拟后若四场的 CGMsum 流量显著回落(与对照场持平),软质子解释成立;若流量不变,则检验 (b)(Virgo ODF 级更严格耀斑过滤后重处理)成为下一步。Success/failure: if after the refit the four fields' CGMsum fluxes drop to the controls' level, the soft-proton explanation holds; if they do not move, queued test (b) (reprocess on Virgo with a stricter ODF-level flare filter) is next.
- 时间:读结果半天;重拟约 1–2 天(8 个 ObsID,每个数分钟到更久)。Time: half a day to read the results; about 1–2 days for the refit (8 ObsIDs, minutes or more each).
- 先读:cognition-os/experiments/E014_nw_gradient_rass_omni_crosscheck.md(「Result after luna correction 1」节);cognition-os/04_DECISION_LOG.md D49。Read first: cognition-os/experiments/E014_nw_gradient_rass_omni_crosscheck.md (the "Result after luna correction 1" section); cognition-os/04_DECISION_LOG.md D49.
步骤 4:设计 300 kpc RASS 图(O4)Step 4: design the 300-kpc RASS map (O4)
- 目标:本地(M31 方向)MW 前景模型 + Local Hot Bridge 检验的设计文档。Goal: a design document for a local (M31-direction) MW foreground model and a Local Hot Bridge test.
- 输入:
/home/huangrui/Data/M31_RASS/data/hp_maps/(nside-256 RASS 带;用原生 counts+exposure,修正图只能作次级列——B026)。Inputs:/home/huangrui/Data/M31_RASS/data/hp_maps/(nside-256 RASS bands; use native counts+exposure — the corrected maps are a secondary column only, per B026). - 方法:Poisson 前向模型 rate = c0(1+s(b−b_M31)),加扫描/瓦片噪声层;掩掉 M32/NGC 205 与亮源。Method: a Poisson forward model rate = c0(1+s(b−b_M31)) with scan/tile nuisance layers; mask M32/NGC 205 and bright sources.
- 成功判据:设计能回答「MW 在 M31 方向的宽带亮度是多少、Local Hot Bridge 需要多少」。Success/failure: the design can answer "what is the MW broadband brightness toward M31, and how much would a Local Hot Bridge need".
- 时间:设计 1 天,执行视数据而定。Time: 1 day for the design; execution depends on data.
- 先读:cognition-os/insights/I030 与 I031(RASS 前向模型要点)。Read first: cognition-os/insights/I030 and I031 (the RASS forward-model points).
步骤 5:把三条科学线写进论文讨论Step 5: write the three science lines into the paper discussion
- 目标:New-ANGELS III 草稿的讨论部分覆盖 (i) 总约束与 Locatelli 紧张、(ii) 轮廓形状限制、(iii) NW 起源。Goal: the New-ANGELS III draft discussion covers (i) the total constraint and the Locatelli tension, (ii) the profile-shape limit, (iii) the NW origin.
- 输入:E013/E014 结果 + I017/I033 + 冻结测量表。Inputs: the E013/E014 results, I017/I033, and the frozen measurement tables.
- 方法:直接总和优先(D30/D34);条件场景全部带先验标签;提交门槛按 I013。Method: direct-sum first (D30/D34); every conditional scenario carries its prior label; submission gates stay those of I013.
- 成功判据:每句话都能映射到 03_TRUST_TABLE 的一行;无未标注的建议。Success/failure: every sentence maps to a row of 03_TRUST_TABLE; no unlabelled suggestion.
- 时间:1–2 周。Time: 1–2 weeks.
- 先读:
paper_apj_v19_cgmsum_draft/README_draft_status_and_submission_gaps.md。Read first:paper_apj_v19_cgmsum_draft/README_draft_status_and_submission_gaps.md.
来源:步骤 1–2 依据 E013 BRIEF 与 cognition-os/experiments/E013;步骤 3 依据 cognition-os/experiments/E014(「Result after luna correction 1」节)、cognition-os/04_DECISION_LOG.md D49 与 I033 第 5–6 条;步骤 4 依据 02_CURRENT_QUESTION(2026-10-14 块)与 I030/I031;步骤 5 依据 D48 与 I013。所有「时间」为建议(未经评审)。
Source: steps 1–2 from the E013 BRIEF and cognition-os/experiments/E013; step 3 from cognition-os/experiments/E014 (the "Result after luna correction 1" section), cognition-os/04_DECISION_LOG.md D49, and I033 items 5–6; step 4 from 02_CURRENT_QUESTION (2026-10-14 block) and I030/I031; step 5 from D48 and I013. All "time" entries are a Suggestion (not reviewed).