synthpop.modules.population_density =================================== .. py:module:: synthpop.modules.population_density Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/synthpop/modules/population_density/_population_density/index /autoapi/synthpop/modules/population_density/besancon2003_bulge/index /autoapi/synthpop/modules/population_density/besancon2003_dark/index /autoapi/synthpop/modules/population_density/besancon2003_halo/index /autoapi/synthpop/modules/population_density/besancon2003_thickdisk/index /autoapi/synthpop/modules/population_density/besancon2003_thindisk/index /autoapi/synthpop/modules/population_density/density_from_grid/index /autoapi/synthpop/modules/population_density/gums_bar/index /autoapi/synthpop/modules/population_density/gums_halo/index /autoapi/synthpop/modules/population_density/gums_thickdisk/index /autoapi/synthpop/modules/population_density/koshimoto2021_bulge_b/index /autoapi/synthpop/modules/population_density/koshimoto2021_thickdisk/index /autoapi/synthpop/modules/population_density/koshimoto2021_thindisk/index /autoapi/synthpop/modules/population_density/triaxial_bulge/index Classes ------- .. autoapisummary:: synthpop.modules.population_density.PopulationDensity Package Contents ---------------- .. py:class:: PopulationDensity(sun: types.ModuleType = None, coord_trans: types.ModuleType = None, gamma_flare: float = None, h_flare: float = None, radius_flare: float = 0, logger: types.ModuleType = None, **kwargs) Bases: :py:obj:`abc.ABC` This is the Parent Class for population densities functions Attributes ---------- population_density_name : str name of the population density density_unit : str specifier if density profile returns "number"-, "mass"- or "init_mass"-density (more attributes are specified in the subclasses) Methods ------- __init__() : Initialize the PopulationDensity class density(r: ndarray, theta, ndarray, z: ndarray) : ndarray estimate the density at (r,theta,z) (specified in the subclasses) .. py:attribute:: average_mass :value: None .. py:attribute:: average_mass_coor :value: None .. py:attribute:: logger :value: None .. py:attribute:: sun :value: None .. py:attribute:: population_density_name :value: 'None' .. py:attribute:: density_unit :value: "one of 'mass', 'init_mass', or 'number'" .. py:attribute:: coord_trans :value: None .. py:attribute:: gamma_flare :value: 0 .. py:attribute:: h_flare :value: None .. py:attribute:: radius_flare :value: 0 .. py:method:: density(r: numpy.ndarray, phi_rad: numpy.ndarray, z: numpy.ndarray) -> numpy.ndarray :abstractmethod: Estimates the density at the given position Parameters ---------- r : ndarray ['kpc'] Distance to z axis phi_rad : ndarray ['rad'] azimuth angle of the stars. phi_rad = 0 is pointing towards sun. z : height above the galactic plane (corrected for warp of the galaxy) Returns ------- rho : ndarray [M_sun/kpc^3 or #/kpc^3] density at the given location, either in number density evolved mass density or initial mass density should be specified in density_unit. .. py:method:: get_kappa_flare(r_kpc: np.ndarray or float, gamma_flare: float = None, h_flare: float = None, radius_flare: float = None) -> np.ndarray or float Estimates the correction factor for the Warp. The scale height should then be multiplied by kappa_flare Parameters ---------- r_kpc : float or ndarray galactocentric radii gamma_flare: float or None slope of the flare if None use the default value from const radius_flare: float or None radius when the flare starts if None use the default value from const Returns ------- kappa_flare : ndarray: correction factor for the scale height .. py:method:: gradient(r_kpc: np.ndarray or float, phi_rad: np.ndarray or float, z_kpc: np.ndarray or float, eps: Tuple[float] = (0.001, 0.0001, 0.001)) -> Tuple[np.ndarray or float, np.ndarray or float, np.ndarray or float] return the gradient at the given location Parameters ---------- r_kpc : float, ndarray [kpc] Radius in kpc phi_rad : float, ndarray [rad] polar angle follows the rotation of the galaxy zero point is at the sun. z_kpc : float, ndarray [kpc] height above/below the galactic plane eps: Tuple(float,float,float) difference used to estimate the gradient Returns ------- dRho_dR : float, ndarray Gradient in Radius dRho_dPhi : float, ndarray Gradient in polar angle direction dRho_dz : float, ndarray Gradient in z direction