PlasmaCalcs.hookups.eppic.eppic_instability_calculator.eppici_maker.eppici
- PlasmaCalcs.hookups.eppic.eppic_instability_calculator.eppici_maker.eppici(ds, dst=None, *, meta=True, title=None, coords=True, infos=None, TAB=' ', overwrite=False)
- return string suitable for use as an entire eppic.i file.(or, return abspath to dst, if wrote to file.)
- ds: Dataset
- dataset with inputs to eppic.i file.Must be suitable for being passed to eppici_dict.E.g., can use result of EppicInstabilityCalculator(‘eppici_all’).
- dst: None or str
- if provided, write result to the indicated file,os.makedirs(exist_ok=True) as needed.and return abspath to dst, instead of the usual eppici() result.
- meta: bool
- whether to include metadata near the beginning, as comments.E.g., includes datetime when the str was created.
- title: None or str
- if provided, put title=title near the beginning.
- coords: bool, dict, DataArray, or Dataset
- coord info to put after title,putting ‘_coord_’ before each key name (to ensure no overlap with eppic inputs.)Notes:- each coord should probably be a scalar.- if any coord has ndim and ndim==0, will be converted to item().- string coord will be string (wrapped by single quotes) in eppic.i file.True –> use ds.DataArray or Dataset –> use coords.nondim_coords(scalars_only=True, item=True).Example:coords={‘kappae’: 10.0, ‘ngrid_index’: 3, ‘nice’: np.array(7)}–> ‘_coord_kappae = 10.0n_coord_ngrid_index = 3n_coord_nice = 7’
- infos: None or dict
- if provided, after coords put this info,putting ‘_info_’ before each key name (to ensure no overlap with eppic inputs.)Notes:- each value should probably be a scalar.- if any value has ndim and ndim==0, will be converted to item().- string coord will be string (wrapped by single quotes) in eppic.i file.
- TAB: str
- start parameter-defining lines with TAB, to make result prettier.(comment lines will not start with tab)
- overwrite: bool
- if dst provided, tells whether to overwrite existing files.default False –> by default, never overwrite files.