Hi all,

I am pleased to announce the release of Weighted Batch Preprocessing version 2.9.0 which introduces a highly requested feature: the Frame Selection Step. This new capability allows you to analyze, visualize, and select the best frames before integration using objective metrics such as FWHM, eccentricity, PSF Signal Weight, and more, with the ability to define custom formulas for personalized selection criteria.

Table of Contents
  1. The New Frame Selection Step
  2. The Frame Selection Dialog
  3. The Groups Table
  4. The Frames Table
  5. Metric Charts
  6. The 6 Filter Metrics
  7. The Filter System
  8. Custom Formulas
  9. Image Preview
  10. Pipeline Integration
  11. Logging and Diagnostics
  12. Other Improvements and Bug Fixes
  13. Conclusions



1. The New Frame Selection Step

Activation and Basic Configuration

The Frame Selection feature is accessible from the LIGHTS page in the WBPP interface.
01-frames-selection-activation.png

To enable it:
  1. Check the Frame Selection checkbox
  2. Choose the operating mode with the Interactive checkbox
  3. Click Settings to configure default rejection criteria

    02-defaults.png
Two Operating Modes

Interactive Mode

When Interactive mode is enabled:
  • A dedicated dialog opens after the measurement phase
  • All frames are displayed with their measured metrics
  • You can adjust thresholds in real-time and see immediate results
  • Built-in image preview for visual inspection
  • Manual frame disabling for edge cases
Automatic Mode
When Interactive mode is disabled:
  • The script automatically applies the criteria configured in Settings
  • No user interaction required
  • Perfect for automated pipelines or overnight batch processing
  • Uses the default filter configuration you've previously set up



2. The Frame Selection Dialog
03. Frame Selection.png

The Frame Selection dialog is organized into two main sections:
Layout Overview
  • Upper section (~45% height): Groups/frames tables on the left, filter panel on the right
  • Lower section (~55% height): 2×3 grid of metric charts
The dialog is responsive and adapts to high-resolution displays (4K/5K), using 60-90% of available screen space.



3. The Groups Table

04. Groups Table.png


The Groups table displays all available light frame groups, organized by filter, exposure, or other grouping criteria.

Group: Group identifier (filter name, exposure, etc.)
Frames: Total number of frames in the group
Rejected: Number of frames rejected by filters
Disabled: Number of manually disabled frames

Selecting a group loads its frames into the Frames table and updates all charts accordingly. Each group maintains its own independent filter configuration.



4. The Frames Table

05. Frames Table.png


The Frames table shows all frames in the currently selected group with their measured metrics.

#: Sequential frame number
Status: Visual icon indicating state (accepted/rejected/disabled)
File name: Frame filename (tooltip shows full path)
FWHM: Full Width at Half Maximum in pixels
Eccentricity: Star shape metric (0 = perfectly round)
PSFSW: PSF Signal Weight (normalized 0-1 per group)
Median: Median pixel value
Stars: Number of detected stars
Custom: Result of custom formula (if defined)

Visual Styling
  • Rejected frames: Red text color
  • Disabled frames: Gray italic text
  • Sort indicator: ▼ symbol on the sorted column header
Double-click on any frame to open the Image Preview dialog.



5. Metric Charts

06. Metric Chart.png

The lower section displays six interactive charts, one for each filter metric.

Chart Elements

Each chart displays:
  • Vertical bars: One bar per frame
    • Blue: Accepted frame
    • Red: Rejected frame
    • Orange highlight: Currently selected frame
  • Threshold line (dashed orange): Filter threshold with shaded rejection zone
  • Mean line (green): Average value of accepted frames only
Interactive Features

07. Interactive Features.png

  • Click on bar: Selects the corresponding frame in the table
  • Sort button: Sorts all frames by this metric



6. Available Metrics

WBPP 2.9.0 provides six metrics for frame evaluation:

MetricDescription
FWHMFull Width at Half Maximum
EccentricityStar elongation
PSF Signal WeightPSF signal metric (normalized 0-1 per group)
MedianMedian pixel value
StarsNumber of detected stars
CustomUser-defined formula

Note: SNR (Signal-to-Noise Ratio) is computed during measurements and is available for use in custom formulas only. It cannot be used as a standalone filter criterion.



7. The Filter System

Each group maintains its own independent filter configuration. When you select a group in the Groups table, the filter panel displays and edits the rejection criteria for that specific group. This allows you to apply different quality thresholds to different filters or imaging conditions—for example, stricter FWHM limits for luminance data versus narrowband channels.

08. Rejection Filters.png


Configuring a Filter
Each metric filter includes:
  • Enable checkbox: Activates/deactivates the filter
  • Comparison mode: `<` (less than) or `>` (greater than)
  • Threshold value: Numeric cutoff value
  • Import button: Copies the value from the selected frame

Rejection Logic
  • < mode: Frame is REJECTED if value >= threshold
  • > mode: Frame is REJECTED if value <= threshold
Example: If FWHM filter is set to "< 3.5", any frame with FWHM ≥ 3.5 will be rejected.

Import a value from the Selected Frame

09. Rejection Value Import.png


A powerful workflow feature:
Select a frame of acceptable quality in the table, then click the Import button on any filter. The selected frame's value for that metric becomes the new threshold.
This allows you to use a "reference frame" approach: find a frame that represents your minimum acceptable quality, then import its values as thresholds.



8. Custom Formulas

Custom formulas allow you to create composite metrics by combining multiple measurements.

Available Variables
All variable names are **case-insensitive**:
  • `FWHM` - Full Width at Half Maximum
  • `Eccentricity` - Star elongation
  • `SNR` - Signal-to-Noise Ratio
  • `PSFSignalWeight` - PSF signal weight estimator of image quality
  • `Median` - Median pixel value
  • `Stars` - Number of detected stars
Supported Functions
  • Arithmetic: `+ - * / %`
  • Powers: `Math.pow(x, n)`, `Math.sqrt(x)`
  • Logarithms: `Math.log(x)`, `Math.log10(x)`
  • Trigonometry: `Math.sin(x)`, `Math.cos(x)`, etc.
  • Min/Max**: `Math.min(a, b)`, `Math.max(a, b)`
Real-Time Validation
  • Formulas are validated automatically as you type
  • Visual feedback: ✓ green indicator (valid) or ✗ red indicator (invalid)
  • If invalid, the Custom chart displays a placeholder message

formula_1.png
formula_2.png
Example of wrong syntax in the formula​
Example of correct syntax in the formula​



9. Image Preview
ImagePreview.png

Double-clicking any frame in the table opens the Image Preview dialog for visual inspection.

Features
  • Zoom In/Out: Increase/decrease magnification
  • Zoom 1:1: Pixel-perfect view
  • Fit to Window: Scale image to fit viewport
  • STF Toggle: Switch between stretched and linear view
  • Reset: Return to STF + fit to window
Navigation
  • Mouse drag: Pan across large images
  • Scroll wheel: Zoom centered on cursor position
  • Cursor feedback: Open/closed hand indicates pan mode
This feature is invaluable for inspecting borderline frames—checking for satellites, aircraft trails, tracking errors, or other issues that metrics alone might not catch.



10. Pipeline Integration

Frame Selection integrates into the WBPP pipeline after measurements:
03-frame-selection-pipeline-step.png
**Important**: Measurements must be enabled for Frame Selection to work. The script automatically enables measurements when Frame Selection is activated.



11. Logging and Diagnostics

Frame Selection produces detailed console output:

Code:
═══════════════════════════════════════════════════════════
* Interactive frame selection
═══════════════════════════════════════════════════════════
  Processing group: L (45 frames)
  Rejected: M31_L_001.xisf
  Rejected: M31_L_023.xisf
  Processing group: R (42 frames)
  Rejected: M31_R_012.xisf
  Processing group: G (42 frames)
  Processing group: B (41 frames)
* End of frame selection
  Total frames: 170
  Rejected: 3
═══════════════════════════════════════════════════════════

The Process Logger also records:
  • Total frames processed per group
  • Individual rejected frame names
  • Success/warning messages
  • Final rejection statistics



12. Other Improvements and Bug Fixes

Automation Mode Enhancements

  • Automation Help Shortcut: Press Ctrl+A to display comprehensive automation help directly within the WBPP interface, making it easier to discover and use automation parameters
Minor UI Adjustments
  • Label adjustments throughout the interface for improved clarity and consistency
Bug Fixes
  • Custom filter name propagation**: Fixed propagation of custom filter names to generated master files



13. Conclusions

The Frame Selection Step represents a significant advancement for WBPP: for users who previously relied on SubframeSelector or external scripts for frame selection, this integrated feature significantly simplifies the workflow while maintaining a similar level of control. Everything is now contained within a single, cohesive interface that fits naturally into the WBPP pipeline.