WSClean 技能
WSClean 是一款無線電干涉測量成像工具,可從 Measurement Set 建立清潔後的影像。當處理來自 LOFAR、MWA、VLA、ASKAP 或 SKA 等望遠鏡的無線電天文資料時,請使用此技能。
使用時機
- 對來自 Measurement Set (.ms) 檔案的無線電干涉資料進行成像
- 對可見度資料進行 CLEAN 解卷積
- 對解析源進行多尺度清潔
- 多頻率合成(寬頻成像)
- 偏振測量成像
- 基於面元的成像,包含方向相關校正
- 自校準迴圈(模型生成)
Docker 存取
WSClean 編譯較複雜。建議使用 Docker:
docker run --rm -it d3vnull0/rapthor-mildtec:smoke wsclean [options] <input.ms>
掛載資料目錄:-v /host/path:/container/path:rw
基本命令結構
wsclean [options] <input-ms> [<2nd-ms> [...]]
關鍵:多個測量集必須相位旋轉至相同位置。
必要參數
影像設定(務必提供)
-size <w> <h>- 影像像素尺寸(必須為偶數)-scale <value>- 像素比例(例如2asec、1amin、0.01deg)-name <prefix>- 輸出檔案名稱前置詞(預設:'wsclean')
解卷積控制
-niter <n>- 最大迭代次數(設定較高值,例如 1000000)-auto-threshold <sigma>- 在 sigma×RMS 處停止(建議:1-5)-mgain <gain>- 主要迴圈增益:0.85(安全)、0.95(積極)- 關鍵:mgain=1.0 會阻止自校準(不更新 MODEL_DATA)
-auto-mask <sigma>- 自動遮罩閾值(建議與-auto-threshold一起使用)
加權
-weight briggs <robust>- Briggs 加權(-2 到 +2,常見:-0.5、0、0.5)-weight uniform- 最大解析度-weight natural- 最大靈敏度
進階功能
-multiscale- 用於解析源的多尺度 CLEAN-channels-out <n>- 將頻寬分割成 N 個影像-join-channels- 多頻率解卷積-pol <list>- 偏振:I、Q、U、V,或 XX、XY、YX、YY-join-polarizations- 偏振測量解卷積
常見工作流程
1. 快速髒圖像(不清潔)
docker run --rm -v $(pwd):/data:rw d3vnull0/rapthor-mildtec:smoke \
wsclean -size 2048 2048 -scale 5asec -name quick /data/obs.ms
2. 標準清潔
wsclean -size 4096 4096 -scale 2asec \
-niter 100000 -auto-threshold 3 \
-weight briggs 0 -mgain 0.85 \
-name standard obs.ms
3. 深度多尺度清潔(最佳品質)
wsclean -size 8192 8192 -scale 1asec \
-multiscale -multiscale-scale-bias 0.7 \
-niter 1000000 -auto-threshold 1 -auto-mask 5 \
-weight briggs -0.5 -mgain 0.85 \
-name deep obs.ms
4. 多頻率合成(4 個通道)
wsclean -size 4096 4096 -scale 2asec \
-channels-out 4 -join-channels \
-multiscale -niter 500000 \
-auto-threshold 3 -mgain 0.85 \
-name mfs obs.ms
5. 偏振測量成像
wsclean -size 4096 4096 -scale 2asec \
-pol xx,yy -join-polarizations \
-niter 100000 -auto-threshold 3 \
-mgain 0.85 -name pol obs.ms
6. 自校準成像
# 關鍵:mgain < 1.0 以更新 MODEL_DATA
wsclean -size 4096 4096 -scale 2asec \
-niter 100000 -auto-threshold 3 \
-mgain 0.85 -multiscale -auto-mask 5 \
-name selfcal obs.ms
輸出檔案
使用 -name myimage:
myimage-dirty.fits- 髒圖像myimage-image.fits- 清潔/還原後的影像myimage-model.fits- 模型(CLEAN 分量)myimage-residual.fits- 清潔後的殘差myimage-psf.fits- 點擴散函數
多通道:myimage-0000-image.fits、myimage-0001-image.fits 等。
多偏振:myimage-I-image.fits、myimage-Q-image.fits 等。
快速參考 - 關鍵參數
| 參數 | 用途 | 典型值 |
|---|---|---|
-niter | 最大迭代次數 | 100000-1000000 |
-auto-threshold | 在 N×sigma 處停止 | 1-5(數值越低越深) |
-mgain | 主要迴圈增益 | 0.85(安全)、0.95(快速) |
-auto-mask | 遮罩閾值 | 3-5 sigma |
-weight briggs | 加權穩健性 | -0.5(解析度)、0(平衡)、0.5(靈敏度) |
-multiscale-scale-bias | 尺度偏好 | 0.6-0.7 |
-channels-out | 輸出通道數 | 通常 4-16 |
-j | CPU 執行緒數 | 預設:所有核心 |
常見問題
清潔發散
- 將
-mgain降低至 0.7 或 0.8 - 若使用多尺度,請加上
-multiscale-gain 0.1 - 嘗試
-major-iteration-mode single
記憶體不足
- 使用
-abs-mem 32(或適當的 GB 數) - 減少
-size或增加-scale - 光譜成像請使用
-deconvolution-channels
無法自校準
- 確保
mgain < 1.0(不是 1.0!) - 只有當 mgain < 1 時,MODEL_DATA 欄位才會更新
成像品質不佳
- 對解析源使用
-multiscale - 深度清潔請加上
-auto-mask 5 - 檢查加權:嘗試
-weight briggs 0
何時查閱詳細參考資料
對於複雜情境,請參考此目錄中的參考檔案:
- reference/parameters.md - 完整參數文件
- reference/workflows.md - 進階工作流程(面元、主波束等)
- reference/troubleshooting.md - 詳細故障排除指南
需要時請使用 Read 工具存取這些檔案。
最佳實務
- 始終使用
-auto-threshold(不要使用絕對閾值) - 設定較高的
-niter並讓閾值停止清潔 - 使用 mgain 0.85 以獲得穩健的 Cotton-Schwab 清潔
- 對解析源使用多尺度 - 總是優於 Högbom
- 將
-auto-mask 5與-auto-threshold 1結合使用 以進行深度清潔 - 影像維度必須為偶數 - 最好是 2 的冪次
- 每個合成波束約 5-6 個像素 以確保適當的取樣
文件
- 完整文件:https://wsclean.readthedocs.io/
- 演算法論文:Offringa & Smirnov 2017 (https://arxiv.org/abs/1706.06786)