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.StellarModelPlummer surface/volume density normalized so that int 2πR Σ(R) dR = 1.
Notes
Inputs and units.
density_2d(R_pc, re_pc=...)anddensity_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_Rincludes 2*pi*R and is the log radial PDF;sample_Rreturns shape (n,) radii in pc.Validity. Positive
re_pc, nonnegative radius. For positivere_pc,log_prob_Rgives 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])
- density_2d(R_pc, *, re_pc)[source]#
Return unit-normalized Plummer surface density in pc^-2 on JAX.
R_pcis a projected scalar/array radius in pc andre_pcis 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.
- density_3d(r_pc, *, re_pc)[source]#
Return unit-normalized Plummer density in pc^-3 on the JAX backend.
r_pcis an intrinsic scalar/array radius in pc andre_pcis 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.
- 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_pcand positivere_pcin pc, broadcastable.Returns and shape. Natural log radial PDF including 2*pi*R, with broadcast shape. For positive
re_pc,R_pc=0gives minus infinity and negative radii give NaN. This helper does not mask invalid inputs.
- 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_pcis positive scale in pc.Returns and shape. Array (n,) of radii in pc. Split keys explicitly before repeated independent draws.
- 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]#