Parent: #82
Scope
Port the analysis methods used in XESBatchAnalysisRotation.primary_analysis_static to the new registry as stateless, decorated step functions.
Steps to register
| Step name |
Source method |
Description |
filter_shots |
SpectroscopyAnalysis.filter_shots |
Filter shot masks by threshold on a diagnostic key |
union_shots |
SpectroscopyAnalysis.union_shots |
Combine shots across filter masks (AND logic) |
separate_shots |
SpectroscopyAnalysis.separate_shots |
Separate shots by filter exclusion (A AND NOT B) |
filter_detector_adu |
SpectroscopyAnalysis.filter_detector_adu |
Zero pixels below ADU threshold |
reduce_detector_shots |
SpectroscopyAnalysis.reduce_detector_shots |
Sum/reduce detector across shot dimension |
reduce_detector_spatial |
SpectroscopyAnalysis.reduce_detector_spatial |
Apply ROIs and reduce spatial dimension |
apply_roi |
SpectroscopyAnalysis.apply_roi |
Apply ROI mask to detector |
rotate |
wraps scipy.ndimage.rotate |
Rotate detector images by angle |
patch_pixels |
SpectroscopyAnalysis.patch_pixels |
Patch bad detector pixels |
hit_finding |
HitFinding.basic_detect |
Identify and filter on hit events |
Key changes from current implementation
- All steps become stateless: no
self.pixels_to_patch, no self.adu_cutoff. These come from YAML args.
- Steps read from and write to
run.results[key] instead of setattr(run, key, val).
- Dot-separated key convention:
union_shots on epix_ROI_1 with filters [simultaneous, laser] writes to run.results["epix_ROI_1.simultaneous_laser"].
- Steps call
run.update_status(...) for logging.
Acceptance criteria
- Each step can be called independently with a mock run object and YAML-style kwargs
- Steps produce correct output keys following dot-separated naming convention
- Status logs are written for every step execution
Parent: #82
Scope
Port the analysis methods used in
XESBatchAnalysisRotation.primary_analysis_staticto the new registry as stateless, decorated step functions.Steps to register
filter_shotsSpectroscopyAnalysis.filter_shotsunion_shotsSpectroscopyAnalysis.union_shotsseparate_shotsSpectroscopyAnalysis.separate_shotsfilter_detector_aduSpectroscopyAnalysis.filter_detector_adureduce_detector_shotsSpectroscopyAnalysis.reduce_detector_shotsreduce_detector_spatialSpectroscopyAnalysis.reduce_detector_spatialapply_roiSpectroscopyAnalysis.apply_roirotatescipy.ndimage.rotatepatch_pixelsSpectroscopyAnalysis.patch_pixelshit_findingHitFinding.basic_detectKey changes from current implementation
self.pixels_to_patch, noself.adu_cutoff. These come from YAML args.run.results[key]instead ofsetattr(run, key, val).union_shotsonepix_ROI_1with filters[simultaneous, laser]writes torun.results["epix_ROI_1.simultaneous_laser"].run.update_status(...)for logging.Acceptance criteria