Skip to content

Add galactic_centre() Source template (Gillessen+2017 orbits)#180

Merged
astronomyk merged 2 commits into
mainfrom
kl/gal_cen_stars
May 14, 2026
Merged

Add galactic_centre() Source template (Gillessen+2017 orbits)#180
astronomyk merged 2 commits into
mainfrom
kl/gal_cen_stars

Conversation

@astronomyk

Copy link
Copy Markdown
Contributor

Builds a scopesim.Source for the Sgr A* star field at a user-specified epoch. Vendors the Gillessen et al. 2017 orbital catalogue (CDS J/ApJ/837/30) and its evaluation code from the standalone gillessen script collection. Each star gets its own RV-shifted spectrum (B0V for early-type, M8III for late-type by default), scaled to its K-band magnitude through Paranal/NACO.Ks.

Builds a scopesim.Source for the Sgr A* star field at a user-specified
epoch. Vendors the Gillessen et al. 2017 orbital catalogue
(CDS J/ApJ/837/30) and its evaluation code from the standalone
`gillessen` script collection. Each star gets its own RV-shifted spectrum
(B0V for early-type, M8III for late-type by default), scaled to its
K-band magnitude through Paranal/NACO.Ks.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@astronomyk astronomyk requested a review from teutoburg May 14, 2026 19:52
@astronomyk astronomyk added enhancement New feature or request API How users interact with the software labels May 14, 2026
@codecov

codecov Bot commented May 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.32353% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.09%. Comparing base (0c240ce) to head (b044e7c).

Files with missing lines Patch % Lines
scopesim_templates/stellar/_gillessen.py 94.79% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #180      +/-   ##
==========================================
+ Coverage   75.41%   77.09%   +1.67%     
==========================================
  Files          32       34       +2     
  Lines        1562     1698     +136     
==========================================
+ Hits         1178     1309     +131     
- Misses        384      389       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@teutoburg teutoburg removed the API How users interact with the software label May 14, 2026

@teutoburg teutoburg 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.

Now, I could ask you to use Astropy SkyCoord for some of this, or be more consistent with where units are and aren't used, or to just use units instead of bothering with np.deg2rad, or complain that some of what Claude gave you there is rather YAGNI, or even whine about style. But this is Templates, aka the dumpster. Who cares if the dumpster is on fire, as long as it burn bright enough to convince someone to continue funding us 🙂

@astronomyk

Copy link
Copy Markdown
Contributor Author

Indeed. I agree with all of those statements. I might see what claude responds to your comment. Maybe it takes a long hard look at itself =)

@teutoburg

Copy link
Copy Markdown
Contributor

Don't bother wasting tokens there...

The `library` parameter only ever raised a ValueError for any non-default
value, and `catalogue` / `R0` were passthroughs that nobody would ever
override. Removing all three.

Other items teutoburg flagged but not changed here:
- SpT warn-and-default branch stays: the Gillessen catalogue legitimately
  has empty SpT cells for S39 and S55, so this isn't defensive paranoia.
- Unit-boundary round-trip (the rv strip-and-reattach) is a thing on
  downstream branches that add an rv column to the fields table, not on
  this branch alone. Will be addressed when integrating with
  globular_cluster_imbh.
- SkyCoord / np.deg2rad style preferences: declined.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@astronomyk astronomyk merged commit f08fb1d into main May 14, 2026
26 checks passed
@astronomyk astronomyk deleted the kl/gal_cen_stars branch May 14, 2026 21:22
astronomyk added a commit that referenced this pull request May 14, 2026
The strip-and-reattach round-trip for the rv column was introduced when
the rv column was added on the animation branch. Now that cluster_plots
has fast-forwarded into globular_cluster_imbh, fix it here:
- galactic_centre.py and globular_cluster.py hold rv as a Quantity from
  the moment it is computed (or pulled from the gillessen QTable)
  through to the final fields-table column. Only stripped to a plain
  float at the per-star Spextrum.redshift(vel=...) call site.

SpT mapping refresh on galactic_centre.py: switched the if/elif/else
to a dict.get() lookup; updated warning wording to "missing or
unrecognised SpT" (the Gillessen catalogue legitimately has empty
SpT cells for S39 and S55). Test regex updated to match.

YAGNI cleanup from the original review (drop library/catalogue/R0
params) is already in main via PR #180; not re-applied here.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants