PotentialWrapper

class discO.PotentialWrapper(potential: Any, *, frame: CoordinateFrame | SkyCoord | str | None = None, representation_type: BaseRepresentation | str | None | ellipsis = None)[source]

Bases: object

Base-class for evaluating potentials.

Parameters:
potentialobject

The potential.

frameframe-like or None or Ellipsis (optional, keyword-only)

The natural frame of the potential.

representation_typerepresentation-like or None or Ellipsis

Attributes Summary

default_representation

The default BaseRepresentation of the potential.

frame

The BaseCoordinateFrame of the potential.

representation_type

The BaseRepresentation of the potential.

wrapped

The wrapped potential.

Methods Summary

__call__(points, *[, representation_type])

Evaluate the specific potential.

acceleration(potential, points, *[, frame, ...])

Evaluate the specific force.

coefficients(potential)

Coefficients of the potential.

density(potential, points, *[, ...])

Evaluate the density in the potential-density pair.

potential(potential, points, *[, frame, ...])

Evaluate the potential.

specific_force(potential, points, *[, ...])

Evaluate the specific force.

total_mass(potential)

Evaluate the total mass.

Attributes Documentation

default_representation

The default BaseRepresentation of the potential.

frame

The BaseCoordinateFrame of the potential.

representation_type

The BaseRepresentation of the potential.

wrapped

The wrapped potential.

Methods Documentation

__call__(points: BaseRepresentation | CoordinateFrame | SkyCoord, *, representation_type: BaseRepresentation | str | None | ellipsis = None, **kwargs)[source]

Evaluate the specific potential.

Parameters:
pointscoord-array or BaseRepresentation or None (optional)

The points at which to evaluate the potential. Potentials do not have an intrinsic reference frame, but if we have assigned one, then anything needs to be converted to that frame.

representation_typeBaseRepresentation or None (optional, keyword-only)

The representation type in which to return data. None means no representation is forced.

**kwargs

Arguments into the potential.

Returns:
pointsBaseCoordinateFrame or SkyCoord
valuesQuantity
classmethod acceleration(potential: Any, points: BaseRepresentation | CoordinateFrame | SkyCoord, *, frame: CoordinateFrame | None = None, representation_type: BaseRepresentation | str | None | ellipsis = None, **kwargs)

Evaluate the specific force.

Parameters:
pointscoord-array or BaseRepresentation or None (optional)

The points at which to evaluate the force. Potentials do not have an intrinsic reference frame, but if we have assigned one, then anything needs to be converted to that frame.

representation_typeBaseRepresentation or None (optional, keyword-only)

The representation type in which to return data.

**kwargs

Arguments into the potential.

Returns:
BaseVectorField subclass instance

Type set by representation_type

classmethod coefficients(potential) Dict[str, Any] | None[source]

Coefficients of the potential.

Returns:
None or dict

None if there aren’t coefficients, a dict of the coefficients if there are.

classmethod density(potential: Any, points: BaseRepresentation | CoordinateFrame | SkyCoord, *, representation_type: BaseRepresentation | str | None | ellipsis = None, **kwargs) Tuple[CoordinateFrame | SkyCoord, Quantity][source]

Evaluate the density in the potential-density pair.

Parameters:
pointscoord-array or BaseRepresentation or None (optional)

The points at which to evaluate the density. Potentials do not have an intrinsic reference frame, but if we have assigned one, then anything needs to be converted to that frame.

representation_typeBaseRepresentation or None (optional, keyword-only)

The representation type in which to return data. None means no representation is forced.

**kwargs

Arguments into the potential.

Returns:
pointsBaseCoordinateFrame or SkyCoord
valuesQuantity
classmethod potential(potential: Any, points: BaseRepresentation | CoordinateFrame | SkyCoord, *, frame: CoordinateFrame | None = None, representation_type: BaseRepresentation | str | None | ellipsis = None, **kwargs)[source]

Evaluate the potential.

Parameters:
pointscoord-array or BaseRepresentation or None (optional)

The points at which to evaluate the potential. Potentials do not have an intrinsic reference frame, but if we have assigned one, then anything needs to be converted to that frame.

representation_typeBaseRepresentation or None (optional, keyword-only)

The representation type in which to return data. None means no representation is forced.

**kwargs

Arguments into the potential.

Returns:
pointsBaseCoordinateFrame or SkyCoord
valuesQuantity
classmethod specific_force(potential: Any, points: BaseRepresentation | CoordinateFrame | SkyCoord, *, frame: CoordinateFrame | None = None, representation_type: BaseRepresentation | str | None | ellipsis = None, **kwargs)[source]

Evaluate the specific force.

Parameters:
pointscoord-array or BaseRepresentation or None (optional)

The points at which to evaluate the force. Potentials do not have an intrinsic reference frame, but if we have assigned one, then anything needs to be converted to that frame.

representation_typeBaseRepresentation or None (optional, keyword-only)

The representation type in which to return data.

**kwargs

Arguments into the potential.

Returns:
BaseVectorField subclass instance

Type set by representation_type

classmethod total_mass(potential)[source]

Evaluate the total mass.

Returns:
mtotQuantity

The total mass.