PyriodGUI

PyriodGUI provides the interactive notebook interface for working with a Prewhitener object.

It manages the plots, widgets, signal table, and user interactions, while the underlying analysis state is stored by the Prewhitener.

Note that the PyriodGUI interface is designed for interactive analysis through the GUI, and changes made directly to the Prewhitener will generally not be reflected automatically by the GUI state.

PyriodGUI

Interactive Jupyter interface for a Prewhitener.

PyriodGUI provides interactive time-series and periodogram plots, signal-table editing, fitting controls, significance-threshold controls, and access to the Pyriod log. Numerical analysis and fitted state are stored in the associated Prewhitener.

Parameters:
  • prewhitener (Prewhitener) –

    Analysis object to display and manipulate.

Attributes:
  • pw (Prewhitener) –

    Underlying analysis object used by the GUI.

  • lcfig (Figure) –

    Figure containing the interactive time-series plot.

  • lcax (Axes) –

    Axes containing the interactive time-series plot.

  • perfig (Figure) –

    Figure containing the interactive periodogram plot.

  • perax (Axes) –

    Axes containing the interactive periodogram plot.

  • lc (LightCurve) –

    Convenience access to pw.lc.

  • fitvalues (DataFrame) –

    Convenience access to pw.fitvalues.

  • stagedvalues (DataFrame) –

    Convenience access to pw.stagedvalues.

Notes

The GUI operates directly on the supplied Prewhitener; it does not maintain a separate copy of the analysis state. Changes made through the GUI therefore modify pw.

The GUI assumes that analysis operations are normally performed through the interface. If pw is modified directly, call refresh_from_prewhitener() to synchronize the displayed plots, signal table, fit report, log, and other GUI state with the current Prewhitener.

The interactive Matplotlib figures require the ipympl backend, normally enabled in a Jupyter notebook with %matplotlib widget.

TimeSeries

TimeSeries()

Return the interactive time-series interface.

The interface contains the time-series plot, controls for displaying the original or residual light curve, phase-folding controls, masking controls, and figure-saving controls.

Returns

ipywidgets.Widget Widget containing the interactive time-series interface.

Raises

traitlets.TraitError If the Matplotlib canvas cannot be embedded as an ipywidget, for example when the ipympl backend is not active.

Periodogram

Periodogram()

Return the interactive periodogram interface.

The interface contains the periodogram plot, controls for selecting and staging signals, fitting the current staged solution, choosing displayed periodograms and signal markers, calculating significance thresholds, and saving the figure.

Returns

ipywidgets.Widget Widget containing the interactive periodogram interface.

Raises

traitlets.TraitError If the Matplotlib canvas cannot be embedded as an ipywidget, for example when the ipympl backend is not active.

Signals

Signals()

Return the interactive signal-table interface.

The interface displays the signal parameters staged for the next fit and provides controls for adding, editing, removing, saving, and loading signals. It also provides access to the most recent fit report.

Returns

ipywidgets.Widget Widget containing the staged signal table and associated controls.

Log

Log()

Return the Pyriod log interface.

Returns

ipywidgets.Widget Widget displaying the current Pyriod log together with controls for saving it to a file.

Pyriod

Pyriod()

Return the complete interactive Pyriod interface.

The time series, periodogram, signal table, and log interfaces are combined into separate tabs.

Returns

ipywidgets.Widget Tabbed widget containing the complete Pyriod interface.

save_tsfig

save_tsfig(filename='Pyriod_TimeSeries.png', **kwargs)

Save the current time-series figure.

Parameters:
  • filename (str or path - like, default: 'Pyriod_TimeSeries.png' ) –

    Output filename. Default is "Pyriod_TimeSeries.png".

  • **kwargs

    Additional keyword arguments passed to matplotlib.figure.Figure.savefig.

save_perfig

save_perfig(filename='Pyriod_Periodogram.png', **kwargs)

Save the current periodogram figure.

Parameters:
  • filename (str or path - like, default: 'Pyriod_Periodogram.png' ) –

    Output filename. Default is "Pyriod_Periodogram.png".

  • **kwargs

    Additional keyword arguments passed to matplotlib.figure.Figure.savefig.

fit_model

fit_model(*args)

Fit the staged signal model and refresh the GUI.

Calls pw.fit_model() and then refreshes the displayed light curve, periodograms, signal markers, staged signal table, fit report, and log.

The GUI displays a calculation-status indicator and temporarily disables the signal-addition and fitting buttons while the fit is running.

update_log

update_log()

Refresh the displayed log from pw.log_html.

log

log(message, level='info')

Record a message in the Pyriod log and refresh the log display.

Parameters:
  • message (str) –

    Message to record.

  • level ((debug, info, warning, error, critical), default: "debug" ) –

    Logging level passed to pw.log. Default is "info".

close

close(close_prewhitener=False, clear_prewhitener=False, collect=False)

Close resources owned by this GUI.

Matplotlib callbacks and timers are disconnected, widget callbacks are removed, plot artists and figures are closed, and references held by the GUI are released.

Parameters:
  • close_prewhitener (bool, default: False ) –

    If True, also close the associated Prewhitener after closing the GUI. Default is False.

  • clear_prewhitener (bool, default: False ) –

    Value passed as clear_data to pw.close when close_prewhitener=True. If True, the Prewhitener also releases its large analysis data objects. Default is False.

  • collect (bool, default: False ) –

    If True, explicitly run Python garbage collection after resources are released. Usually unnecessary, but potentially useful after creating many GUI instances in a long-running notebook. Default is False.

Notes

Closing the GUI does not close the associated Prewhitener unless close_prewhitener=True.