Skip to content

update to support interactive flagging (setting weights to zero) - #44

Open
rvweeren wants to merge 7 commits into
tikk3r:masterfrom
rvweeren:patch-3
Open

update to support interactive flagging (setting weights to zero)#44
rvweeren wants to merge 7 commits into
tikk3r:masterfrom
rvweeren:patch-3

Conversation

@rvweeren

Copy link
Copy Markdown
Contributor

Changes to h5plot

This document summarizes the changes in to h5plot for this pull request (version 3.0.0)

Plotting modes

  • Added an NxM station-grid mode for waterfall plots.
  • Added configurable row and column spinboxes for NxM layouts.
  • Renamed the NxM action to Plot NxM stations.
  • Added navigation between NxM station groups. Previous and Next antenna actions advance by one complete grid (rows * columns) while keeping the NxM layout open.
  • Added direction and polarization navigation support to grid plots.
  • Kept the existing single-station waterfall and all-stations views.
  • Moved Plot all stations below the NxM controls.
  • Disabled the NxM row and column controls, and the waterfall-specific plot actions, when the selected axis is not waterfall.

NxM grid rendering

  • Added grid-specific plotting helpers and station-aware weight selection.
  • Added one subplot per station, with station titles and shared time/frequency labels.
  • Added a dedicated, longer colorbar axis for grid plots.
  • Adjusted GridSpec margins and spacing to prevent axis labels from colliding with tick labels.
  • Added a small amount of padding around each NxM panel so plotted data does not touch the subplot edges.
  • Preserved global value limits and phase colormap behavior in the grid view.
  • Masked values using the current weights so flagged samples are visibly removed from the plot.
  • Added safeguards for empty or invalid grid selections and for grids containing fewer stations than slots.

Region marking and flagging

  • Added region-marking controls to waterfall plots.
  • Added rectangle selectors to each NxM subplot.
  • Stored selected regions together with their station index, so regions selected on different antennas remain independent.
  • Added support for applying multiple selected regions in one flagging operation.
  • Added Flag and Flag all points actions for editable plotting modes.
  • Disabled Flag all points in NxM mode.
  • Disabled flagging controls in the all-stations view for now; NxM and single-station views remain editable.
  • Kept the Mark region toggle enabled after flagging and after plot refreshes caused by station or direction navigation.
  • Cleared completed selections and refreshed the relevant plot after a flagging operation.

HDF5 flag persistence and shared state

  • Added creation of a writable <input>_flagged.h5 copy on the first flagging operation, leaving the original source file read-only.
  • Added overwrite confirmation when the flagged output already exists.
  • Parent the overwrite dialog to the active plotting window so focus returns to that window after confirmation.
  • Added propagation of flags across the selected antennas, polarizations, and directions where requested.
  • Updated both the writable HDF5 weights and the in-memory reordered SoltabCache weights in the same operation.
  • Corrected direction selection when updating cached weights so the complete direction index selection is retained.
  • Refreshed other visible grid windows after flagging, allowing flags made in a single-station or NxM window to appear in an already-open all-stations plot.
  • Propagated antenna-specific flag changes to the corresponding station panels in other grid views.

Cache and rendering changes

  • Extended GraphWindow and GraphWindow2D to use the shared cache owned by H5PlotGUI when available.
  • Added plot refresh helpers that reload current weights before redrawing.
  • Added station-specific grid weight extraction for combinations of polarization, direction, and polarization-difference modes.
  • Added masking of invalid or zero-weight data in both single-station and grid displays.
  • Kept the existing reordered cache convention of time, frequency, antenna, optional polarization, and optional direction.

GUI and interaction changes

  • Added controls and event handlers for NxM dimensions, region selection, flagging, and navigation.
  • Added visual enable/disable state for controls that do not apply to the selected axis or plot mode.
  • Disabled grid editing in the all-stations view while retaining navigation and visualization.
  • Kept per-panel selectors inactive unless NxM mode is active and Mark region is checked.
  • Added plot-window title and refresh handling for the additional grid modes.

Compatibility and validation

  • Existing single-station time/frequency plots, waterfall plots, phase handling, polarization differences, direction selection, global limits, and weight plotting remain in the same application.

  • The local file compiles successfully with:

    singularity exec flocs7.0.5.sif python3 -m py_compile h5plot
    
  • No full automated GUI interaction test has been added. Runtime behavior still depends on the PyQt5, Matplotlib, LoSoTo, and HDF5 environment provided by the container.

Direction state consistency

Direction navigation is local to each plotting window. GraphWindow2D keeps the selected direction label in its own self.direction and derives the corresponding integer index when reading cached data. It no longer overwrites H5PlotGUI.direction, so navigating one plot window cannot silently change the direction used by the main GUI or another plot window. Previous-direction navigation also wraps explicitly to the last direction.

update to support flagging (by changing the weights in the h5) and various other improvements
Added grid_pending_regions dictionary to manage pending selections for grid plots. Updated button labels for navigation and modified region selection logic to accommodate grid plotting.
Added overwrite option for input HDF5 file handling and adjusted layout for checkboxes.
Grey out enable/disable direction buttons in case only 1 direction is present. Improve height-width dimensions when h5plot opens.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant