Skip to content

Changes following CMC runs - #5

Open
12roses wants to merge 2 commits into
elenagonzalez870:masterfrom
12roses:master
Open

12roses wants to merge 2 commits into
elenagonzalez870:masterfrom
12roses:master

Conversation

@12roses

@12roses 12roses commented Sep 6, 2026

Copy link
Copy Markdown

Removed line of code causing crashes for stars that don't reach TAMS and/or not included in the POSYDON grid (min track mass is 0.1 Msun). Also added a helper to scale lifetimes to the equivalent POSYDON lifetime for collAIder predictions.
Modified the shared POSYDON track lookup used by StellarRadiusEstimator and convert_fractional_age into helper functions.

…within

the POSYDON grid (min track mass is 0.1 Msun). Also added a helper to scale
lifetimes to the equivalent POSYDON lifetime for collAIder predictions.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new mass-track selection can pass duplicate xp values into np.interp at the grid bounds, which can yield NaNs when target_mass equals the min/max track mass.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates the encounter physics utilities to better support collAIder predictions by adding a helper that converts a main-sequence fractional age into a physical age using POSYDON v2 TAMS lifetimes, including a fallback for the lowest-mass tracks that don’t reach the central-H threshold within the grid history.

Changes:

  • Added convert_fractional_age() to map fractional main-sequence age → physical age (Gyr) via POSYDON v2 TAMS lifetimes.
  • Added fallback behavior for tracks that never reach central H < 1e-5 (use last history age).
File summaries
File Description
src/encounter_physics.py Adds a lifetime-scaling helper based on POSYDON v2 TAMS ages (with a low-mass fallback).
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/encounter_physics.py Outdated
Comment on lines +108 to +113
if target_mass <= masses.min():
matches = np.argmin(masses), np.argmin(masses)
elif target_mass >= masses.max():
matches = np.argmax(masses), np.argmax(masses)
else:
matches = np.argsort(np.abs(masses - target_mass))[:2]
Comment thread src/encounter_physics.py Outdated
Comment on lines +128 to +129
tams_age = ages[-1] # if never reach 10^-5 central H,use the last age. This only affects the
# lowest mass stars (< 0.1137 MSun), which reach between 2*10^(-5) and 10^(-4) central H in the history
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants