AxisymmetricDSphModel#

jeanspy.model.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.AxisymmetricDSphModel(n_force=96, n_vertical=96, n_los=96, submodels=None, inclination=1.5707963267948966)[source]#

Bases: object

Compose a NumPy tracer, halo and anisotropy into an axisymmetric model.

Supply submodels with StellarModel=AxisymmetricPlummerModel, DMModel=AxisymmetricZhaoModel and AnisotropyModel=AxisymmetricConstantAnisotropyModel. Stored parameters are used when params is omitted. An explicit params mapping overrides those values for one call without changing the components. Without submodels, each call requires the full physical parameter dictionary as before. inclination is in radians and applies to stored components.

Required: re_pc, rs_pc, rhos_Msunpc3 and exactly one of q/q_projected. Optional: Q, alpha, beta, gamma, beta_z, inclination (radians).

Notes

Inputs and units. params requires re_pc, rs_pc (pc), rhos_Msunpc3 (Msun/pc^3), and exactly one of q or q_projected. Optional Q, alpha, beta, gamma, beta_z and inclination (radians) have the defaults shown in the axisymmetric guide. r_t_pc is 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 counts n_force/n_vertical/n_los are static integers >=16.

Returns and shape. sigmalos2 and intrinsic_moments return (km/s)^2; density_3d is normalized pc^-3, surface_density pc^-2, mass_density_3d Msun/pc^3, enclosed_mass Msun inside an ellipsoid; potential_gradient is (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 cylindrical Jeans solver. Scalar sky inputs yield scalars; centers are allowed for projected moments.

Errors. Invalid schema/values raise ValueError; nonphysical moments raise InvalidAxisymmetricModelError.

Backend. NumPy/SciPy CPU.

Differentiation. No physical-parameter automatic differentiation on this API.

Examples. examples/docs_axisymmetric.py; examples/docs_jax.py

Parameters:
n_force: int = 96#
n_vertical: int = 96#
n_los: int = 96#
submodels: collections.abc.Mapping | None = None#
inclination: float = 1.5707963267948966#
sampling_identity()[source]#

Return the three fixed quadrature orders used to identify a sampling target.

The host dictionary contains quadrature orders, stored components and inclination. The likelihood separately identifies observations and priors.

property physical_params#

Detached physical defaults from stored components, or an empty mapping.

sigmalos2(x_pc, y_pc, *, params=None)[source]#

Project a cylindrically aligned second moment.

Notes

Inputs and units. Signed x_pc/y_pc in 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.

intrinsic_moments(R_pc, z_pc, *, params=None)[source]#

Evaluate the intrinsic Jeans second moments.

Notes

Inputs and units. R_pc >= 0 and signed z_pc in 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=None)[source]#

Evaluate derivatives of the gravitational potential.

Notes

Inputs and units. R_pc >= 0, signed z_pc in 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=None)[source]#

Evaluate the projected spheroidal Plummer tracer.

Notes

Inputs and units. Signed x_pc/y_pc in pc and explicit params; coordinates broadcast.

Returns and shape. Normalized surface density in pc^-2 with the broadcast coordinate shape.

density_3d(R_pc, z_pc, *, params=None)[source]#

Unit-normalized stellar density in pc^-3.

mass_density_3d(R_pc, z_pc, *, params=None)[source]#

Halo density in Msun pc^-3, including the optional ellipsoidal cutoff.

enclosed_mass(m_pc, *, params=None, n_steps=128)[source]#

Integrate mass inside a similar halo ellipsoid.

Notes

Inputs and units. m_pc >= 0 is 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_pc shape.

jfactor(dist_pc, roi_deg, *, params=None, **quadrature)[source]#

Postprocess an axisymmetric finite-cone factor.

Notes

Inputs and units. Scalar dist_pc and roi_deg; params specifies halo, inclination and finite r_t_pc; n_mu/n_phi/n_radial set independent factor quadratures, all >=16.

Returns and shape. Python float in GeV^2 cm^-5.

Validity. Require explicit finite r_t_pc, observer distance > r_t_pc*max(1,Q), 0 <= roi_deg < 90 and gamma<1.5 (finite central annihilation integral). n_phi uses a periodic rule; refine all orders.

dfactor(dist_pc, roi_deg, *, params=None, **quadrature)[source]#

Postprocess an axisymmetric finite-cone factor.

Notes

Inputs and units. Scalar dist_pc and roi_deg; params specifies halo, inclination and finite r_t_pc; n_mu/n_phi/n_radial set independent factor quadratures, all >=16.

Returns and shape. Python float in GeV cm^-2.

Validity. Require explicit finite r_t_pc, observer distance > r_t_pc*max(1,Q), 0 <= roi_deg < 90 and gamma<2 under the AxisymmetricZhaoModel constructor domain. n_phi uses a periodic rule; refine all orders.