import numpy as np
from EXOSIMS.Prototypes.SimulatedUniverse import SimulatedUniverse
[docs]
class DulzPlavchanUniverse(SimulatedUniverse):
"""Simulated Universe module based on Dulz and Plavchan occurrence rates."""
def __init__(self, **specs):
SimulatedUniverse.__init__(self, **specs)
[docs]
def gen_physical_properties(self, **specs):
"""Generating universe based on Dulz and Plavchan occurrence rate tables."""
PPop = self.PlanetPopulation
TL = self.TargetList
# treat eta as the rate parameter of a Poisson distribution
targetSystems = np.random.poisson(lam=PPop.eta, size=TL.nStars)
plan2star = []
for j, n in enumerate(targetSystems):
plan2star = np.hstack((plan2star, [j] * n))
self.plan2star = plan2star.astype(int)
self.sInds = np.unique(self.plan2star)
self.nPlans = len(self.plan2star)
# sample all of the orbital and physical parameters
self.I, self.O, self.w = PPop.gen_angles(
self.nPlans,
commonSystemPlane=self.commonSystemPlane,
commonSystemPlaneParams=self.commonSystemPlaneParams,
)
self.setup_system_planes()
self.a, self.e, self.p, self.Rp = PPop.gen_plan_params(self.nPlans)
if PPop.scaleOrbits:
self.a *= np.sqrt(TL.L[self.plan2star])
self.gen_M0() # initial mean anomaly
self.Mp = PPop.MfromRp(self.Rp) # mass
self.phiIndex = np.asarray(
[]
) # Used to switch select specific phase function for each planet
ZL = self.ZodiacalLight
if self.fixed_nEZ_val is not None:
self.nEZ = np.ones((self.nPlans,)) * self.fixed_nEZ_val
elif self.commonSystemnEZ:
# Assign the same nEZ to all planets in the system
self.nEZ = ZL.gen_systemnEZ(TL.nStars)[self.plan2star]
else:
# Assign a unique nEZ to each planet
self.nEZ = ZL.gen_systemnEZ(self.nPlans)