这一页写给一个没有 AI 帮助的本科生。所有命令都真实可跑(自检记录见 checkpoint)。先读规则,再按编号计划一步步来。
This page is written for an undergraduate without AI help. Every command actually runs (verification recorded in the checkpoint). Read the rules first, then follow the numbered plan.
1. 机器与角色
1. Machines and their roles
| 机器Machine | 角色Role | |
|---|---|---|
| langlang | 本工作站:代码、数据(/u/Lang3/Data/XARTATOMS)、CIAO 4.18 + Sherpa、HEASoft 6.33、SAS/ESAS。交互分析与绘图。 | This workstation: code, data (/u/Lang3/Data/XARTATOMS), CIAO 4.18 + Sherpa, HEASoft 6.33, SAS/ESAS. Interactive analysis and plotting. |
| virgovirgo | 计算服务器(ssh 访问):批量拟合、中间产物放 NVMe。 | Compute server (via ssh): batch fitting; intermediates on NVMe. |
2. 数据、代码与结果的位置
2. Where data, code and results live
项目根: /u/Lang3/program/XARTATOMS
XMM ODF: data/ → /u/Lang3/Data/XARTATOMS/XMM/ODF
0900170101 = 中心指向; 0900170501/0601 = 偏置(R15-45); 0900170701 = 背景观测
提取产品: data/0900170101/rpc/4.background/bkg_mos*_*/ (obj.pi, back.pi, .arf, .rmf)
Chandra: M104_Chandra_ACIS/repro/9532_repro/, 9533_repro/ (174 ks 合计)
拟合脚本: joint_spectrum_fitting_2T_basedon_region_v18.py (基线)
拟合结果: joint_spectrum_fitting_2T_basedon_region_v18/region*_*
轮廓表: v18_profile_analysis/v18_complete_parameters.csv
figure/radial_thermo_profiles_v18/*.csv
联合管线: chandra_xmm_joint_20261001/ (products/, figures/, RESUME_CHECKPOINT.md)
认知系统: cognition-os/ (00_AI_BRIEFING, 02_CURRENT_QUESTION, 03_TRUST_TABLE,
04_DECISION_LOG, PITFALLS, experiments/, insights/)
3. 可复制粘贴的命令(每条都验证过)
3. Copy-paste commands (each verified)
3.1 初始化环境(每次开新终端)
3.1 Initialise the environment (each new terminal)
export HEADAS=/home/huangrui/software/heasoft-6.33.2/x86_64-pc-linux-gnu-libc2.35 source $HEADAS/headas-init.sh source /home/huangrui/software/miniconda3/envs/ciao-4.18/bin/ciao.sh cd /u/Lang3/program/XARTATOMS
验证:`python --version` 应打印 Python 3.12.12;`python -c "import sherpa; print(sherpa.__version__)"` 应打印 4.18(在 CIAO 环境里)。注意:CIAO 的 ciao.sh 路径以实际安装为准(v17 脚本内置了同样的加载逻辑,见 joint_spectrum_fitting_2T_basedon_region_v18.py 头部)。
Verify: `python --version` should print Python 3.12.12; `python -c "import sherpa; print(sherpa.__version__)"` should print 4.18 (inside the CIAO env). Note the ciao.sh path depends on the installation (the v17+ scripts embed the same loading logic; see the head of joint_spectrum_fitting_2T_basedon_region_v18.py).
3.2 恢复一个已保存的 v18 拟合会话并打印 kT 与区间
3.2 Restore a saved v18 fit session and print kT with its interval
cd /u/Lang3/program/XARTATOMS python inspect_fitting_file.py # 模板:restore 一个 .fitting 会话并列出参数
inspect_fitting_file.py 展示了 `ui.restore(session_file)` 的用法。要打印某个区域的 kT 与 68% 区间,直接读 conf 输出文件(更快、不需要 Sherpa):
inspect_fitting_file.py shows how `ui.restore(session_file)` works. To print a region's kT with its 68% interval, read the conf output file directly (faster, no Sherpa needed):
cd /u/Lang3/program/XARTATOMS column -t -s $'\t' joint_spectrum_fitting_2T_basedon_region_v18/regionR2-4_Angle1_SRCspec_1_SrcApec.txt
实测输出(2026-10-15 运行):kT = 0.7174567,Lower_Bound = 0.6880459,Upper_Bound = 0.7476932(keV)。来源:该文件。
Measured output (run 2026-10-15): kT = 0.7174567, Lower_Bound = 0.6880459, Upper_Bound = 0.7476932 (keV). Source: that file.
3.3 跑一个区域的 v18 拟合(FAST 模式)
3.3 Run the v18 fit for one region (FAST mode)
cd /u/Lang3/program/XARTATOMS FAST_MODE=1 ipython -- joint_spectrum_fitting_2T_basedon_region_v18.py regionR2-4_Angle1
或用现成脚本 `./run_v18_fit.sh regionR2-4_Angle1`(内容一致)。FAST_MODE 跳过 conf 与绘图(v18 源码第 53–55 行注释;T51:每区约 3 分钟)。区域名来自 `ls data/0900170101/rpc/*-*reg` 对应的名字。
Or use the ready script `./run_v18_fit.sh regionR2-4_Angle1` (identical content). FAST_MODE skips conf and plotting (source comments at lines 53–55 of the v18 script; T51: ~3 min per region). Region names follow `ls data/0900170101/rpc/*-*reg`.
3.4 画 v18 径向 kT profile
3.4 Plot the v18 radial kT profile
cd /u/Lang3/program/XARTATOMS python plot_temperature_profile_v18.py
该脚本从 `joint_spectrum_fitting_2T_basedon_region_v18/*_SRCspec_1_SrcApec.txt` 读 kT 与 conf 边界(方法 1),从 `*_reg_proj_data.csv` 读 2D 投影(方法 2),输出 `temperature_profile_comparison_v18.png`(脚本第 202–204 行)。更快的方式:直接读现成表 `figure/radial_thermo_profiles_v18/radial_kT_profile_v18_sector_mean.csv`。
The script reads kT and conf bounds from `joint_spectrum_fitting_2T_basedon_region_v18/*_SRCspec_1_SrcApec.txt` (method 1) and the 2D projection from `*_reg_proj_data.csv` (method 2), writing `temperature_profile_comparison_v18.png` (script lines 202–204). Faster: read the ready table `figure/radial_thermo_profiles_v18/radial_kT_profile_v18_sector_mean.csv`.
3.5 列出 Chandra/XMM 联合状态表
3.5 List the Chandra/XMM joint status table
cd /u/Lang3/program/XARTATOMS
/home/huangrui/software/miniconda3/envs/ciao-4.18/bin/python - <<'EOF'
import csv
rows = list(csv.DictReader(open("chandra_xmm_joint_20261001/products/full_temperature_comparison.csv")))
for r in rows:
print(f"{r['method']:>3} {r['region']:<12} kT={r['kT_kev'] or 'NA':<9} {r['status']}")
EOF
20 行 = 5 方法 × 4 区域。状态列:CLOSED_68_PROFILE_INTERVAL / OPEN_… / MULTIMODAL_… / UNCONSTRAINED_… / PENDING。8 个非 PENDING 单元即 8/20 PASS(2026-10-05 状态)。注:CSV 的 intervals 列内嵌逗号,shell 的 `column -s,` 会对不齐,所以用上面的 python 片段。
20 rows = 5 methods × 4 regions. The status column: CLOSED_68_PROFILE_INTERVAL / OPEN_… / MULTIMODAL_… / UNCONSTRAINED_… / PENDING. The 8 non-PENDING cells are the 8/20 PASS (state of 2026-10-05). Note: the CSV's intervals column embeds commas, so shell `column -s,` misaligns; use the python snippet above.
3.6 临时文件放哪
3.6 Where temp files go
export TMPDIR=/u/Lang2/ai_tmp/<你的名字> # 永远不要写 /tmp, /var/tmp 或 $HOME
4. 新人必须遵守的规则
4. Rules a newcomer must keep
- 临时文件只写 `/u/Lang2/ai_tmp/
`,永远不写 `/tmp`、`/var/tmp` 或 `$HOME`。 - Temp files go only to `/u/Lang2/ai_tmp/
`, never `/tmp`, `/var/tmp` or `$HOME`. - 每条科学结论必须带标签:Trusted / Provisional / Questioned / Deprecated(定义见 cognition-os/SCHEMA.md)。
- Every scientific statement carries a label: Trusted / Provisional / Questioned / Deprecated (definitions in cognition-os/SCHEMA.md).
- 温度梯度主张需要两个独立方法确认才能从 Questioned 升到 Provisional。
- A temperature-gradient claim needs two independent methods before upgrading from Questioned to Provisional.
- D45:不要重启 P1 反馈链。P0 已 NO-GO;不要再跑 exact-footprint pn0/MOS P1 或 post-failure CXB/SP 控制分支。
- D45: do not restart the P1 feedback chain. P0 returned NO-GO; do not run the exact-footprint pn0/MOS P1 or post-failure CXB/SP control branches.
- 只用验证过的 DS9 fk5 区域文件;pie() 仅在 R4–7 生产扇区合同(D30)下允许。
- Use only verified DS9 fk5 region files; pie() is allowed only under the R4–7 production sector contract (D30).
- 参数边界不是误差棒;区间触界要写明(boundary-limited)。
- Parameter bounds are not error bars; intervals hitting a bound must be labelled boundary-limited.
- 几何(区域定义 + overlay 图)必须先过人眼审核,再提取谱(D21/D24/D33)。
- Geometry (region definitions + overlay images) must pass human visual review before spectrum extraction (D21/D24/D33).
- 不要重装/重启 SAS 生产:全局 fkeypar/pget 包装器污染问题未关闭(D43/D44)。
- Do not reinstall/restart SAS production: the global fkeypar/pget wrapper contamination is not closed (D43/D44).
5. 下一步:编号计划
5. Next steps: the numbered plan
顺序遵循 cognition-os/02_CURRENT_QUESTION.md(2026-10-14/15 节):Q-A 先于 Q-D 温度图。以下按 2026-10-15 04:30Z 的最新状态更新。
The order follows cognition-os/02_CURRENT_QUESTION.md (2026-10-14/15 sections): Q-A precedes the Q-D kT map. Updated to the 2026-10-15 04:30Z state.
第 1 步 — 读已完成 job 的报告(半天)Step 1 — Read the finished job reports (half a day)
- 目标:吸收 Q-A/Q-C/Q-B/GTI/mask 的首批结论。输入:`.agent/jobs/2026-10-14-{fit-reliability-audit,sb-profile-13arcmin,cluster-13arcmin-test,chandra-xmm-joint-status,gti-lightcurve-audit,source-mask-design}/REPORT.*.md` 与 cognition-os 的 I065/I066/B020/E034/E035/T148–T153/D46/D47。方法:通读 + 摘录结论与标签。成功标准:能复述每个 job 的主要发现及其信任标签。先读:`cognition-os/sessions/2026-10-14.md`(注意 02:40Z 撤回)。
- Goal: absorb the first-wave conclusions of Q-A/Q-C/Q-B/GTI/mask. Inputs: the REPORT.*.md files of the six finished jobs (2026-10-14: fit-reliability-audit, sb-profile-13arcmin, cluster-13arcmin-test, chandra-xmm-joint-status, gti-lightcurve-audit, source-mask-design) and cognition-os I065/I066/B020/E034/E035/T148–T153/D46/D47. Method: read and extract conclusions with their trust labels. Success: you can restate each job's main finding and its label. Read first: `cognition-os/sessions/2026-10-14.md` (note the 02:40Z retraction).
第 2 步 — Q-A 全网格注入–恢复(1–2 周,需加速)Step 2 — The Q-A full-grid injection–recovery (1–2 weeks, needs acceleration)
- 目标:认证一个参考温度方法。输入:试点已证明流程可行(R2-4 Angle1,50 实现 × 2 策略:偏差 +0.0046/−0.0027 keV,条件覆盖率 0.76/0.80 — T153)。方法:扩展到三个代表区(强 R2-4、弱 R8-10/R10-13、FoV 边缘 R11-13_Angle2)× kT ∈ {0.5, 0.7, 0.9};QPB 观测值按其误差模型独立抽样(不能把噪声 QPB 抽样当独立观测);加背景错设臂(SP ×1.3、CXB ×1.1);加 MOS1-free vs MOS1-with-extra-SP 对比(I066)。成功:某策略偏差≈0 且覆盖率≈0.68;失败:全部有偏 → 先修背景模型。先读:`.agent/jobs/2026-10-14-fit-reliability-audit/out/sol/pilot/` 与其 validation_protocol。
- Goal: certify one reference temperature method. Inputs: the pilot proved the workflow (R2-4 Angle1, 50 realizations × 2 strategies: biases +0.0046/−0.0027 keV, conditional coverages 0.76/0.80 — T153). Method: extend to three representative regions (strong R2-4, weak R8-10/R10-13, FoV-edge R11-13_Angle2) × kT ∈ {0.5, 0.7, 0.9} keV; sample the observed QPB estimate independently from its error model (a noisy QPB draw is not an independent observation); add a background-misspecification arm (SP ×1.3, CXB ×1.1); add MOS1-free vs MOS1-with-extra-SP tests (I066). Success: one strategy with bias ≈ 0 and coverage ≈ 0.68; failure: all biased → fix the background model first. Read first: `.agent/jobs/2026-10-14-fit-reliability-audit/out/sol/pilot/` and its validation protocol.
第 3 步 — 外环谱拟合方法(Q-C 遗留,2–4 天)Step 3 — The outer-ring spectral method (Q-C remainder, 2–4 days)
- 目标:让 10–14′(FoV 边缘)的谱点可用。13′ 假象已定性(I065),剩下的是方法问题。输入:v18 会话 + E034/E035 的诊断。方法:更宽 kT 范围(≥1.5–2 keV,去掉 1 keV 顶)+ profile-likelihood 误差,或绑定/正则化径向模型,或改用偏置指向(0900170501/0601)的谱。成功:外环 kT 有非触界的 68% 区间;失败:区间仍开放 → 外环标灰。先读:`cognition-os/insights/I065_*.md`( implication 段)。
- Goal: make the 10–14′ (FoV-edge) spectral points usable. The 13′ artefact is characterised (I065); what remains is a method question. Inputs: the v18 sessions + the E034/E035 diagnoses. Method: a wider kT range (≥1.5–2 keV, removing the 1 keV ceiling) + profile-likelihood errors, or a tied/regularised radial model, or the offset pointings (0900170501/0601). Success: outer-ring kT with a non-boundary 68% interval; failure: interval still open → grey out the outer ring. Read first: `cognition-os/insights/I065_*.md` (the implication paragraph).
第 4 步 — Chandra+XMM 逐仪器 profile(Q-B 新路线,1 周)Step 4 — The Chandra+XMM per-instrument profile (Q-B new route, 1 week)
- 目标:10′ 内的联合温度 profile(D46)。输入:job `2026-10-15-chandra-xmm-perinst-profile`(运行中)+ v2 mask + 旧管线诊断(T152:J1/J2 双分支 = 共享 kT + 各仪器自由 norm 的模型假象)。方法:每仪器各自全环覆盖;面亮度跨仪器联结(交叉标定 0.7–1.3 自由);kT 0.2–3 keV;profile 网格 ≥40 点;报告 linked 与 unlinked 两种。成功:R2-4/R4-6 联合 68% 区间闭合且与 v18 相容;失败:区间开放/双分支 → 报上限。先读:`.agent/jobs/2026-10-15-chandra-xmm-perinst-profile/BRIEF.md`。
- Goal: the joint kT profile within 10′ (D46). Inputs: job `2026-10-15-chandra-xmm-perinst-profile` (running) + the v2 mask + the old-pipeline diagnosis (T152: the J1/J2 bimodality is a model artefact of shared kT + free per-instrument norms). Method: each instrument its own full-annulus coverage; SB linked across instruments (free cross-calibration 0.7–1.3); kT 0.2–3 keV; profile grids ≥40 points; report both linked and unlinked variants. Success: closed joint 68% intervals for R2-4/R4-6 compatible with v18; failure: open/bimodal intervals → report upper limits. Read first: `.agent/jobs/2026-10-15-chandra-xmm-perinst-profile/BRIEF.md`.
第 5 步 — 2D 强度图(Q-D 前半,1 周)Step 5 — The 2D intensity map (first half of Q-D, 1 week)
- 目标:0.4–1.25 keV 背景扣除马赛克 + 与 v18 谱轮廓交叉核对。输入:job `2d-intensity-map`(运行中)的产品清单 + 现有 ESAS 图像/QPB/SP 产品 + mask v2。方法:Σ(counts − QPB − SP)/Σexposure;点源用 mask v2;曝光 <10% 中位数的像素遮蔽;星系团残余按 E035 建模而不是只遮蔽。成功:SB_image(r)/SB_spectral(r) 随半径近似常数(注意:谱轮廓必须用裸 SB,B020);失败:比例漂移 → 先解决背景/残余。先读:`.agent/jobs/2026-10-14-2d-intensity-map/BRIEF.md`。
- Goal: a 0.4–1.25 keV background-subtracted mosaic cross-checked against the v18 spectral profile. Inputs: the running job `2d-intensity-map`'s inventory + existing ESAS image/QPB/SP products + mask v2. Method: Σ(counts − QPB − SP)/Σexposure; point sources with mask v2; mask pixels with exposure <10% of the median; model the cluster residual per E035 rather than masking alone. Success: SB_image(r)/SB_spectral(r) roughly constant with radius (note: the spectral profile must use the bare SB, B020); failure: the ratio drifts → fix the background/residual first. Read first: `.agent/jobs/2026-10-14-2d-intensity-map/BRIEF.md`.
第 6 步 — 2D 温度图(Q-D 后半,等第 2 步)Step 6 — 2D temperature map (second half of Q-D, waits for Step 2)
- 目标:按 20% 规则的试点温度图。输入:Step 2 选定的方法 + E030/E031 分区方案。方法:先四类试点(盘 W 强区、北侧弱区、共同支持内 halo、外低曝光区),每区真实谱验收(68% 单区间、两侧 ≤20%、95% 无竞争分支)。成功:至少盘 W 试点通过;失败:北区仍 31–33% → 灰标,不插值。先读:`analysis_plans/m104_temperature_area_20261005/temperature_map_binning_recipe_zh.md`。
- Goal: a pilot temperature map under the 20% rule. Inputs: the method chosen in Step 2 + the E030/E031 binning design. Method: four pilot classes first (disk-W strong, north weak, common-support inner halo, outer low-exposure), each accepted by real spectra (single 68% interval, both sides ≤20%, no competing branch at 95%). Success: at least the disk-W pilot passes; failure: the north still 31–33% → grey it out, do not interpolate. Read first: `analysis_plans/m104_temperature_area_20261005/temperature_map_binning_recipe_zh.md`.