CTS-spec
fusion-repo / CTS-spec
プラズマ診断のための協同トムソン散乱(CTS)スペクトル密度関数計算パッケージ
概要
(説明は未登録です)
典型的な利用シーン
- 電子プラズマ波・イオン音波の CTS スペクトルを計算したい
- 実験で得た CTS スペクトルをフィッティングしてプラズマを診断したい
README
CTS-spec
Collective Thomson scattering (CTS) spectral density function calculation package for plasma diagnostics.
Overview
This package provides tools for calculating and analyzing collective Thomson scattering spectra in plasmas, including both electron plasma waves (EPW) and ion acoustic waves (IAW). It is particularly useful for plasma diagnostics in high-energy density physics experiments.
Features
- Calculation of CTS spectra for multi-component plasmas
- Support for both EPW and IAW components
- FLYCHK integration for ionization state calculations
- Distribution function calculations
- Spectrum convolution with instrument function
- Fitting utilities for experimental data analysis
Project Structure
CTS-spec/
├── src/
│ └── cts_spec/
│ ├── __init__.py
│ ├── core.py # Core CTS calculation module
│ ├── distribution.py # Distribution function calculations
│ ├── fitting.py # Fitting utilities
│ ├── convolution.py # Spectrum convolution functions
│ └── flychk.py # FLYCHK functions
├── script/
│ ├── cts_plot_epw.py # EPW spectrum plotting script
│ └── cts_plot_iaw.py # IAW spectrum plotting script
├── test/ # Test suite
│ ├── test_spectrum.py # Spectrum comparison tests
│ ├── conftest.py # Pytest configuration
│ └── README.md # Test documentation
├── sample/
│ ├── epw/ # Sample EPW data
│ │ ├── EPW-test_axis.txt
│ │ └── EPW-test_2.9ns.txt
│ └── iaw/ # Sample IAW data
│ ├── IAW-test_axis.txt
│ └── IAW-test_2.9ns.txt
├── README.md
├── LICENSE
└── pyproject.toml # Project configuration
Directory Descriptions
src/cts_spec/: Core package source codecore.py: Main module containing CTS calculation functionsdistribution.py: Distribution function calculationsfitting.py: Fitting utilities for experimental dataconvolution.py: Spectrum convolution functions
script/: Example scripts for different analysis scenarioscts_plot_epw.py: Script for plotting EPW spectracts_plot_iaw.py: Script for plotting IAW spectra
test/: Test suite for spectrum calculationstest_spectrum.py: Tests for spectrum comparisonconftest.py: Pytest configurationREADME.md: Test documentation
sample/: Sample data files for testing and examplesepw/: Sample EPW data filesiaw/: Sample IAW data files
Prerequisites
- Required
- Python >= 3.11 (for tomllib support)
- NumPy >= 1.20 (for improved type hints and array operations)
- SciPy >= 1.7.0
- Matplotlib >= 3.4.0
- pytest (for testing)
Note: The code uses NumPy's type hints and array operations extensively. All numerical calculations are performed using floating-point numbers (64-bit precision).
Installation
From source
python3 -m pip install CTS_SPEC_ROOT_DIRECTORY
where CTS_SPEC_ROOT_DIRECTORY points to the directory including this README.md file.
Testing
The project includes a comprehensive test suite to ensure calculation consistency. See test/README.md for detailed testing information.
Quick Start
# Run all tests
pytest
# Run specific tests
pytest test/test_spectrum.py::TestSpectrumCalculations::test_epw_spectrum
Setting Up Reference Data
Before running tests, you need to set up the reference data:
# Create reference directories
mkdir -p sample/ref/epw sample/ref/iaw
# Copy current calculation results as reference data
cp sample/epw/EPW-calc_* sample/ref/epw/
cp sample/iaw/IAW-calc_* sample/ref/iaw/
Usage
Basic Example
import numpy as np
from cts_spec import cts_spec
# Define wavelength array
lmd_nm = np.linspace(526.0, 527.0, 1000) # nm
# Define plasma parameters
# Electron parameters: [temperature (eV), density (1e18 cm^-3), velocity (km/s)]
param_ele = np.array([[100, 1.0, 0.0]])
# Ion parameters: [temperature (eV), density (1e18 cm^-3), velocity (km/s),
# ionization state, ion mass]
param_ion = np.array([[1000, 1.0, 0.0, 10, 64]])
# Laser parameters: [wavelength (nm), scattering angle (deg), norm, offset]
par_laser = [526.5, 60, 1.0, 0.0]
# Calculate spectrum
spectrum = cts_spec(lmd_nm, param_ele, param_ion, par_laser)
Advanced Features
FLYCHK Integration
# Enable FLYCHK for ionization state calculation
spectrum = cts_spec(lmd_nm, param_ele, param_ion, par_laser, flychk=True)
Separate EPW and IAW Components
# Calculate only ion acoustic wave component
spectrum_iaw = cts_spec(lmd_nm, param_ele, param_ion, par_laser,
separate=True, iaw=True)
# Calculate only electron plasma wave component
spectrum_epw = cts_spec(lmd_nm, param_ele, param_ion, par_laser,
separate=True, iaw=False)
Distribution Functions
from cts_spec import dfe, dfi
# Calculate electron distribution function
v_ele = np.linspace(-1e8, 1e8, 1000) # cm/s
f_ele = dfe(v_ele, param_ele[0, 0], param_ele[0, 2], param_ele[0, 1])
# Calculate ion distribution function
v_ion = np.linspace(-1e7, 1e7, 1000) # cm/s
f_ion = dfi(v_ion, param_ion[0, 0], param_ion[0, 2], param_ion[0, 1], param_ion[0, 4])
Documentation
For detailed documentation of the API and usage examples, please refer to the docstrings in the source code.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the BSD 2-Clause License. See the LICENSE file for details.
Copyright
This code is written by Kentaro Sakai, modified by Yusuke Konishi, Tatsumi Aoyama, and Kazuyoshi Yoshimi.
Citation
If you use this software in your research, please cite:
@software{cts_spec,
author = {Kentaro Sakai, Yusuke Konishi, Tatsumi Aoyama, and Kazuyoshi Yoshimi},
title = {CTS-spec: Collective Thomson Scattering Spectral Density Function},
year = {2026},
url = {https://github.com/fusion-repo/CTS-spec}
}
出典: https://github.com/fusion-repo/CTS-spec の README
充実度
充実度 = ドキュメント(docs)・サンプル(examples)・テスト(tests)の3項目の整備状況を★3で表示します(1星=1項目/下のチェックリストが内訳)。リポジトリ情報を取得していない(手動で登録した)ソフトウェアは自動評価の対象外で、充実度の絞り込み(1 以上)では表示されません。
- あり: README
- あり: LICENSE
- なし: docs
- あり: examples
- あり: tests
- あり: CITATION
- なし: release
情報
- 主要言語
- Python
- 言語
- Python
- ライセンス
- BSD-2-Clause
- 提供元
- github