PlummerModel#

jeanspy.model_jax.PlummerModel

See methods and properties for individual lookup pages, or the alphabetical API dictionary to search all classes. The full class contract and existing member anchors are retained below.

class jeanspy.model_jax.PlummerModel(submodels=None)[source]#

Bases: jeanspy.model_jax.StellarModel

Plummer surface/volume density normalized so that int 2πR Σ(R) dR = 1.

Notes

Inputs and units. density_2d(R_pc, re_pc=...) and density_3d(r_pc, re_pc=...) use pc. sample_R(key, n, re_pc=...) takes a JAX random key and static sample count.

Returns and shape. pc^-2 or pc^-3 density with broadcast input shape; log_prob_R includes 2*pi*R and is the log radial PDF; sample_R returns shape (n,) radii in pc.

Validity. Positive re_pc, nonnegative radius. For positive re_pc, log_prob_R gives minus infinity at zero radius and NaN for negative radii; it does not mask invalid inputs.

Errors. Low-level density expressions can produce NaN/inf for invalid parameters.

Backend. JAX arrays on the configured CPU/GPU, with dtype set before import.

Differentiation. Physical scales and valid radii are differentiable; random keys and sample counts are not.

Examples. examples/docs_jax_spherical.py

Parameters:

submodels (Dict[str, jeanspy.model_jax.Model])

required_param_names: tuple[str, ...] = ('re_pc',)#
density_2d(R_pc, *, re_pc)[source]#

Return unit-normalized Plummer surface density in pc^-2 on JAX.

R_pc is a projected scalar/array radius in pc and re_pc is the positive projected half-light scale in pc. Output follows broadcasting; the expression is differentiable within the valid domain. This elementary helper does not validate physical parameter values.

Parameters:
Return type:

jax.Array

density_3d(r_pc, *, re_pc)[source]#

Return unit-normalized Plummer density in pc^-3 on the JAX backend.

r_pc is an intrinsic scalar/array radius in pc and re_pc is the positive projected half-light scale in pc. Output follows broadcasting; the expression is differentiable within the valid domain. This elementary helper does not validate physical parameter values.

Parameters:
Return type:

jax.Array

log_prob_R(R_pc, *, re_pc)[source]#

Log-pdf of observed projected radius R (i.e. p(R) dR).

p(R) = 2πR Σ(R) = 2R/re^2 * (1 + (R/re)^2)^(-2)

Notes

Inputs and units. R_pc and positive re_pc in pc, broadcastable.

Returns and shape. Natural log radial PDF including 2*pi*R, with broadcast shape. For positive re_pc, R_pc=0 gives minus infinity and negative radii give NaN. This helper does not mask invalid inputs.

Parameters:
Return type:

jax.Array

sample_R(key, n, *, re_pc)[source]#

Sample projected radii using the analytic inverse CDF.

CDF(R) = R^2 / (R^2 + re^2) -> R = re * sqrt(u/(1-u)).

Notes

Inputs and units. key is a JAX random key; n is a static nonnegative count; re_pc is positive scale in pc.

Returns and shape. Array (n,) of radii in pc. Split keys explicitly before repeated independent draws.

Parameters:
Return type:

jax.Array

required_models: Mapping[str, type[jeanspy.model_jax.Model]] = {}#
sampling_identity()#

Model configuration without the derived compilation cache.

submodels: Dict[str, jeanspy.model_jax.Model]#