Add Polychromatic MTF Support #433
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds support for calculating and plotting polychromatic Modulation Transfer Function (MTF) in the
GeometricMTFclass.Key changes:
GeometricMTFnow acceptswavelength="all"or a list of wavelengths.max_freqis now automatically determined by the shortest wavelength (highest cutoff) when calculating for multiple wavelengths._generate_mtf_datato usebe.whereand out-of-place operations, resolving aRuntimeErrorwith the PyTorch backend concerning in-place operations on leaf variables.optiland.utils.resolve_wavelengthsto robustly handle single scalar inputs, ensuring backward compatibility.Testing:
test_polychromatic_mtf_calculationto verify structure, value ranges, and frequency limits.test_single_wavelength_normalizationto ensure single-wavelength calculations remain correctly normalized (peak at 1.0) and are not incorrectly scaled by the total system weight.PR created automatically by Jules for task 6427663426429089712 started by @HarrisonKramer