Skip to content

Phase 1B: Register static XES analysis steps #85

Description

@lg345

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions