Code cleanup - #18
Open
wtgee wants to merge 12 commits into
Open
Conversation
* Add the `boxSize` and `halfBox` size to the config defaults.
…getParams()` function in `centroid.py` to reduce code duplication and centralize configuration reading. - Refactored `AgccCmd.py` to use a single `reloadParams()` method for both `setCentroidParams` and `setImageParams` commands, simplifying the command handler logic. - Updated all internal callers, test fixtures, and analysis scripts to use the new `getParams()` API. - Maintained backward compatibility for the `setCentroidParams` and `setImageParams` tron commands.
…e duplication. * Add logging statements to centroiding.
… line before could probably be eliminated but I'm leaning them now
…lParams` to match
* Some variable name cleanup.
Test Coverage
|
Better coverage of tests in multi-threaded.
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.
Walkthrough — Refactoring Cleanup
Changes Made
agccActor
centroid.py
half_regionswith slices for both halves of the detector and processed them in a singleforloop to extract spots and backgrounds.resultstructured array via dynamic slicing withstart_idxandend_idxinside the loop, avoiding hardcoded0:nSpots1andnSpots1:nElemindices.satValuearray usingnp.concatenateandnp.repeat.tempDatausing a loop overhalf_regionsand the extracted backgrounds.resultin place if the moment converged (conv == 0), eliminating the need for temporary list allocations (m20,m02,m11,flags).result["flags"][i] & 1toresult["flags"][i] & SourceDetectionFlag.RIGHTfor clarity.logger.infostatements at the beginning of the centroiding process (indicating the camera, threshold, and min area), per-region spot detection counts including background median and standard deviation, overall spot detection counts, and the number of spots failing FWHM moment convergence.AgccCmd.py
parseCameras: Created a centralized helper method to parse the optionalcamerascommand keyword. It returns a list of 0-indexed camera indices or defaults to either the running cameras (ifdefaultToRunning=Trueis passed) or all cameras.shutterOps,expose,abort,setframe,resetframe,setmode,getmode, andsettemperature) to useparseCameras, removing all redundantif cams is Nonecheck blocks.cmdKeysvariable assignments that became unused after refactoring.