instability_theory_tools

File Purpose: helpful tools for analyzing results of instability theory

E.g. “get growth rate maxxed across k”, “plot growth vs k”

Functions

_imag_and_rename(arr)

return arr.imag, with name='imag_{arr.name}'.

_real_and_rename(arr)

return arr.real, with name='real_{arr.name}'.

_un_log10(arr)

return arr but in linear space, not log10 space.

xarray_at_growmax(array[, growth])

returns array where growth rate is maxxed across k dims from array.

xarray_grows(array)

returns boolean array telling where input growth rate (maxxed across k) > 0.

xarray_growth_kmax(array)

returns growth rate, maxxed across k dims.

xarray_growthplot(array, *[, klines])

like array.pc.image, but with default kwargs from kw_growthplot.

xarray_growthplots(array, *[, klines])

like array.pc.subplots, but with default kwargs from kw_growthplot.

xarray_k(array)

returns wavevector as a vector in the x-y plane.

xarray_k_at_growmax(array)

returns k (vector) where growth rate is maxxes across k.

xarray_kang_at_growmax(array)

returns kang where growth rate is maxxed across k.

xarray_kds_at_growmax(array)

returns dataset of kmod & kang, where growth rate is maxxed across k.

xarray_khat(array)

returns unit vector in the kang direction.

xarray_khat_at_growmax(array)

returns khat for kang where growth rate is maxxed across k.

xarray_klims_physical(ds, *[, to_simple])

return copy of dataset, but also having the physical values limiting k.

xarray_klines(ds, *[, log, mfp, debye, ...])

draw lines representing mean free path, and debye length, on a plot with a |k| axis.

xarray_kmod_at_growmax(array)

returns kmod where growth rate is maxxed across k.

xarray_kw_growthplot(array, **kw_override)

returns kwargs to use for a growth rate plot (using imshow-style kwargs).

xarray_mod_vphase(array)

returns magnitude of phase velocity: mod_vphase = |real(omega)| / |k|.

xarray_smod_vphase(array)

returns signed magnitude of phase velocity: smod_vphase = real(omega) / |k|.

xarray_stack_nonk_dims(growth[, target, ...])

return target stacked along nonk dims.

xarray_vphase(array)

returns phase velocity (vector): vphase = (real(omega) / |k|) * khat.

xarray_where_grows(growth[, target, drop])

return target where growth > 0.

xarray_where_nogrows(growth[, target, drop])

return target where growth <= 0.