Skip to content

Generic TipTopPSF class for generating then caching PSFs from the UniVie tiptop server - #992

Draft
astronomyk wants to merge 2 commits into
mainfrom
kl/tiptop-psf
Draft

Generic TipTopPSF class for generating then caching PSFs from the UniVie tiptop server#992
astronomyk wants to merge 2 commits into
mainfrom
kl/tiptop-psf

Conversation

@astronomyk

Copy link
Copy Markdown
Collaborator

Obviously geCluadet, but it seems to do what it claims. I've read every line of code and nothing jumped out as obviously wrong. According to the report, it stress tested also the METIS and MICADO/MORFEO cases, and found a work-around for the bug with the MORFEO ini files (doesn't like the Focuser keywords...)

The result is a new FieldConstantPSF effect that calls the TIPTOP server, and saves the file to disk for later re-use. This doubles the caching, as the tiptop-on-zeus server also caches any PSF it generates. An example of the IRDB effect yamle ntry is:

- name: mavis_tiptop_psf
  class: TipTopPSF
  kwargs:
    instrument: MAVIS               # tiptop_ipy template
    filter_name: "!OBS.filter_name" # one cached PSF per band
    wave_dict: {u: 0.356, B: 0.426, g: 0.470, V: 0.545, r_SDSS: 0.618,
                R: 0.641, i_SDSS: 0.749, I: 0.798, z: 0.895}
    fov_pix: 1024                   # clipped to 1024 max
    pixel_scale: 0.00368            # arcsec; Nyquist for 7.36 mas pixels
    cache_dir: "./tiptop_psf_cache"

I plan to play around with it in a notebook today and then let you know if I find any obvious bugs

astronomyk and others added 2 commits August 24, 2026 17:52
New PSF effect that queries the TipTop AO simulator (via tiptop_ipy,
default server: University of Vienna) for an on-axis AO PSF and caches
the result on disk. Each unique configuration (instrument ini +
wavelength + grid) costs exactly one server call, ever. With
wave_dict + filter_name (e.g. '!OBS.filter_name'), an imager generates
one PSF per filter band, at most 1024x1024 pixels.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…emplate

- filter_name alone now resolves the effective wavelength through the
  SVO filter service: generic band names (V, J, Ks, ...) via
  FILTER_DEFAULTS, or fully qualified SVO ids (Paranal/HAWKI.Ks).
  wavelength accepts a filter-name string too. wave_dict remains the
  explicit override for instrument-specific filter names.
- overrides can now remove keys ({key: null}) and whole sections
  ({section: null}) from the TipTop config, needed e.g. for MORFEO.
- Server-side failures are re-raised with the offending configuration
  and a hint about grid limits.
- Docstring examples for METIS SCAO, MICADO SCAO and MORFEO MCAO, all
  validated live against the Vienna server:
    METIS  Lp 3.79um @ 5.47mas: Strehl 0.87 (finer grids are rejected
           server-side; detector scale still oversamples lambda/2D)
    MICADO Ks 2.19um @ 2mas:    Strehl 0.66
    MORFEO Ks 2.19um @ 2mas:    Strehl 0.65 (needs glFocusOnNGS: False
           + Focus sections removed; stock template crashes TIPTOP 1.4.0)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 15.15152% with 168 lines in your changes missing coverage. Please review.
✅ Project coverage is 29.15%. Comparing base (e386ea5) to head (c66624d).
⚠️ Report is 81 commits behind head on main.

Files with missing lines Patch % Lines
scopesim/effects/psfs/tiptop.py 14.72% 168 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (e386ea5) and HEAD (c66624d). Click for more details.

HEAD has 174 uploads less than BASE
Flag BASE (e386ea5) HEAD (c66624d)
176 2
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #992       +/-   ##
===========================================
- Coverage   75.17%   29.15%   -46.03%     
===========================================
  Files          70       68        -2     
  Lines        9024     9062       +38     
===========================================
- Hits         6784     2642     -4142     
- Misses       2240     6420     +4180     

☔ View full report in Codecov by Harness.
📢 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.

@astronomyk
astronomyk removed the request for review from teutoburg August 25, 2026 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant