Skip to content

PSF interpolation order - #950

Merged
oczoske merged 5 commits into
mainfrom
oc/lms_cubic_interpolation
Jul 13, 2026
Merged

PSF interpolation order#950
oczoske merged 5 commits into
mainfrom
oc/lms_cubic_interpolation

Conversation

@oczoske

Copy link
Copy Markdown
Collaborator

This PR reverts the interpolation method used for the PSF back from RegularGridInterpolator to RectBivariateSpline. The appeal of RegularGridInterpolator was the availability of the pchip method, which however turns out to be not usable for 2D interpolation (excessive memory requirement). RectBivariateSpline is faster.

From a user perspective, the PSF interpolation methods opens up the interpolation order as a user-settable parameter, !SIM.psf.interp_order. For consistency, we also define !SIM.psf.interp_psf (formerly !OBS.interp_psf) to control whether the PSF is scaled to each wavelength slice of a spectral cube or just once to the central wavelength.

@oczoskeoczoske self-assigned this Jul 5, 2026
@oczoskeoczoske added enhancement PR adding or improving a feature (use "Feature" type for issues (requests), not this label) API How users interact with the software effects Related to a ScopeSim effect performance Execution speed or memory consumtion labels Jul 5, 2026
@oczoskeoczoske moved this to 🏗 In progress in ScopeSim-developmentJul 5, 2026
@codecov

codecovBot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 52.38095% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.60%. Comparing base (06a2d0d) to head (b190dfd).
⚠️ Report is 8 commits behind head on main.

Files with missing linesPatch %Lines
scopesim/effects/psfs/discrete.py52.38%10 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@## main #950 +/- ##
==========================================
+ Coverage 75.18% 75.60% +0.42% 
==========================================
Files 70 70 Lines 9025 8981 -44 ==========================================
+ Hits 6785 6790 +5 + Misses 2240 2191 -49 

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

@oczoske
oczoskeforce-pushed the oc/lms_cubic_interpolation branch from ecdeddd to 01be691CompareJuly 7, 2026 14:16
@oczoske
oczoske marked this pull request as ready for review July 7, 2026 14:47
@oczoske
oczoske requested a review from teutoburgJuly 7, 2026 14:47
@oczoskeoczoske moved this from 🏗 In progress to 👀 Awaiting Review in ScopeSim-developmentJul 7, 2026
teutoburg
teutoburg previously approved these changes Jul 7, 2026

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

A few comments about x and y, but I assume you made sure those are correct, so the comments are more for me to understand.

Comment threadscopesim/effects/psfs/discrete.py Outdated
Comment threadscopesim/effects/psfs/discrete.py Outdated
Comment threadscopesim/effects/psfs/discrete.py Outdated
Comment threadscopesim/effects/psfs/discrete.py Outdated
@oczoske
oczoske dismissed teutoburg’s stale reviewJuly 8, 2026 10:21

The indexing issue needs more work. The current implementation seems to produce a 90 degree rotation of the PSF.

@oczoske

Copy link
Copy Markdown
CollaboratorAuthor

I've checked the coordinate order and made some adjustments. It should be consistent now. Have a look at the attached notebook, too.
Interpolation_coord_order.ipynb

@oczoske
oczoske requested a review from teutoburgJuly 8, 2026 13:02
@teutoburg

Copy link
Copy Markdown
Contributor

I've checked the coordinate order and made some adjustments. It should be consistent now. Have a look at the attached notebook, too. Interpolation_coord_order.ipynb

The notebook fails with No such file or directory: '/home/oczoske/ELT_Development/irdb/METIS/PSF_LM_9mag_06seeing.fits'...

@oczoske

Copy link
Copy Markdown
CollaboratorAuthor

The notebook is not meant for publication, so just adapt the path. Sorry for the inconvenience.

@oczoske
oczoske merged commit e790c94 into mainJul 13, 2026
25 of 26 checks passed
@oczoske
oczoske deleted the oc/lms_cubic_interpolation branch July 13, 2026 06:57
@github-project-automationgithub-project-automationBot moved this from 👀 Awaiting Review to ✅ Done in ScopeSim-developmentJul 13, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

APIHow users interact with the softwareeffectsRelated to a ScopeSim effectenhancementPR adding or improving a feature (use "Feature" type for issues (requests), not this label)performanceExecution speed or memory consumtion

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants

@oczoske@teutoburg