spino.pipeline.phase_summary module

Phase Scheduler: Per-planet Summary Card

Renders a one-page A4 PDF with stellar / planetary / orbital / spectroscopy parameters for a single planet.

When magnitudes (J, H, K, V) or other inputs needed by the TSM/ESM calculation (Kempton et al. 2018) are missing in the NEA row, this module queries Simbad as a best-effort fallback. Fields that remain unknown after that are rendered as / rather than dropping the planet from the report.

spino.pipeline.phase_summary.fetch_simbad_mags(star_name)[source]

Query Simbad for J/H/K/V magnitudes of star_name. Missing bands → np.nan. Errors → all bands np.nan. Cached by name.

Return type:

dict[str, float]

Parameters:

star_name (str)

spino.pipeline.phase_summary.compute_tsm_esm(row, mags)[source]

Run TSM_ESM_Calculator; return its dict, or None if inputs missing.

Return type:

dict | None

Parameters:

mags (dict[str, float])

spino.pipeline.phase_summary.compute_kp(row, tsm_row=None)[source]

Planetary RV semi-amplitude K_p [km/s] from NEA row. Falls back to tsm_row['Mp_Mearth'] (Chen-Kipping estimate) when pl_bmasse is missing, and to i = 90° when pl_orbincl is missing. Returns None if period or stellar mass are unavailable.

Return type:

float | None

spino.pipeline.phase_summary.compute_scale_heights(row, tsm_row)[source]

Compute scale heights for 4 fiducial μ scenarios.

Return type:

dict | None

spino.pipeline.phase_summary.format_kp_cell(kp_kms, ecc)[source]

Text for the Kp row of the summary card.

A circular orbit shows one value. An eccentric one shows both, because the eccentricity-corrected amplitude is what the pipeline actually uses to predict the planetary trace, and a reader comparing the card against a published K_p needs to see which is which.

Return type:

str

spino.pipeline.phase_summary.save_planet_summary(row, tsm_row, sh_results, planet_dir, mags=None, geom=None)[source]

Render the per-planet summary PDF in planet_dir. Returns the path. Missing values render as /; never raises on missing data.

Return type:

str

spino.pipeline.phase_summary.compute_planet_metrics(row)[source]

Resolve mags (Simbad fallback) and compute TSM/ESM and scale heights when possible. Returns a dict:

{
    "mags":    {"J": ..., "H": ..., "K": ..., "V": ...},
    "tsm_row": <TSM_ESM_Calculator output dict or None>,
    "sh":      <scale-height dict or None>,
}

tsm_row is None when essential inputs are missing (Rp, Rs, Teff, J, K, plus Teq or a_AU). Callers can read tsm_row["TSM_above"] / ["ESM_above"] to check thresholds.

Return type:

dict

spino.pipeline.phase_summary.render_planet_summary(row, metrics, planet_dir, geom=None)[source]

Render the per-planet summary PDF using precomputed metrics (from compute_planet_metrics). Returns the output path.

Return type:

str

Parameters:
spino.pipeline.phase_summary.build_planet_summary(row, planet_dir, geom=None)[source]

Convenience wrapper: compute metrics + render in one call. Use compute_planet_metrics + render_planet_summary directly when callers need access to TSM/ESM before creating the directory.

Return type:

str

Parameters:

planet_dir (str)