pyrokinetics.diagnostics.synthetic_highk_dbs.SyntheticHighkDBS#

class pyrokinetics.diagnostics.synthetic_highk_dbs.SyntheticHighkDBS(diag, filter_type, Rloc, Zloc, Kn0_exp, Kb0_exp, wR, wZ, eq_file, kinetics_file, simdir, gk_file, savedir='./', fsize=12)[source]#

Bases: object

Synthetic diagnostic for producing synthetic frequency/k-spectra from gyrokinetic simulations

Steps: # 1. Inputs are diagnostic specific (diagnostic, filter, k, location, resolution, local rhos). See example_syn_hk_dbs.py # 2. Load equilibrium, kinetics files. Find scattering location theta. See __init__ in class SyntheticHighkDBS # 3. Map (kn, kb) to (kx, ky) for all k’s / channels specified in 1. See function mapk # 4. Load GK output data (fluctuation moment file). See function get_syn_fspec # 5. For each input condition (eg. for each k in DBS/highk), filter sim data. See class Filter, functions apply filter, get_syn_fspec # 6. Generate synthetic spectra and make plots. See functions get_syn_fspec, plot_syn

diag: str

Type of diagnostic: ‘highk’, ‘dbs’, ‘rcdr’, ‘bes’

filter_type: str

Type of filter - currently only ‘gauss’ is available # ‘bt_2d’, ‘bt_scotty’ for beam tracing, ‘gauss’ for Gaussian filter

Rloc: float, units [length]

Major radius location of scattering

Zloc: float, units [length]

Z location of scattering

Kn0_exp: ArrayLike, units [length**-1]

Normal wavenumber component of the scattered turbulence k - see definition in Ruiz Ruiz PPCF 2022

Kb0_exp: ArrayLike, units [length**-1]

Binormal wavenumber component of the scattered turbulence k - see definition in Ruiz Ruiz PPCF 2022

wR: float, units [length]

Major radius spot size length of the filter function/spread function

wZ: float, units [length]

Vertical spot size length of the filter function/spread function

eq_file: [PathLike]

Equilibrium file used for the gyrokinetic simulations

kinetics_file: [PathLike]

Kinetics file used for the gyrokinetic simulations

simdir: [PathLike]

Directory where simulation data is stored

gk_file: [PathLike]

File name of gyrokintic input file

savedir: [PathLike] default “./”

Directory where to store the synthetic diagnostic output

fsize: int, default 12

Size of font for plots

Parameters:
__init__(diag, filter_type, Rloc, Zloc, Kn0_exp, Kb0_exp, wR, wZ, eq_file, kinetics_file, simdir, gk_file, savedir='./', fsize=12)[source]#
Parameters:

Methods

__init__(diag, filter_type, Rloc, Zloc, ...)

apply_filter(dn, fkxky, dims)

get_syn_fspec(t1, t2, savedir, if_save)

# Function that performs filtering and produces synthetic spectra # Steps: # 1: Load simulation data: pyro object, grids, moments .

mapk()

plot_syn()

Function that generates all plots in the synthetic diagnostic

apply_filter(dn, fkxky, dims)[source]#
get_syn_fspec(t1, t2, savedir, if_save)[source]#

# Function that performs filtering and produces synthetic spectra # Steps: # 1: Load simulation data: pyro object, grids, moments … # 2: For each case (eg. k in DBS/high-k), define filter. See filter Filter # 3: Apply filter on fluctuations. See apply_filter

mapk()[source]#
plot_syn()[source]#

Function that generates all plots in the synthetic diagnostic