Skip to content

Add slice_time and slice_index arguments to IMAS geometry loader #1416

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

theo-brown
Copy link
Collaborator

@theo-brown theo-brown commented Aug 5, 2025

This enables loading an equilibrium from any timeslice in an equilibrium IDS. Useful if resuming from pre-existing simulations.

  • Implementation
  • Testing

@theo-brown theo-brown force-pushed the imas-geometry-timeslice branch from 2422ada to 6632990 Compare August 5, 2025 12:09
@theo-brown
Copy link
Collaborator Author

@MateoBell what's the provenance of the ITERhybrid_COCOS17_IDS_ddv4.nc file? I'd like to extend it to have multiple time slices so that I can test what I've implemented in this PR.

@theo-brown theo-brown force-pushed the imas-geometry-timeslice branch 2 times, most recently from e939fb9 to 678f7cd Compare August 6, 2025 09:56
@theo-brown
Copy link
Collaborator Author

Linked to #1391. During investigating the different geometry loaders in ST, I am comparing eqdsk from various timesteps with CHEASE, IMAS, etc. Hence, I need to be able to load different slices from the IMAS equilibrium IDS.

@MateoBell
Copy link
Collaborator

@MateoBell what's the provenance of the ITERhybrid_COCOS17_IDS_ddv4.nc file? I'd like to extend it to have multiple time slices so that I can test what I've implemented in this PR.

The .nc file was generated with chease converting the EQDSK_ITERhybrid_COCOS02.eqdsk (actually not completely sure which eqdsk of the examples, but it is the one which was used to compare to the CHEASE default geometry file). There is a script to run CHEASE from an eqdsk and save it to an IDS in a database, and then I converted it in netCDF. The script probably requires IMAS core so I can try to generate an IDS with multiple time slices with given eqdsk if needed.

@theo-brown
Copy link
Collaborator Author

theo-brown commented Aug 8, 2025

Thanks! I think for this PR we ideally would have an IDS with different profiles across the time steps we're comparing. This will also pave the way for smoothly interpolating between geometries to have evolving geometry over the run, but this may require rerunning CHEASE (or equivalent fixed-boundary solver) to produce something consistent.

We could, for example, run CHEASE twice using the pprime and FFprime profiles from the beginning and end of the TORAX iterhybrid rampup case as inputs, to give two different geometries for the start and end of the ramp.

What do you think?

@MateoBell
Copy link
Collaborator

MateoBell commented Aug 11, 2025

We could, for example, run CHEASE twice using the pprime and FFprime profiles from the beginning and end of the TORAX iterhybrid rampup case as inputs, to give two different geometries for the start and end of the ramp.

Yes fully agree ! I think it is a good idea so we can get different geometries at different times to compare.

@theo-brown
Copy link
Collaborator Author

theo-brown commented Aug 11, 2025

I've never run CHEASE before, if you're able would you be able to generate the two geometries?

Failing CI is just the placeholder test that's waiting for the new data.

@theo-brown theo-brown force-pushed the imas-geometry-timeslice branch from 678f7cd to 40fd9cd Compare August 12, 2025 13:51
@MateoBell
Copy link
Collaborator

Ok I think I should be able to do it, will try to do it asap !

@jcitrin
Copy link
Collaborator

jcitrin commented Aug 14, 2025

Thanks both! Having a multiple time-slice IDS loader and a test for it would be ideal

@MateoBell
Copy link
Collaborator

I added the multiple time slices IDS, but I just noticed the netCDF file is pretty heavy. I generated it with CHEASE for all time slices of the output simulation from iterhybrid_rampup config. If needed I can reduce the number of time slices to reduce the weight.
Also I modified a bit the tests to make sure the IDS was generated properly and passing it, I fixed it rapidly so you might want to do it more properly.

@theo-brown theo-brown force-pushed the imas-geometry-timeslice branch from 4b4b771 to 6c9e5bd Compare August 19, 2025 09:44
@theo-brown
Copy link
Collaborator Author

theo-brown commented Aug 19, 2025

Incredible, thanks so much @MateoBell. Your fixes to the tests also seem fine!

In the latest force push I just rebased onto main.

For reference, the full .nc is 56.21 MB (GitHub's recommended limit is 50MB). I think we can definitely reduce the number of timeslices - maybe we should go down to ~10 from ~40?

@jcitrin
Copy link
Collaborator

jcitrin commented Aug 19, 2025

Thanks both!

~10 from ~40?

Yes, good idea to not load up the repo with large files

@MateoBell
Copy link
Collaborator

Okay just replaced it with 11 time slices evenly spaced in time, the file is now ~16MB !

@theo-brown theo-brown requested a review from jcitrin August 19, 2025 12:18
@theo-brown theo-brown force-pushed the imas-geometry-timeslice branch from 4234aa1 to 95a7fde Compare August 21, 2025 20:49
@theo-brown theo-brown requested a review from jcitrin August 21, 2025 21:03
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.

3 participants