Skip to content

Conversation

@oczoske
Copy link
Collaborator

@oczoske oczoske commented Sep 17, 2025

This fixes #797 .

  • The interpolator has been changed from RectBilinearSpline to RegularGridInterpolator. While the interface is more cumbersome it has better support for extrapolation - here we need fill_value=0. We still use linear interpolation but might consider using pchip; tests are needed.
  • The spatial size of the scaled PSF cube is at most twice the slit size (ensures full coverage of the slit by the psf), otherwise it takes the size of the input PSF image. This can be further reduced by setting the parameter cmd["!SIM.computing.psf_maxsize"]; this can be done to improve computation speed at the expense of accuracy.

@oczoske oczoske self-assigned this Sep 17, 2025
@oczoske oczoske added bugfix PR resolving one or more bugs (use "Bug" type for issues, not this label) spectroscopy Related to spectroscopic modes labels Sep 17, 2025
@oczoske oczoske added this to the Vienna ELT Conference 2 milestone Sep 17, 2025
@codecov
Copy link

codecov bot commented Sep 17, 2025

Codecov Report

❌ Patch coverage is 14.28571% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.88%. Comparing base (e161381) to head (f61afe8).
⚠️ Report is 146 commits behind head on main.

Files with missing lines Patch % Lines
scopesim/effects/psfs/discrete.py 14.28% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #798      +/-   ##
==========================================
+ Coverage   74.86%   74.88%   +0.01%     
==========================================
  Files          69       69              
  Lines        8627     8628       +1     
==========================================
+ Hits         6459     6461       +2     
+ Misses       2168     2167       -1     

☔ 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.

@oczoske oczoske moved this to 🏗 In progress in ScopeSim-development Sep 17, 2025
@teutoburg teutoburg changed the title Use RegularGridInterpolator for proper extrapolation of small psf images Use RegularGridInterpolator for proper extrapolation of small PSF images Sep 17, 2025
@teutoburg
Copy link
Contributor

Do we know how this compares in terms of performance? The previous RectBilinearSpline always came up in profiling, so it would be interesting if RegularGridInterpolator is any better or worse, or in the same ballpark. I'm fine with a slightly worse performance if the tradeoff is (much) better extrapolation and thus more accurate results, but if it's something like an order of magnitude worse, we'd have to consider alternatives. If it turns out it actually improves performance, all the better!

@oczoske oczoske marked this pull request as ready for review September 19, 2025 14:59
@teutoburg teutoburg moved this from 🏗 In progress to 👀 Awaiting Review in ScopeSim-development Sep 19, 2025
@oczoske oczoske merged commit 8a68cc2 into main Sep 20, 2025
29 of 30 checks passed
@oczoske oczoske deleted the oc/fix_cube_psf branch September 20, 2025 14:11
@github-project-automation github-project-automation bot moved this from 👀 Awaiting Review to ✅ Done in ScopeSim-development Sep 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix PR resolving one or more bugs (use "Bug" type for issues, not this label) spectroscopy Related to spectroscopic modes

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

PSF cube in MICADO spectroscopy has undesirable features

4 participants