Skip to content

Releases: Christian-Palmroos/PyOnset

v1.1.0

10 Sep 14:07

Choose a tag to compare

What's Changed:


1.) Changed the definition of the k-parameter in CUSUM function:

$\mathrm{old:} k = \frac{\mu_{d} - \mu}{\sigma(\ln(\mu_{d}) - \ln(\mu))}$

$\mathrm{new:} k = \frac{\mu_{d} - \mu}{\sigma(\ln(\mu_{d}) - \ln(\mu))} - \frac{\mu}{\sigma}$

The new k is consistent with the classic Poisson-CUSUM k-parameter. Old k caused the method to be too conservative in onset determination with low counting rate data.


2.) Changes to Onset.cusum_onset()

  • Return type of onset_stats changed from list to dict.
    The onset_stats_dict contains the background mean, background mean + n*sigma, the k-parameter, the h-parameter, z-standardized intensity values, the cusum function, the onset time and the channel energy string.
  • Greatly improved the diagnostics mode:
    The new diagnostics mode, enabled with setting the keyword diagnostics=True in cusum_onset(), now displays individual plots for the z-standardized intensity, the cusum function and the parameter space for the k-parameter. The parameter space also displays the current background conditions mapped to this space, an equality line of $\sigma=\mu$ and a Poisson-statistics line $\sigma=\mu^{2}$.

3.) Added a new method to the Onset class

final_onset_plot() accepts the following parameters:

  • channel {int/str}
    The channel number or name, depending if custom data or not.
  • resample {str}, optional
    Pandas-compatible time string to time-average the intensity displayed on the plot. Default None.
  • xlim {tuple,list}, optional
    A pair of Pandas-compatible datetime strings. Defines the horizontal boundaries of the plot. Default +3/-5 hours of the onset time.
  • ylim {tuple,list}, optional
    A pair of floats or integers. Define the vertical boundaries of the plot. Default is half of the minimum and 1.5 * maximum intensity displayed on the plot.
  • show_background {bool}, optional
    A switch to draw the background on the plot. Default True.
  • peak {bool}, optional
    A switch to mark the maximum intensity in the plot with a vertical blue line, and add it to the legend and the returned dictionary. Default False.
  • onset {str}, optional
    A switch to use either the "mode" or the "median" of the onset analysis as the onset time. Default "mode".
  • title {str}, optional
    A title string for the figure. Default None generates a title from the Onset object's attributes and channel identifier.
  • legend_loc {str}, optional
    Placement for the legend. Either "in" or "out" of the axis frame. Default "out".
  • savepath {str}, optional
    A path to save the figure and csv of results. Default None.
  • save {bool}, optional
    A switch to save the figure and corresponding csv. Default False.
  • figname {str}, optional
    A custom name for the figure and csv if saved. Default None generates the name from the Onset object's attributes and channel identifier.

This method does not run onset determination or other calculation; instead it is used to simply visualize the onset time and the corresponding uncertainty found with the Onset.onset_statistics_per_channel() method.


4.) Updated the example notebooks

The Jupyter notebooks act as a tutorial on how to use PyOnset step-by-step. Old and changed functionality is replaced with up-to-date examples.


5.) Generated notes

Full Changelog: 1.0.0...1.1.0

v1.0.0

10 Sep 11:55

Choose a tag to compare

Initial release of Pyonset

Full Changelog: https://github.com/Christian-Palmroos/PyOnset/commits/1.0.0