← Back to list

visualize-fields
by tatsuki-washimi
gwpy expansions for experiments
⭐ 0🍴 0📅 Jan 26, 2026
SKILL.md
name: visualize_fields description: 多次元フィールドデータ(Field4D/Matrix等)の抽出ロジックと描画APIを、物理的整合性を保ちながら実装する
Visualize Fields Best Practices
When implementing visualization for multi-dimensional data (3D, 4D, Matrix, etc.), design using the following three-layer structure to ensure maintainability and physical accuracy.
1. Infrastructure (Coordinate & Utility Layer)
Separate the conversion logic between physical coordinates and array indices from the class body, and implement it as reusable functions.
nearest_index(axis, value): A nearest-neighbor search that ensures mutual conversion between unit systems (Astropy Units).select_value(data, mode): Extractreal,abs,power, etc., from complex data.- Location:
gwexpy/plot/utils.pyor_coord.py. This prevents the data type classes (Types layer) from directly depending on plotting libraries (such as Matplotlib).
2. Extraction API Layer
Add methods to data type classes that generate "subsets" for visualization.
extract_points/slice_map2d: Returns data formatted for immediate use in drawing.- Convention: Maintain the original class (e.g., Field4D) where possible, or return standard
TimeSeries/FrequencySeries.
3. Plotting API Layer
Drawing methods called directly by the user.
- Naming Convention:
plot_map2d,plot_profile,plot_timeseries_points, etc. - Spectral Visualization:
freq_space_map(Waterfall, etc.) is a 2D map where the time axis is replaced by a frequency axis.- When plotting spectral density (PSD), consider using a log scale (
norm=LogNormorset_yscale('log')) by default.
Physical Consistency Checklist
- Unit Propagation: Does the unit become
unit^2inpowermode? Isangleinrad? - Coordinate Accuracy: Do the values of the plotted axis correspond correctly to the physical axis of the original data via
nearest_index? - Dimensional Maintenance: Are dimensions unexpectedly lost (Squeeze) through slicing operations, breaking the drawing logic?
- Memory Efficiency: For large-scale data, are unnecessary copies (
copy=True) avoided?
Score
Total Score
60/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon