Skip to content

Add hubble_ultra_deep_field() Source template#183

Draft
astronomyk wants to merge 1 commit into
mainfrom
kl/hudf_template
Draft

Add hubble_ultra_deep_field() Source template#183
astronomyk wants to merge 1 commit into
mainfrom
kl/hudf_template

Conversation

@astronomyk
Copy link
Copy Markdown
Contributor

@astronomyk astronomyk commented May 14, 2026

note: this is most definitely a throw-away function because it's based on the flawed use of predetermined sersic profiles. The scopesim_targets way of doing things is vastly superior. But we need to work out how to build that bridge...


Builds a single scopesim.Source aggregating thousands of Sersic-profile galaxies that mimic the HUDF: positions, sizes, Sersic indices, axis ratios, redshifts and F160W magnitudes come from a vendored cross-match of Skelton+2014 (3D-HST, J/ApJS/214/24) with van der Wel+2012 H-band GALFIT fits (J/ApJS/203/24), trimmed to a 2-arcmin cone around the HUDF centre and m_F160W < 28.

Per-galaxy SEDs are assigned by a Sersic-index cut (n > 2.5 -> early, defaulting to Brown+2014 NGC0584; else late-type, defaulting to NGC4254). Each row is rendered via the existing
extragalactic.galaxy() function; sub-sources are summed into one Source.

  • scopesim_templates/extragalactic/deep_field.py: public API.
  • scopesim_templates/extragalactic/_make_hudf_catalogue.py: off-tree Vizier ingest + cross-match + trim script that produced the vendored FITS (re-run only to refresh the data).
  • scopesim_templates/extragalactic/data/hudf_catalogue.fits: vendored 2378-row catalogue (168 kB).
  • scopesim_templates/tests/test_extragalactic/test_deep_field.py: 7 webtest-marked tests covering Source return, counts, FOV cuts, early/late split, amplitude pass-through, mag limit, custom path.
  • scopesim_templates/tests/test_extragalactic/data/toy_hudf.fits: 3-row fixture used by all tests so they don't depend on the full catalogue.
  • scopesim_templates/tests/visual_inspection/plot_hubble_ultra_deep_field.py
    • hubble_ultra_deep_field.png: visual-inspection script that paints the per-galaxy stamps onto a shared WCS-aligned canvas, scaled by 10^(-0.4*mag), and the baseline PNG it produces.
  • .gitignore: carve-out exceptions for the new data/ directories.

Builds a single scopesim.Source aggregating thousands of Sersic-profile
galaxies that mimic the HUDF: positions, sizes, Sersic indices, axis
ratios, redshifts and F160W magnitudes come from a vendored cross-match
of Skelton+2014 (3D-HST, J/ApJS/214/24) with van der Wel+2012 H-band
GALFIT fits (J/ApJS/203/24), trimmed to a 2-arcmin cone around the HUDF
centre and m_F160W < 28.

Per-galaxy SEDs are assigned by a Sersic-index cut (n > 2.5 -> early,
defaulting to Brown+2014 NGC0584; else late-type, defaulting to
NGC4254). Each row is rendered via the existing
extragalactic.galaxy() function; sub-sources are summed into one
Source.

- scopesim_templates/extragalactic/deep_field.py: public API.
- scopesim_templates/extragalactic/_make_hudf_catalogue.py: off-tree
  Vizier ingest + cross-match + trim script that produced the vendored
  FITS (re-run only to refresh the data).
- scopesim_templates/extragalactic/data/hudf_catalogue.fits: vendored
  2378-row catalogue (168 kB).
- scopesim_templates/tests/test_extragalactic/test_deep_field.py:
  7 webtest-marked tests covering Source return, counts, FOV cuts,
  early/late split, amplitude pass-through, mag limit, custom path.
- scopesim_templates/tests/test_extragalactic/data/toy_hudf.fits: 3-row
  fixture used by all tests so they don't depend on the full catalogue.
- scopesim_templates/tests/visual_inspection/plot_hubble_ultra_deep_field.py
  + hubble_ultra_deep_field.png: visual-inspection script that paints
  the per-galaxy stamps onto a shared WCS-aligned canvas, scaled by
  10^(-0.4*mag), and the baseline PNG it produces.
- .gitignore: carve-out exceptions for the new data/ directories.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

❌ Patch coverage is 47.00855% with 62 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.15%. Comparing base (f08fb1d) to head (d2987cf).

Files with missing lines Patch % Lines
...im_templates/extragalactic/_make_hudf_catalogue.py 18.66% 61 Missing ⚠️
scopesim_templates/extragalactic/deep_field.py 97.50% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #183      +/-   ##
==========================================
- Coverage   77.09%   75.15%   -1.94%     
==========================================
  Files          34       36       +2     
  Lines        1698     1815     +117     
==========================================
+ Hits         1309     1364      +55     
- Misses        389      451      +62     

☔ 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 changed the title Add hubble_ultra_deep_field() Source template Add hubble_ultra_deep_field() Source template May 15, 2026
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.

1 participant