pttools.ssmtools.ssm

Sound Shell Model functions

Classes

class pttools.ssmtools.ssm.DE_Method(value, names=_not_given, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: str, Enum

ALTERNATE = 'alternate'
STANDARD = 'standard'
class pttools.ssmtools.ssm.Method(value, names=_not_given, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: str, Enum

E_CONSERVING = 'e_conserving'
F_ONLY = 'f_only'
WITH_G = 'with_g'

Functions

pttools.ssmtools.ssm.a2_e_conserving(bub, z, cs, z_st_thresh=const.Z_ST_THRESH, nxi=const.NPTDEFAULT[0])

Returns the value of \(|A(z)|^2\), where \(|\text{Plane wave amplitude}|^2 = T^3 | A(z)|^2\).

Parameters:
  • z (ndarray) – array of scaled wavenumbers \(z = kR_*\).

  • bub (Bubble)

  • cs (float)

  • z_st_thresh (float)

  • nxi (int)

Returns:

\(|A(z)|^2\), fp2_2, lam2

Return type:

Tuple[ndarray, ndarray, ndarray]

pttools.ssmtools.ssm.a2_e_conserving_bag(z, v_wall, alpha_n, npt=const.NPTDEFAULT, de_method=DE_Method.STANDARD, z_st_thresh=const.Z_ST_THRESH, v_sh=None, v_ip=speedup.NAN_ARR, w_ip=speedup.NAN_ARR, xi=speedup.NAN_ARR)

Returns the value of \(|A(z)|^2\), where \(|\text{Plane wave amplitude}|^2 = T^3 | A(z)|^2\), calculated from self-similar hydro solution obtained with “bubble.fluid_shell”.

Parameters:
  • z (ndarray) – array of scaled wavenumbers \(z = kR_*\).

  • de_method (DE_Method) – Note that ‘standard’ (e-conserving) method is only accurate to linear order, meaning that there is an apparent \(z^0\) piece at very low \(z\), and may exaggerate the GWs at low vw. ATM no other de_methods, but argument allows trials.

  • v_wall (float)

  • alpha_n (float)

  • npt (ndarray | Tuple[int, int, int])

  • z_st_thresh (float)

  • v_sh (float)

  • v_ip (ndarray)

  • w_ip (ndarray)

  • xi (ndarray)

Returns:

\(|A(z)|^2\), fp2_2, lam2

pttools.ssmtools.ssm.a2_e_conserving_bag_file(z, filename, alpha, skip=1, npt=const.NPTDEFAULT, z_st_thresh=const.Z_ST_THRESH)

Returns the value of \(|A(z)|^2\), where \(|\text{Plane wave amplitude}|^2 = T^3 | A(z)|^2\), calculated from file, output by “spherical-hydro-code”. Uses method respecting energy conservation, although only accurate to linear order, meaning that there is an apparent \(z^0\) piece at very low \(z\).

Parameters:
  • z (ndarray) – array of scaled wavenumbers \(z = kR_*\)

  • filename (str)

  • alpha (float)

  • skip (int)

  • npt (ndarray | Tuple[int, int, int])

  • z_st_thresh (float)

Returns:

\(|A(z)|^2\)

pttools.ssmtools.ssm.a2_ssm_func_bag(z, v_wall, alpha, npt=const.NPTDEFAULT, method=Method.E_CONSERVING, de_method=DE_Method.STANDARD, z_st_thresh=const.Z_ST_THRESH)

Returns the value of \(|A(z)|^2\). \(|\text{Plane wave amplitude}|^2 = T^3 | A(z)|^2\)

Parameters:
  • z (ndarray) – array of scaled wavenumbers \(z = kR_*\)

  • method (Method) – correct method for SSM is “e_conserving”. Also allows exploring effect of other incorrect methods f_only and with_g.

  • de_method (DE_Method) – How energy density fluctuation feeds into GW ps. See A2_ssm_e_conserving.

  • z_st_thresh (float) – wavenumber at which to switch sin_transform to its approximation.

  • v_wall (float)

  • alpha (float)

  • npt (ndarray | Tuple[int, int, int])

Returns:

\(|A(z)|^2\)

pttools.ssmtools.ssm.f_file_bag(z_arr, t, filename, skip=0, npt=const.NPTDEFAULT, z_st_thresh=const.Z_ST_THRESH)

3D FT of radial fluid velocity v(r) from file.

Parameters:
  • z_arr (ndarray) – array of scaled wavenumbers \(z = kR_*\)

  • filename (str)

  • skip (int)

  • npt (ndarray | Tuple[int, int, int])

  • z_st_thresh (float)

Return type:

ndarray

pttools.ssmtools.ssm.f_ssm_func_bag(z, v_wall, alpha_n, v_sh=None, npt=const.NPTDEFAULT, z_st_thresh=const.Z_ST_THRESH)

3D FT of radial fluid velocity v(r) from Sound Shell Model fluid profile.

Parameters:
  • z (float | float64 | ndarray) – array of scaled wavenumbers \(z = kR_*\)

  • v_wall (float) – \(v_\text{wall}\)

  • alpha_n (float) – \(\alpha_n\)

  • v_sh (float) – shock speed

  • npt (ndarray | Tuple[int, int, int]) – number of points

  • z_st_thresh (float)

Return type:

ndarray

pttools.ssmtools.ssm.g_file_bag(z, t, filename, skip=0)

3D FT of radial fluid acceleration dot{v}(r) from file

Parameters:
  • z (ndarray) – array of scaled wavenumbers \(z = kR_*\)

  • filename (str)

  • skip (int)

Return type:

ndarray

pttools.ssmtools.ssm.g_ssm_func_bag(z, v_wall, alpha, npt=const.NPTDEFAULT)

3D FT of radial fluid acceleration \(\dot{v}\)(r) from Sound Shell Model fluid profile.

Parameters:
  • z (ndarray) – array of scaled wavenumbers \(z = kR_*\)

  • npt (ndarray | Tuple[int, int, int])

Return type:

ndarray

pttools.ssmtools.ssm.lam_ssm_func_bag(z, v_wall, alpha_n, v_sh=None, npt=const.NPTDEFAULT, de_method=DE_Method.STANDARD, z_st_thresh=const.Z_ST_THRESH)

3D FT of radial energy perturbation from Sound Shell Model fluid profile

Parameters:
  • z (ndarray) – array of scaled wavenumbers \(z = kR_*\)

  • v_wall (float)

  • alpha_n (float)

  • v_sh (float)

  • npt (ndarray | Tuple[int, int, int])

  • de_method (DE_Method)

  • z_st_thresh (float)