pyro-kinetics / pyrokinetics

Python library to run and analyse gyrokinetics simulations
https://pyrokinetics.readthedocs.io/en/latest/#
GNU Lesser General Public License v3.0
23 stars 6 forks source link

pyro to ids failing for tglf template files #367

Open hgd511 opened 2 months ago

hgd511 commented 2 months ago

I've tried adapting the example_imas.py file in the examples folder to apply to tglf (both TGLF_linear and TGLF_transport, in templates/outputs), however am running into errors in each case. Note that pyro_to_ids is successful if one does not load in the output data. The error for TGLF_linear is

Screenshot 2024-06-19 at 15 04 47

and that for TGLF_transport is

Screenshot 2024-06-19 at 15 05 01
bpatel2107 commented 2 months ago

Not loading the output will just load the inputs into the IDS so that should work fine.

For the TGLF we haven't set up the cases with eigenvalue solvers are used. In such cases the there is no time in the simulation so it is not a coordinate. There are multiple mode so that is a coordinate.

Essentially we would need to tell pyro when to select mode and not time when using an EV. I think this is straightforward by doing something like

gk_output.isel(time=-1, mode=0, missing_dims="ignore") which would try to select those dimensions out but won't fail if it can't.

For the TGLF_transport, I guess there is no theta grid is defined as its not a coordinate. Probably need to add a check in for that.