Repository navigation
Docstring for API documentation + purity PIE for z and wavelength calibration - #120
Conversation
…sues: external initialization
… exact same initialization of each z.
…/PtyLab.py into Add_purity_axial_scan
…arison - add fixed and adaptive wavelength calibration - add local quadratic fitting of purity scan maxima - store and plot reconstruction error alongside probe purity - unify scan plotting for z and wavelength calibration - update the example script for selectable z or wavelength calibration
minor change in reconstruction.py: the old style np.int.
1. OPR engine documentation 2. remove redundant multiPIE engine, added a wrapper in mPIE. 3. add test for the wrapper. 4. minor change of pytest name.
| # map a change in positions to a change in z. Experimental, do not use | ||
| self.map_position_to_z_change = False | ||
|
|
||
| # purity based Zscan |
There was a problem hiding this comment.
Isn't the purityPIE part of the other PR? @cliulucien
There was a problem hiding this comment.
yes, this one only for the documentation. I merged that purityPIE to this branch earlier
There was a problem hiding this comment.
Generally, it is not a good idea to add things that logically belong to another PR. This PR should focus only on exactly what it is doing here. If you absolutely need things from that another branch/PR then you could either add only those things here or cherry-pick commit (a bit annoying to work with though) or simply put a specific PR in draft and let the other one merge first and then you sync this particular branch/PR with main.
There was a problem hiding this comment.
Yeah this file (3K lines) does not belong in this PR for instance. I will merge the other PR first.
…ment, instead either explicit path if specified or simple input() command
…ely if it is not bell shaped which is a complete and total possibility
…ot a parameter per say
… evaluating left and right; previously it always concluded no improvements
… so now independent runs give identical values of z
|
A gif to show the updates happen live with iterations and in the last one, highlights the result and also get stored as a png if you pass
@cliulucien could you please validate once with your dataset and tell me how it is. Then we can merge this PR. |
|
@cliulucien I will close the other PR #118 and just merge this one after you validate with your dataset. The two have drifted and doesn't make sense to spend time and fix the other one. But in general please keep separate PRs for separate things and store one in draft if the other one is waiting to merge |
|
Nice. LGTM! |




Summary
This PR improves the documentation and organization of the PtyLab reconstruction engines.
The main goal is to make the engine API easier to understand by documenting the underlying reconstruction strategies, clarifying engine-specific parameters and update rules, and reducing duplicated legacy implementations.
Main changes
Engine documentation
Expanded and revised docstrings for the reconstruction engines, including:
purityPIEaPIEe3PIEOPRqNewtonmqNewtonLegacy engine cleanup
multiPIEhas been consolidated intomPIE.Mixed-state reconstruction is already supported through the general
reconstruction dimensions such as:
reconstruction.npsmreconstruction.nosmreconstruction.nlambdaThe former
multiPIEimplementation largely duplicated the regularizedobject/probe updates and momentum scheme already available in
mPIE.A backward-compatible
multiPIEwrapper is retained so that existing codeusing
Engines.multiPIEcontinues to work while emitting a deprecationwarning.
Legacy parameter aliases are preserved:
betaM->feedbackMstepM->frictionMTests
Added tests for the deprecated
multiPIEwrapper, including:mPIEEngines.multiPIEThe
purityPIEadaptive and fixed calibration logic is also covered bytests using synthetic objective functions without running full
ptychographic reconstructions.
Notes / follow-up work
During the documentation pass, several implementation details were identified
that should be handled separately and are now mentioned in different issues.
% EDIT (Shantanu): Moved those specific implementation questions and such to github issues to better track and follow-up.