Repository navigation
Say how to measure a PSF in AGENTS.md - #69
Merged
Merged
Conversation
Four of the six fitters need a PSF model before they run, and the file only had a two sentence stub about it. doc/source/analysis.rst already has the step by step, so this is the layer above: which tool produces which model, and the parts that are easy to get wrong. The one that reframes the task is that there is no phase retrieval here. make_pupil_fn.py and make_psf_from_pf.py build from Zernike coefficients you supply and never read bead data, so "measure the pupil function from my bead stack" is not a thing any tool does, and an agent can otherwise spend a long time looking for it. The rest are traps checked against the tree: aoi_size is a half width, the AOI border is assumed to be background and is subtracted, z_range defaults differ between tools that look interchangeable, pixel_size is microns here and nanometres in the analysis XML, make_pupil_fn takes no optics at all, geo_sim_pf silently halves the pixel size, pfZernikeRad is unnormalized so a coefficient is not an rms wavefront error, and aberration() does not go to 1 as depth goes to 0. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Four of the six fitters need a PSF model before they will run, and
AGENTS.mdonly had a two sentence stub about it.doc/source/analysis.rstalready has the step by step for both measurement paths, so this is the layer above it: which tool produces which model, and the parts that are easy to get wrong.The one that reframes the task is that there is no phase retrieval in this tree.
make_pupil_fn.pyandmake_psf_from_pf.pybuild from Zernike coefficients you supply and never read bead data, so "measure the pupil function from my bead stack" is not something any tool here does. An agent can otherwise spend a long time looking for it.The rest are traps, each checked against the tree rather than remembered:
aoi_sizeis a half width, so the default 12 gives a 24 pixel AOI.z_rangedefaults differ between tools that look interchangeable: 0.6 um inmeasure_psf_beads.py, 0.75 um in the other two.pixel_sizeis microns here and nanometres in the analysis XML, and both defaults are plausible.make_pupil_fn.pytakes no optics at all: wavelength, index and NA are module globals insimulator/psf.py.geo_sim_pfdefaults to True and silently halves the pixel size viaGeometrySim.pfZernikeRadreturns the unnormalized radial polynomial, so a coefficient is not an rms wavefront error.Geometry.aberration()does not go to 1 as depth goes to 0, so gating it ondepth > 0puts a step in anything you are optimizing.No code changes;
AGENTS.mdonly, 216 to 311 lines.