Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make 2D visualizations for edge_profiles data in IMAS DD #4

Closed
3 tasks done
eldond opened this issue Sep 1, 2023 · 9 comments
Closed
3 tasks done

Make 2D visualizations for edge_profiles data in IMAS DD #4

eldond opened this issue Sep 1, 2023 · 9 comments
Assignees

Comments

@eldond
Copy link
Contributor

eldond commented Sep 1, 2023

  • We are asked to use Julia plot recipes to enable plots
  • The way the plots look can use the OMFIT SOLPS module as an example
    • Warning: that module could have some confusion between cells and edges when indexing things for slice plots; the slices are through rows/columns of cells, but the slice locations are displayed as edges.
  • 2D plots of quantities in cells, with cell areas drawn as patches (or whatever they're called in Julia)
  • 2D plots of just the mesh (which can be overlaid on the 2D plots of quantities)
  • Overlays of key surfaces (like the separatrix) on top of 2D plots

Image

Image

Image

@eldond eldond changed the title Make visualizations for data in IMAS DD (but figure out which repo this goes in) Make visualizations for edge_profiles data in IMAS DD Sep 1, 2023
@eldond eldond changed the title Make visualizations for edge_profiles data in IMAS DD Make 2D visualizations for edge_profiles data in IMAS DD Sep 1, 2023
@eldond eldond self-assigned this Sep 12, 2023
@anchal-physics
Copy link
Collaborator

@eldond Are you actively working on this? I can take over if you have not started this one.

@eldond eldond assigned anchal-physics and unassigned eldond Sep 13, 2023
@eldond
Copy link
Contributor Author

eldond commented Sep 13, 2023

@anchal-physics I wanted to but then got sidetracked. Go ahead and take it. I'll finish the extrapolations.

@anchal-physics
Copy link
Collaborator

anchal-physics commented Sep 19, 2023

0388734

Grid and subset visualization has been implemented. Please comment if you would like any more tweaks or features in this visualization.

Image

SOLPSgridVisualization.pdf

Key issues have been found in SOLPS2IMAS. I'll reopen the issue there. Note that the issue of clipping on left margin is me not knowing well about how to save plots in Julia, it is not an issue of the recipe afaik.

@eldond
Copy link
Contributor Author

eldond commented Sep 19, 2023

This is very nice. Not only does the visualization look great, it revealed problems with SOLPS2IMAS that were quite difficult to identify otherwise. It's very easy to be off-by-one with indexing these grids because of the difference between cells and faces and because of the guard cells at the edges that are sometimes counted and sometimes not.

@anchal-physics
Copy link
Collaborator

Finished adding 2D Visualization for data.

68a8a42
a8b9f00

SOLPSElectronDensity

It is still very naive implementation, so this can be improved better in future, but for now, we should be good to go. For example, when overlaying grid on a heatmap, the grid does not appear everywhere which I am not sure why it is happening. This can be a enhancement issue in future.

SOLPSElectronDensityWithGrid

Added examples also

7513373

I've added some minimum working examples on how to plot. Checkout using plotlyjs() as well for interactivity. Please ask for more specific examples if something looks unclear.

@eldond
Copy link
Contributor Author

eldond commented Sep 20, 2023

If this were a python plot with some disappearing elements, I would suggest that the zorder of plot elements needs to be controlled. That is, the lines might be there, but behind the colored patches.

Anyway, nice work. This is very useful for verifying our data.

I was thinking of storing the extended mesh in edge_profiles.grid_ggd[2]. Can this plot solution can do repeated calls to plot grid_ggd[1] and then grid_ggd[2] to get standard mesh and extension next to each other? Similar for core_profiles, when that becomes available.

@eldond
Copy link
Contributor Author

eldond commented Sep 20, 2023

I realized there was no issue for the 2D plot of 1D profiles, so I opened #9.

@anchal-physics
Copy link
Collaborator

Reply to previous comment, according to the manual, grid_ggd[:] are made an array to store time varying grids, so it won't be standard use of the data structure to store extended mesh in grid_ggd[2].

I present two other alternatives:

1. Multiple spaces

The extended grid can be stored in space[2] within the same grid_ggd as that is supposed to represent different spaces.

plot(space[1])
plot!(space[2])

would plot the two spaces in the same plot with the existing code.

2. Additional grid_subset

Another possibility (as we discussed earlier, keeping it in writing here) is that we simply add extended grid as a new grid_subset. This will involve adding new nodes, edges, and cells to the existing space but referred to only by the new grid_subset (say with index 200). This solution has the benefit that the extended mesh cells can be "connected" to SOL cells using boundary attributes while this can not be done if the extended mesh goes in a separate space. In this case, the whole grid including the extension can be plotted by

plot(space)

If only the SOLPS grid needs to be plotted, one can give the grid_subset 5

plot(space, SOLPS2IMAS.get_grid_subset_with_index(grid_ggd, 5))

Currently the above two commands do the same thing.

If only the extended grid is to be plotted, one can do

plot(space, SOLPS2IMAS.get_grid_subset_with_index(grid_ggd, 200))

@eldond
Copy link
Contributor Author

eldond commented Sep 20, 2023

Yes, you're right, and it's good to write it down so I don't forget again.

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

No branches or pull requests

2 participants