"""Shared paths, constants and small helpers for the mdwarf_early study.""" import os import numpy as np CODE_DIR = os.path.dirname(os.path.abspath(__file__)) STUDY_DIR = os.path.dirname(CODE_DIR) DATA_DIR = os.path.join(STUDY_DIR, "data") FIG_DIR = os.path.join(STUDY_DIR, "figures") RAW_DIR = os.environ.get("FERMI_RAW", "fermi_raw/mdwarf_early") for d in (DATA_DIR, FIG_DIR, RAW_DIR): os.makedirs(d, exist_ok=True) SEED = 20261011 V_ESC_EARTH = 11.186 # km/s T0_GYR = 13.79 # age of the Universe today (Planck 2018) M_DWARF_MAX_MASS = 0.60 # Msun; boundary used for "M dwarf" in the earliness model A_EARTH_GYR = 4.54 # age of the Earth when a technological civilisation appeared # Floor ("lapse rate") on any extrapolated retention probability. The logistic tail of the fitted # shoreline reaches 1e-10 ... 1e-59 for late-M hosts; with no decisive habitable-zone verdict and # 14 airless verdicts in total, the data cannot support a retention probability below ~0.1 for any # class of planet, so such tails are a property of the functional form, not of the data. We mix the # logistic with a constant: f_eff = eps + (1 - eps) f. Default eps = 1e-3; 0 and 1e-2 are run as # sensitivities (referee point 5). F_ATM_FLOOR = 1.0e-3 # Flat LCDM (Planck 2018) H0 = 67.4 # km/s/Mpc OMEGA_M = 0.315 OMEGA_L = 1.0 - OMEGA_M H0_PER_GYR = H0 * 1.0227e-3 # 1 km/s/Mpc = 1.0227e-3 / Gyr def rocky_mass_from_radius(r_earth): """Earth-like-composition mass-radius relation, R = M^0.27 (Zeng et al. 2016 approx.).""" return np.asarray(r_earth, dtype=float) ** (1.0 / 0.27) def teq_from_insolation(s_earth): """Zero-albedo, full-redistribution equilibrium temperature [K].""" return 278.5 * np.asarray(s_earth, dtype=float) ** 0.25