Skip to content

Feature/add separatrix and magnetic axes in plotequilibrium#20

Open
prasad-sawantdesai wants to merge 38 commits into
iterorganization:developfrom
prasad-sawantdesai:feature/add_separatrix_and_magnetic_axes_in_plotequilibrium
Open

Feature/add separatrix and magnetic axes in plotequilibrium#20
prasad-sawantdesai wants to merge 38 commits into
iterorganization:developfrom
prasad-sawantdesai:feature/add_separatrix_and_magnetic_axes_in_plotequilibrium

Conversation

@prasad-sawantdesai

Copy link
Copy Markdown
Contributor

plotequilibrium -u imas:hdf5?path=/work/imas/shared/imasdb/ITER/3/135014/1

image

@SimonPinches

Copy link
Copy Markdown
Contributor

This doesn't look correct. In this configuration the separatrix should connect to the lower X-point which it doesn't. Can we also plot the two X-points in this figure?

@ksunhee8

Copy link
Copy Markdown

The sepratrix plotted from the boundary.r/z is not real separatrix, it is rather last closed flux surface. Therefore it would be useful to check if boundary_separatrix.r/z and boundary_second_separatrix.r/z are available and try to plot all three of them. The boundary_separatrix and boundary_second_separatrix can contain x_point.r/z, for more specific indication of x-points. These would be good to be plotted when they are available in the IDSs.

@MireilleSchneider

Copy link
Copy Markdown
Contributor

I suggest then to just rename 'speratrix' into 'LCFS' such that everyone is happy. Ideally it would be good to also display the separatrix but my guess is that the data is simply not filled in the IDS.

@SimonPinches

Copy link
Copy Markdown
Contributor

It's not the last closed flux surface, that would be the separatrix. It might be the last closed flux surface according to some discretisation of flux values, but that seems a bit arbitrary.

@olivhoenen

Copy link
Copy Markdown
Contributor

We should decide what we want here:

  • DD3 vs DD4 or both? (boundary/contour structures have changed)
  • what to plot: x-points, magnetic center, separatrix (if present, boundary if not), secondary_separatrix (and x_point)? (these are DD3-related structures/names, for DD4 you should look into contour_tree/node and node/levelset)

@prasad-sawantdesai

Copy link
Copy Markdown
Contributor Author

This doesn't look correct. In this configuration the separatrix should connect to the lower X-point which it doesn't. Can we also plot the two X-points in this figure?

Thanks.. added separatrix and x-points

image

@prasad-sawantdesai

Copy link
Copy Markdown
Contributor Author

The sepratrix plotted from the boundary.r/z is not real separatrix, it is rather last closed flux surface. Therefore it would be useful to check if boundary_separatrix.r/z and boundary_second_separatrix.r/z are available and try to plot all three of them. The boundary_separatrix and boundary_second_separatrix can contain x_point.r/z, for more specific indication of x-points. These would be good to be plotted when they are available in the IDSs.

Thank you.. I could not find any IMAS entry with boundary_second_separatrix.r/z . I used boundary_separatrix.r/z and it looks like this -> #20 (comment)

@prasad-sawantdesai

Copy link
Copy Markdown
Contributor Author

Thanks for the comments @SimonPinches
plotequilibrium -u imas:mdsplus?path=/work/imas/shared/imasdb/ITER/3/100507/2 --md "imas:hdf5?path=/work/imas/shared/imasdb/ITER_MD/3/116000/4#wall"

image

@prasad-sawantdesai

Copy link
Copy Markdown
Contributor Author

Also note that many codes or machines are storing x points and strike points within the boundary structure (DD3)

Added here 0cd9c11

@prasad-sawantdesai

Copy link
Copy Markdown
Contributor Author
plotequilibrium --uri "imas:mdsplus?user=public;pulse=134173;run=2326;database=TEST;version=3" --md "imas:hdf5?user=public;pulse=111001;run=103;database=ITER_MD;version=3#pf_active" "imas:hdf5?user=public;pulse=116000;run=4;database=ITER_MD;version=3#wall" -p
image

@olivhoenen

