Skip to content

Add CFQS experimental data processing toolkit#1

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/add-data-processing-tools
Draft

Add CFQS experimental data processing toolkit#1
Copilot wants to merge 2 commits intomainfrom
copilot/add-data-processing-tools

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 13, 2026

Bootstraps the CFQS-Data-Process repository with a full suite of diagnostic data processing tools for the Chinese First Quasi-axisymmetric Stellarator, primarily in MATLAB with Python helpers.

New tools

Diamagnetic loop (diamagnetic/)

  • calibrate_diamagnetic.m — eddy-current drift correction via polynomial fit or external vacuum-shot baseline; integrates raw voltage → flux
  • calc_stored_energy.m — W(t) from calibrated diamagnetic flux using the Bohm relation; configurable B₀, R₀, a, Λ

Equilibrium geometry (magnetic_axis/, LCFS/)

  • plot_magnetic_axis.m — R-Z cross-sections and/or 3-D toroidal curve from equilibrium file
  • plot_LCFS.m — LCFS cross-sections at arbitrary φ and 3-D surface rendering with optional magnetic axis overlay

Diagnostics (electrostatic_probe/, magnetic_probe/)

  • process_langmuir_probe.m — nonlinear least-squares fit of Langmuir I-V → Tₑ, nₑ, V_f, V_p; ion species configurable via IonMass parameter
  • plot_magnetic_probe_spectrum.m — STFT spectrogram, CWT, or time-averaged Welch PSD of Mirnov coil signals

Shared utilities (utils/, python/)

  • load_cfqs_data.m — unified loader for MAT/CSV/TXT/HDF5 with optional time-range trimming
  • cfqs_colormap.m — custom colour maps (plasma, inferno, diverge, cfqs navy-cyan-gold)
  • cfqs_utils.py — Python equivalents: file I/O (MAT v5/v7.3, CSV, HDF5), zero-phase bandpass/lowpass filters, STFT, Bohm density, stored-energy calculation

Usage sketch

% Diamagnetic calibration + stored energy
cal    = calibrate_diamagnetic('shot12345_dia_raw.mat', 'CalFile', 'shot12300_vac.mat');
result = calc_stored_energy(cal, 'B0', 1.0, 'R0', 1.0, 'a', 0.2, 'PlotResult', true);

% Langmuir probe (deuterium plasma)
lp = process_langmuir_probe('shot12345_lp.csv', ...
    'ProbeArea', 1.5e-6, 'IonMass', 2*1.673e-27, 'PlotResult', true);

% Mirnov spectrogram
plot_magnetic_probe_spectrum('shot12345_mirnov.mat', ...
    'FreqRange', [1e3, 300e3], 'Window', 2e-3, 'LogScale', true);
from python.cfqs_utils import load_mat_data, butter_bandpass_filter
data     = load_mat_data('shot12345.mat')
filtered = butter_bandpass_filter(data['signal'], 1e3, 100e3, data['fs'])

Documentation

  • docs/data_processing_workflow.md — end-to-end workflow for all six diagnostic paths, shot-file naming conventions, data quality checklist, and export/archiving guidance
  • README.md — updated with directory tree, quick-start, and tool reference table
Original prompt

我准备在Github上创建一个代码仓库,命名为CFQS-Data-Process,主要用于存放用于实验数据、模拟数据处理工具。
主要可能包括:处理CFQS逆磁测量系统的标定代码和储能计算代码,CFQS磁轴绘图工具,LCFS绘图工具,静电探针数据处理工具,磁探针频谱绘制工具等等。还会包含一些实验数据处理流程之类的文档。
可能主要是MATLAB,以及少量的Python。


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: xinghe1026 <75051880+xinghe1026@users.noreply.github.com>
Copilot AI changed the title [WIP] Add tools for CFQS data processing Add CFQS experimental data processing toolkit Mar 13, 2026
Copilot AI requested a review from xinghe1026 March 13, 2026 09:45
@xinghe1026 xinghe1026 added the invalid This doesn't seem right label Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

invalid This doesn't seem right

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants