M31 CGM 工作台M31 CGM / New-ANGELS III
目录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 scriptbackground_spectrum_fitting_2T_basedon_obsid_v19.py
v19 逐 ObsID 会话与配置v19 per-ObsID sessions and configsbackground_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 sourcepaper_apj_v19_cgmsum_draft/
决策、洞察、实验记录Decisions, insights, experiment logscognition-os/
当前讨论与快速检验Current discussion and quick checksnewangels3_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

  1. 临时文件只写到 /u/Lang2/ai_tmp/<你>/,绝不写 /tmp、/var/tmp 或家目录以外的磁盘根。Temp files go to /u/Lang2/ai_tmp// only; never /tmp, /var/tmp, or the root disk.
  2. v19 产品已冻结:会话目录与测量 CSV 只读,不得覆盖、移动或重命名。The v19 products are frozen: the session directory and measurement CSVs are read-only; never overwrite, move, or rename them.
  3. 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.
  4. 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.
  5. 软质子(SP)与仪器线 norm 逐谱自由;任何天体物理联动假设必须显式声明。Soft-proton (SP) and instrumental-line norms stay free per spectrum; any astrophysical linking assumption must be stated explicitly.
  6. 共享的 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".
  7. 非负分量的上限需要边界感知区间(profile likelihood 或模拟校准),不能用普通 F 检验。Limits on non-negative components need boundary-aware intervals (profile likelihood or simulation calibration), not a naive F-test.
  8. lang 共享:新任务 OMP/OPENBLAS/MKL_NUM_THREADS=1;不碰别人的进程,不用默认 tmux server。lang is shared: any new job sets OMP/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

步骤 2:E013 A2 空间模型联合似然Step 2: the E013 A2 joint spatial-model likelihood

步骤 3:读 E014 结果并跟进 D49 排队检验Step 3: read the E014 results and follow up the D49 queued tests

步骤 4:设计 300 kpc RASS 图(O4)Step 4: design the 300-kpc RASS map (O4)

步骤 5:把三条科学线写进论文讨论Step 5: write the three science lines into the paper discussion

来源:步骤 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).