Skip to content

Add extra quantities to output IDS#1827

Open
MateoBell wants to merge 3 commits intomainfrom
imas_output_core_profiles_extra_quantities
Open

Add extra quantities to output IDS#1827
MateoBell wants to merge 3 commits intomainfrom
imas_output_core_profiles_extra_quantities

Conversation

@MateoBell
Copy link
Copy Markdown
Collaborator

@MateoBell MateoBell commented Dec 9, 2025

Mapping of some quantities which are not directly available on cell_plus_boundaries grid: j_parallel_total, j_parallel_ohmic, j_non_inductive, Z_avg for impurities and impurity_density_scaling factor.
IDS requires all profiles_1d to be on the same grid, therefore these quantities needed to be computed on the cell_plus_boundaries grid.

Question

To extend them, neighbouring values were copied as boundary values. Other possibility could be to use linear / polynomial extrapolation. What choice should be made for these quantities ?

Fixing wrongly mapped quantities:

  • core_profiles j_total and j_bootstrap corresponds to their parallel current density. It was previously mapped from the toroidal values.

Newly mapped quantities:

  • currents: j_ohmic, j_non_inductive, j_phi
  • pressure for all ions
  • impurities data: z_ion_1d, n_impurity, n_i_volume_average

@MateoBell MateoBell force-pushed the imas_output_core_profiles_extra_quantities branch from 7817b0a to 905ad24 Compare December 9, 2025 16:35
@MateoBell MateoBell marked this pull request as ready for review December 10, 2025 10:43
@MateoBell MateoBell linked an issue Dec 10, 2025 that may be closed by this pull request
@MateoBell MateoBell added the question Further information is requested label Dec 12, 2025
@Nush395
Copy link
Copy Markdown
Collaborator

Nush395 commented Dec 19, 2025

@jcitrin could you comment on some of the boundary value extrapolations done here?

@MateoBell MateoBell force-pushed the imas_output_core_profiles_extra_quantities branch from 1e0c0a6 to 971f37e Compare January 9, 2026 10:28
@soham77-ss
Copy link
Copy Markdown

I’ve reviewed the changes in the imas_output_core_profiles_extra_quantities branch. The newly mapped quantities and corrections to parallel currents look good. A few points to consider:

  • Confirm that boundary values copied for extrapolation are appropriate; linear or polynomial extrapolation could be considered if higher accuracy is needed.
  • Ensure all profiles_1d are consistent on the cell_plus_boundaries grid as required by IDS.
  • Resolve the merge conflicts before merging.

Copy link
Copy Markdown
Collaborator

@jcitrin jcitrin left a comment

Choose a reason for hiding this comment

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

Sorry this took so long to review!


# TODO: Map impurity quantities in PostProcessedOutputs on cell_plus_boundaries
# grid to get rid of this function.
def _calculate_impurity_density_scaling_and_charge_states(
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.

apologies if you already have this. But it would be great to unit test such functions with "round trip" calculations from IMAS --> TORAX --> IMAS

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

There is one TORAX -> IMAS -> TORAX but indeed it could be useful to have it also the other way around to test other quantities. Will try to add it !

Comment thread torax/_src/imas_tools/output/core_profiles.py
Comment thread torax/_src/imas_tools/output/core_profiles.py Outdated
Comment thread torax/_src/imas_tools/output/core_profiles.py Outdated
Comment thread torax/_src/imas_tools/output/core_profiles.py Outdated
@MateoBell MateoBell force-pushed the imas_output_core_profiles_extra_quantities branch 2 times, most recently from c7c099b to 23a82ac Compare January 29, 2026 16:33
@tamaranorman
Copy link
Copy Markdown
Member

Apologies this seems to have fallen through the net. Can you rebase and then someone will take a look

@MateoBell MateoBell force-pushed the imas_output_core_profiles_extra_quantities branch from 23a82ac to 4148d5d Compare April 22, 2026 11:53
@MateoBell MateoBell force-pushed the imas_output_core_profiles_extra_quantities branch from 4148d5d to 867c583 Compare April 22, 2026 12:03
@MateoBell MateoBell added the ready for review Add to PRs when they are ready for review unsure of who to assign as reviewer label Apr 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

question Further information is requested ready for review Add to PRs when they are ready for review unsure of who to assign as reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Populate remainder of IMAS core profiles output

5 participants