AxisymmetricDSphModel#
jeanspy.model_jax.AxisymmetricDSphModel
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.AxisymmetricDSphModel(n_force=96, n_vertical=96, n_los=96, submodels=None)[source]#
Bases:
objectCompose functional JAX axisymmetric stellar, halo and anisotropy components.
submodels uses StellarModel=AxisymmetricPlummerModel(), DMModel=AxisymmetricZhaoModel() and AnisotropyModel=AxisymmetricConstantAnisotropyModel(). These are also the defaults. Physical parameters remain explicit in params on every call. Components are immutable and participate in JIT and sampling identity.
Fixed quadrature settings are static under JIT. lax.map with rematerialized per-star evaluation bounds intermediate memory when differentiating catalogs.
Notes
Inputs and units. params requires
re_pc,rs_pc(pc),rhos_Msunpc3(Msun/pc^3), and exactly one of q orq_projected. Optional Q, alpha, beta, gamma,beta_zand inclination (radians) have the defaults shown in the axisymmetric guide.r_t_pcis a positive ellipsoidal cutoff (pc). Use alpha/beta/gamma, matching the spherical Zhao profile. Physical parameter dictionaries hold scalar values; radius arrays are broadcast independently. Use vmap to batch parameter dictionaries. Constructor node countsn_force/n_vertical/n_losare static integers >=16.Returns and shape. sigmalos2 and
intrinsic_momentsreturn (km/s)^2;density_3dis normalized pc^-3,surface_densitypc^-2,mass_density_3dMsun/pc^3,enclosed_massMsun inside an ellipsoid;potential_gradientis (km/s)^2/pc. Coordinates broadcast; intrinsic moments and forces are tuples of matching arrays.Validity. Cylindrical alignment with constant
beta_z; same physical restrictions as the NumPy axisymmetric solver. Scalar sky inputs yield scalars; centers are allowed for projected moments.Errors. Invalid dynamic parameters yield NaN, including under jit. Schema/shape/configuration errors raise before evaluation; likelihood rejects invalid variances.
Backend. JAX arrays on the configured CPU/GPU, with dtype set before import.
Differentiation. Physical scalar parameters and supported coordinate values are differentiable in admissible smooth regions. Node counts, schema decisions, rejection masks and hard-cutoff boundaries are not continuous model parameters. J/D methods are not part of this JAX class.
Examples.
examples/docs_axisymmetric.py;examples/docs_jax.py- sampling_identity()[source]#
Return the three fixed quadrature orders used to identify a sampling target.
The host dictionary contains n_force, n_vertical and n_los. This metadata helper has no physical-parameter derivative.
- intrinsic_moments(R_pc, z_pc, *, params)[source]#
Evaluate the intrinsic Jeans second moments.
Notes
Inputs and units.
R_pc >= 0and signedz_pcin pc, broadcastable; params supplies the physical dictionary.Returns and shape. Tuple (vR2,vz2,vphi2), each in (km/s)^2 with the broadcast coordinate shape. vphi2 is the total azimuthal second moment; no rotation/dispersion split is assigned.
- potential_gradient(R_pc, z_pc, *, params)[source]#
Evaluate derivatives of the gravitational potential.
Notes
Inputs and units.
R_pc >= 0, signedz_pcin pc and explicit params.Returns and shape. Tuple (dPhi/dR,dPhi/dz) in (km/s)^2/pc; gravitational acceleration has the opposite sign.
- surface_density(x_pc, y_pc, *, params)[source]#
Evaluate the projected spheroidal Plummer tracer.
Notes
Inputs and units. Signed
x_pc/y_pcin pc and explicit params; coordinates broadcast.Returns and shape. Normalized surface density in pc^-2 with the broadcast coordinate shape.
- mass_density_3d(R_pc, z_pc, *, params)[source]#
Halo density, including the optional ellipsoidal cutoff.
- enclosed_mass(m_pc, *, params, n_steps=128)[source]#
Mass in Msun inside the spheroid m <= m_pc (with truncation).
Notes
Inputs and units.
m_pc >= 0is the ellipsoidal radius in pc; params supplies halo scales, slopes, Q and cutoff.Returns and shape. Msun inside R^2+z^2/Q^2<=``min(m_pc, r_t_pc)``^2, matching
m_pcshape.
- sigmalos2(x_pc, y_pc, *, params)[source]#
Project a cylindrically aligned second moment.
Notes
Inputs and units. Signed
x_pc/y_pcin pc, broadcastable scalar/arrays; params is the explicit physical dictionary.Returns and shape. LOS second moment in (km/s)^2 with the broadcast coordinate shape, including scalar output.