cpdr

class piran.cpdr.Cpdr(
plasma: ~piran.plasmapoint.PlasmaPoint,
energy: ~typing.Annotated[~astropy.units.quantity.Quantity,
Unit("J")] | None = None,
pitch_angle: ~typing.Annotated[~astropy.units.quantity.Quantity,
Unit("rad")] | None = None,
resonance: int | None = None,
freq_cutoff_params: ~typing.Sequence[float] | None = None,
wave_filter: ~piran.wavefilter.WaveFilter = <piran.wavefilter.WhistlerFilter object>,
)

The first particle is expected to be the particle of interest and the one for which energy and pitch angle is provided.

Parameters:
energyQuantity[u.Joule] | None = None

Relativistic kinetic energy.

freq_cutoff_paramsSequence[float] | None = None

Frequency cutoff parameters (mean_factor, delta_factor, l_factor, u_factor)

Attributes:
alpha
energy
gamma
lorentz_factor
momentum
omega_lc
omega_uc
p_par
p_perp
pitch_angle
plasma
rel_velocity
resonance
stix
v_par
wave_freqs

Methods

filter(X, omega, k)

This method calls the filter method of the WaveFilter class.

find_resonant_wavenumber(X, omega)

Substitute the resonant omega into the resonance condition to obtain k_par.

solve_cpdr(omega, X)

Given wave frequency omega and tangent of the wave normal angle X=tan(psi), solves the cold plasma dispersion relation for the wavenumber k.

solve_cpdr_for_norm_factor(omega, X_range)

Given wave frequency omega, solve the dispersion relation for each wave normal angle X=tan(psi) in X_range to get wave number k.

solve_resonant(X_range)

Given the tangent of wave normal angle X=tan(psi), simultaneously solve the resonance condition and dispersion relation to obtain root pairs of wave frequency omega and wave number k, including their parallel and perpendicular components.

filter(
X: Annotated[Quantity, Unit(dimensionless)],
omega: Annotated[Quantity, Unit('rad / s')],
k: Annotated[Quantity, Unit('rad / m')],
) bool

This method calls the filter method of the WaveFilter class. Please refer to the WaveFilter.filter documentation for details about the parameters and their corresponding meanings.

find_resonant_wavenumber(
X: Annotated[Quantity, Unit(dimensionless)],
omega: Annotated[Quantity, Unit('rad / s')],
) Annotated[Quantity, Unit('rad / m')]

Substitute the resonant omega into the resonance condition to obtain k_par. Then, using the resonant X = tan(psi), we can calculate k and k_perp. Because psi is in the range [0, 90] degrees, k and k_perp are always positive (we ensure this by taking the absolute value). However, the resonant cpdr returns solutions in the range [0, 180] degrees, which means that k_par can be negative.

Parameters:
XQuantity[u.dimensionless_unscaled]

Tangent of wave normal angle in units convertible to dimensionless unscaled.

omegaQuantity[u.rad / u.s]

Wave frequency in units convertible to radians per second.

Returns:
[k, k_par, k_perp]Quantity[u.rad / u.m]

Astropy array containing wavenumber k along with the parallel and perpendicular components. k_par can be either positive or negative depending on the direction of wave propagation, while k and k_perp are non-negative as we take the absolute value and psi is in [0, 90] since X >= 0.

solve_cpdr(
omega: Annotated[Quantity, Unit('rad / s')],
X: Annotated[Quantity, Unit(dimensionless)],
) Annotated[Quantity, Unit('rad / m')]

Given wave frequency omega and tangent of the wave normal angle X=tan(psi), solves the cold plasma dispersion relation for the wavenumber k.

Parameters:
omegaQuantity[u.rad / u.s]

Scalar astropy Quantity representing the wave frequency in units convertible to radians per second.

XQuantity[u.dimensionless_unscaled]

Scalar astropy Quantity representing the tangent of the wave normal angle in units convertible to dimensionless unscaled.

Returns:
kQuantity[u.rad / u.m]

1d astropy Quantity representing the real and positive wavenumbers in radians per meter.

solve_cpdr_for_norm_factor(
omega: Annotated[Quantity, Unit('rad / s')],
X_range: Annotated[Quantity, Unit(dimensionless)],
) Annotated[Quantity, Unit('rad / m')]

Given wave frequency omega, solve the dispersion relation for each wave normal angle X=tan(psi) in X_range to get wave number k. Optimised version, similar to solve_cpdr, but we lambdify in X after we substitute omega and is more efficient when we have a single value for omega and a range of X values (for example when computing the normalisation factor).

Note: A key difference between this function and solve_cpdr is that we filter for specific wave modes here, while solve_cpdr does not.

Parameters:
omegaastropy.units.quantity.Quantity convertible to rad/second

Wave frequency.

X_rangeastropy.units.quantity.Quantity[u.dimensionless_unscaled]

Wave normal angles.

Returns:
k_solQuantity[u.rad / u.m]

The solutions are given in the same order as X_range. This means that each (X, omega, k) triplet is a solution to the cold plasma dispersion relation. If we get NaN then for this (X, omega) pair the CPDR has no roots.

solve_resonant(
X_range: Annotated[Quantity, Unit(dimensionless)],
) Sequence[Sequence[NamedTuple]]

Given the tangent of wave normal angle X=tan(psi), simultaneously solve the resonance condition and dispersion relation to obtain root pairs of wave frequency omega and wave number k, including their parallel and perpendicular components.

Note: We filter out solutions that do not correspond to the desired wave modes.

Parameters:
X_rangeastropy.units.quantity.Quantity[u.dimensionless_unscaled]

Tangent of wave normal angles.

Returns:
rootsList[List[ResonantRoot]]

Resonant roots as a list of lists of ResonantRoot objects.

class piran.cpdr.ResonantRoot(X, omega, k, k_par, k_perp)

Methods

count(value, /)

Return number of occurrences of value.

index(value[, start, stop])

Return first index of value.

X: Annotated[Quantity, Unit(dimensionless)]

Alias for field number 0

k: Annotated[Quantity, Unit('rad / m')]

Alias for field number 2

k_par: Annotated[Quantity, Unit('rad / m')]

Alias for field number 3

k_perp: Annotated[Quantity, Unit('rad / m')]

Alias for field number 4

omega: Annotated[Quantity, Unit('rad / s')]

Alias for field number 1