Skip to content

Add summary IDS mapper: TRANSPORT.GLOBAL.TIMES.TAUE → tau_energy - #70

Open
smithsp wants to merge 1 commit into
mainfrom
add-summary-tau-energy-mapping
Open

Add summary IDS mapper: TRANSPORT.GLOBAL.TIMES.TAUE → tau_energy#70
smithsp wants to merge 1 commit into
mainfrom
add-summary-tau-energy-mapping

Conversation

@smithsp

@smithsp smithsp commented Jul 1, 2026

Copy link
Copy Markdown

Summary

  • Adds SummaryMapper that maps DIII-D TRANSPORT MDSplus tree data to the IMAS summary IDS
  • Implements summary.global_quantities.tau_energy.value and summary.global_quantities.tau_energy.time
  • Follows the existing two-stage DIRECT→COMPUTED pattern used by all other mappers

MDSplus mapping

IMAS path MDSplus expression Tree
summary.global_quantities.tau_energy.value \TRANSPORT::TOP.GLOBAL.TIMES.TAUE TRANSPORT
summary.global_quantities.tau_energy.time dim_of(\TRANSPORT::TOP.GLOBAL.TIMES.TAUE, 0) / 1e3 TRANSPORT

TAUE is stored in seconds. The time dimension is stored in milliseconds and is converted to seconds on fetch.

Motivation

The summary IDS was the last missing piece preventing the TR-TSV IPB98(y,2) confinement time model from comparing its predicted τ_E against the measured experimental value. With this mapper, the reference path summary.global_quantities.tau_energy.value becomes fetchable from MDSplus, enabling metric computation in the confinement validation category.

Tests

  • tests/test_summary_requirements.py — parametric test that each field's requirements resolve without error (follows the pattern of all other test_*_requirements.py files)
  • tests/test_summary_composition.py — composition tests verifying:
    • output is a 1-D numpy array of finite, positive values
    • mean τ_E is in the plausible DIII-D range 0.01–1.0 s
    • time array is in seconds (not ms) and monotonically increasing
    • value and time arrays have the same length
  • tests/test_config_summary.yaml — skips OMAS comparison (the summary IDS is derived/computed in OMAS rather than read directly from MDSplus, so there is no direct OMAS reference to compare against)

Test plan

  • Run pytest tests/test_summary_requirements.py on a machine with DIII-D MDSplus access (requires TRANSPORT tree for reference shots)
  • Run pytest tests/test_summary_composition.py on same machine
  • Verify simple_load(['summary.global_quantities.tau_energy.value'], <shot>) returns a sensible time trace for a known H-mode shot

🤖 Generated with Claude Code

Maps DIII-D TRANSPORT MDSplus tree data to the IMAS summary IDS.

New files:
  imas_composer/ids/summary.py   — SummaryMapper(IDSMapper)
  imas_composer/ids/summary.yaml — field ledger

Implemented fields:
  summary.global_quantities.tau_energy.value
    ← \TRANSPORT::TOP.GLOBAL.TIMES.TAUE  (seconds, as stored)
  summary.global_quantities.tau_energy.time
    ← dim_of(\TRANSPORT::TOP.GLOBAL.TIMES.TAUE, 0) / 1e3  (ms → s)

The SummaryMapper follows the same DIRECT→COMPUTED two-stage pattern
used by other mappers (tf, nbi, etc.) and is auto-discovered by
IDSFactory via the snake_to_pascal naming convention.

Tests:
  tests/test_summary_requirements.py  — parametric requirement resolution
  tests/test_summary_composition.py   — value checks (array, finite,
    positive, plausible DIII-D range 0.01–1.0 s, time in seconds,
    monotonic, same length as time array)
  tests/test_config_summary.yaml      — skip OMAS comparison (summary is
    a derived IDS in OMAS, not read directly from MDSplus)

Motivation: enables TR-TSV IPB98(y,2) model to compare its predicted
tau_E against the TRANSPORT-tree measured value, and allows any model
in the confinement category to use summary.global_quantities.tau_energy
as a reference for metric computation.
@smithsp
smithsp requested a review from AreWeDreaming July 1, 2026 14:04
@AreWeDreaming

Copy link
Copy Markdown
Collaborator

This is missing some of the meta information. This is a computed quantity, where did it come from?

@AreWeDreaming AreWeDreaming left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The convention (and i guess it is not documented) is to not do math on the remote but do all math locally.

dim_of(..., 0) returns milliseconds; divide by 1e3 to convert to seconds.
"""
key = Requirement(
r"dim_of(\TRANSPORT::TOP.GLOBAL.TIMES.TAUE, 0) / 1e3",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The conversion should not happen in an MDSplus query but be done locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants