XARTATOMS · M104 热晕 X 射线分析手册XARTATOMS · M104 hot-halo X-ray analysis handbook

面向大一物理学生的半实时工作台A semi-live workbench for a first-year physics undergraduate
目录(全部页面)Contents (all pages)

这一页写给一个没有 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

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)

第 2 步 — Q-A 全网格注入–恢复(1–2 周,需加速)Step 2 — The Q-A full-grid injection–recovery (1–2 weeks, needs acceleration)

第 3 步 — 外环谱拟合方法(Q-C 遗留,2–4 天)Step 3 — The outer-ring spectral method (Q-C remainder, 2–4 days)

第 4 步 — Chandra+XMM 逐仪器 profile(Q-B 新路线,1 周)Step 4 — The Chandra+XMM per-instrument profile (Q-B new route, 1 week)

第 5 步 — 2D 强度图(Q-D 前半,1 周)Step 5 — The 2D intensity map (first half of Q-D, 1 week)

第 6 步 — 2D 温度图(Q-D 后半,等第 2 步)Step 6 — 2D temperature map (second half of Q-D, waits for Step 2)