File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -654,6 +654,22 @@ def _save_core_profiles(
654654 coords = {MAIN_ION : main_ions , TIME : self .times },
655655 name = "main_ion_fractions" ,
656656 )
657+ # Handle fast ions
658+ first_fast_ions = self .core_profiles [0 ].fast_ions
659+ for i , first_fi in enumerate (first_fast_ions ):
660+ source_key = f"{ first_fi .source } _{ first_fi .species } "
661+ n_data = np .stack ([
662+ cp .fast_ions [i ].n .cell_plus_boundaries () for cp in self .core_profiles
663+ ])
664+ T_data = np .stack ([
665+ cp .fast_ions [i ].T .cell_plus_boundaries () for cp in self .core_profiles
666+ ])
667+ xr_dict [f"n_fast_ion_{ source_key } " ] = self ._pack_into_data_array (
668+ f"n_fast_ion_{ source_key } " , n_data
669+ )
670+ xr_dict [f"T_fast_ion_{ source_key } " ] = self ._pack_into_data_array (
671+ f"T_fast_ion_{ source_key } " , T_data
672+ )
657673
658674 return xr_dict
659675
You can’t perform that action at this time.
0 commit comments