olivhoenen commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Example with last version:
plotequilibrium

  • I don't like the clear overlay button functionality (in addition to add overlay one has to click show legend, not intuitive)
  • buttons and provenance (tiny characters on top left) are colliding with title if we resize the canvas --> can we remove them (provenance I would remove from all plots, maybe you can have a general option to show on the figure, but if people use this tool for plotting data they want to incorporate in a paper they will likely give better provenance information in the text)
  • why putting coords of geom axis in legend, and not of mag axis? (I won't put neither in the legend)
  • legends inside the plot area hides the plot itself --> was better outside IMO
  • don't keep the "Overlays (click to toggle)" in the legends, and don't add the "quantities" in the legend (but you can keep the quantities box, outside the plot)
  • in terms of look & feel, I would give strike points the same color than the x points (to have a bit less different colors on the plot) or even no show strike points at all as these are not present in DD4

Open point: the title needs rethinking to be made smarter / more useful (from the current info I think only time is worth keeping, but time is already shown in the provenance info (which is difficult/impossible to read). So maybe a compromise is to use the provenance capture flag and present prov info (URI + time if relevant) as the title of the figure, and without prov we simply don't set a title. What do you think?

@prasad-sawantdesai

Copy link
Copy Markdown
Contributor Author

I don't like the clear overlay button functionality (in addition to add overlay one has to click show legend, not intuitive)
--> Removed

buttons and provenance (tiny characters on top left) are colliding with title if we resize the canvas --> can we remove them (provenance I would remove from all plots, maybe you can have a general option to show on the figure, but if people use this tool for plotting data they want to incorporate in a paper they will likely give better provenance information in the text)
-->
added --provenance on CLI

why putting coords of geom axis in legend, and not of mag axis? (I won't put neither in the legend)
Removed

legends inside the plot area hides the plot itself --> was better outside IMO
Reverted

don't keep the "Overlays (click to toggle)" in the legends, and don't add the "quantities" in the legend (but you can keep the quantities box, outside the plot)
--> Removed Overlays (click to toggle) and removed quantities from legends

in terms of look & feel, I would give strike points the same color than the x points (to have a bit less different colors on the plot)
--> Done

Open point: the title needs rethinking to be made smarter / more useful (from the current info I think only time is worth keeping, but time is already shown in the provenance info (which is difficult/impossible to read). So maybe a compromise is to use the provenance capture flag and present prov info (URI + time if relevant) as the title of the figure, and without prov we simply don't set a title. What do you think?
--> Removed title, it will be shown as provenance flag is passed

Implementation
1c13e23

@olivhoenen

Copy link
Copy Markdown
Contributor

@prasad-sawantdesai

Copy link
Copy Markdown
Contributor Author
$ plotequilibrium -u  imas:hdf5?path=/work/imas/shared/imasdb/ITER/3/100507/5 --md "imas:hdf5?path=/work/imas/shared/imasdb/ITER_MD/3/116000/5#wall"
image

@prasad-sawantdesai

prasad-sawantdesai commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

We shall keep implementation of strike points from DD3.. Once we have addition of fields for strike points in DD4 we will add implementation for the same..

@olivhoenen

olivhoenen commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Last round of comments:

  • please allow to remove provenance info with an extra option --no-provenance
  • when printing provenance about machine description, please also show a single URI per group of subsystems that are sharing the same data-entry (it works when it is the same as the equilibrium one, but not when it is different), and please print this in the same line, only return for printing the time ref
  • please make sure you plot boundary/outline if present
  • please rename -p option (confusing for users of idsprint -p/--plot) as --profiles, and in these 1D plots do not label the y axis (this is redundant with legend) + use square brackets for units (legend and x-axis title) + use [1] as unit for normalized data and [s] for time (or simply use the unit metadata you get from imas-python)
  • make sure we can still plot machine description with psi when using --no-overlay -md
  • is the --rho option useful / correct? if not, please remove
image

@paulotex paulotex left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM. I tried on 2 data entries from efitpp (predictMagnetics + efitpp, from scenarios 105027/2 and 135011/7).

@prasad-sawantdesai

Copy link
Copy Markdown
Contributor Author

Last round of comments:

  1. please allow to remove provenance info with an extra option --no-provenance
    Added a06d803

  2. when printing provenance about machine description, please also show a single URI per group of subsystems that are sharing the same data-entry (it works when it is the same as the equilibrium one, but not when it is different), and please print this in the same line, only return for printing the time ref
    Updated aaec5d8

  3. please make sure you plot boundary/outline if present
    2595404

  4. please rename -p option (confusing for users of idsprint -p/--plot) as --profiles, and in these 1D plots do not label the y axis (this is redundant with legend) + use square brackets for units (legend and x-axis title) + use [1] as unit for normalized data and [s] for time (or simply use the unit metadata you get from imas-python)
    301de7f

  5. make sure we can still plot machine description with psi when using --no-overlay -md
    7745398

  6. is the --rho option useful / correct? if not, please remove
    Yes, this is useful to plot toroidal flux if exists.

idsprint -u  imas:mdsplus?path=/work/imas/shared/imasdb/TEST/3/134173/2326#equilibrium/time_slice[0]/profiles_2d[0]/phi
09:53:03 INFO     Parsing data dictionary version 3.40.0 @dd_zip.py:89
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ <class 'imas.ids_primitive.IDSNumericArray'>                                                                                                                                                                    │
│ └── numpy.ndarray|(101, 101)|float64: <IDSNumericArray (IDS:equilibrium, time_slice[0]/profiles_2d[0]/phi, FLT_2D)>                                                                                             │
│                                       numpy.ndarray([[-69.5883, -69.5883, -69.5883, ..., -69.5883, -69.5883, -69.5883],                                                                                         │
│                                              [-69.5883, -69.5883, -69.5883, ..., -69.5883, -69.5883, -69.5883],                                                                                                 │
│                                              [-69.5883, -69.5883, -69.5883, ..., -69.5883, -69.5883, -69.5883],                                                                                                 │
│                                              ...,                                                                                                                                                               │
│                                              [-69.5883, -69.5883, -69.5883, ..., -69.5883, -69.5883, -69.5883],                                                                                                 │
│                                              [-69.5883, -69.5883, -69.5883, ..., -69.5883, -69.5883, -69.5883],                                                                                                 │
│                                              [-69.5883, -69.5883, -69.5883, ..., -69.5883, -69.5883, -69.5883]])

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.

6 participants