# Source code for galpy.potential.SphericalPotential

###############################################################################
#   SphericalPotential.py: base class for potentials corresponding to
#                          spherical density profiles
###############################################################################
import numpy
from scipy import integrate
from .Potential import Potential
[docs]class SphericalPotential(Potential): """Base class for spherical potentials. Implement a specific spherical density distribution with this form by inheriting from this class and defining functions: * _revaluate(self,r,t=0.): the potential as a function of r and time; * _rforce(self,r,t=0.): the radial force as a function of r and time; * _r2deriv(self,r,t=0.): the second radial derivative of the potential as a function of r and time; * _rdens(self,r,t=0.): the density as a function of r and time (if *not* implemented, calculated using the Poisson equation). """
[docs] def __init__(self,amp=1.,ro=None,vo=None,amp_units=None): """ NAME: __init__ PURPOSE: initialize a spherical potential INPUT: amp - amplitude to be applied to the potential (default: 1); can be a Quantity with units that depend on the specific spherical potential amp_units - ('mass', 'velocity2', 'density') type of units that amp should have if it has units (passed to Potential.__init__) ro=, vo= distance and velocity scales for translation into internal units (default from configuration file) OUTPUT: (none) HISTORY: 2020-03-30 - Written - Bovy (UofT) """ Potential.__init__(self,amp=amp,ro=ro,vo=vo,amp_units=amp_units) return None