Skip to content

Commit

Permalink
PSX: Completely overhaul the psx detection algorithm
Browse files Browse the repository at this point in the history
This overhaul makes it impossible to reuse old data, either from the cache, or the results wave. We do warn
the user about that. And as usual don't delete the old data.

- Gather new values in psxEvent (e.g. Onset Time, Slew Rate and time, ...) and rename entries like post_minXX,
  pre_maxXX, rel_peak, etc.
- Make the calculation clearer and explicitly document where we use the deconvoluated data and where the
  offsetted and filtered sweep data
- Change how we apply the filtering for the deconvoluted and the sweep data
- Make the histogram calculation more robust by using a fixed number of bins
- To make the code easier to grasp we now also calculate the rise time as part of the other event properties
- The extracted single event range now depends on the tau's of all events from that combination
- Introduce more constants for magic numbers
- Add more properties to display for psxstats
- Rework the offsetting in the all events graph and add an entry for slew rate
- Change how we calculate the fit range for the accept average fit
- Enforce that the decay tau is larger than the rise tau for psxKernel
- Add a third parameter to psxRiseTime
- Don't round the peak threshold to three digits as this breaks for very small values
  • Loading branch information
timjarsky authored and t-b committed Dec 19, 2024
1 parent b7e3912 commit 7418adb
Show file tree
Hide file tree
Showing 9 changed files with 934 additions and 461 deletions.
14 changes: 8 additions & 6 deletions Packages/MIES/MIES_Cache.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,13 @@ Function/S CA_AveragingWaveModKey(WAVE wv)
return num2istr(CA_RecursiveWavemodCRC(wv)) + "Version 1"
End

/// @brief Cache key generator for the tau range calculation
/// of psx events
Function/S CA_PSXEventGoodTauRange(WAVE wv)

return num2istr(CA_RecursiveWavemodCRC(wv)) + "Version 1"
End

/// @brief Calculated a CRC from non wave reference waves using modification data, wave modification count and wave location.
/// If the given wave is a wave reference wave, then the CRC is calculated recursively from
/// all non wave reference waves and null wave references found.
Expand Down Expand Up @@ -438,12 +445,7 @@ End

Function/S CA_PSXOperationKey(string comboKey, string psxParameters)

return CA_PSXBaseKey(comboKey, psxParameters) + " Operation " + ":Version 2"
End

Function/S CA_PSXRiseTimeKey(string comboKey, string psxParameters)

return CA_PSXBaseKey(comboKey, psxParameters) + " PSX Rise time " + ":Version 2"
return CA_PSXBaseKey(comboKey, psxParameters) + " Operation " + ":Version 3"
End

Function/S CA_PSXAnalyzePeaks(string comboKey, string psxParameters)
Expand Down
8 changes: 5 additions & 3 deletions Packages/MIES/MIES_Constants.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -2033,6 +2033,7 @@ StrConstant CO_EMPTY_DAC_LIST = "emptyDACList"
StrConstant CO_SF_TOO_MANY_TRACES = "SF_tooManyTraces"
StrConstant CO_PSX_CLIPPED_STATS = "psx_clippedStats"
StrConstant CO_ARCHIVE_ONCE = "ArchiveLogs"
StrConstant CO_PSX_UPGRADE_EVENT = "psx_updateEvent"
///@}

/// @name Constants for SweepFormula Meta data in JSON format
Expand Down Expand Up @@ -2348,11 +2349,12 @@ StrConstant PSX_STATS_LABELS = "Average;Median;Average Deviation;Standard deviat
///@{
Constant PSX_HORIZ_OFFSET_ONSET = 0
Constant PSX_HORIZ_OFFSET_PEAK = 1
Constant PSX_HORIZ_OFFSET_SLEW = 2
///@}

Constant PSX_DECONV_FILTER_DEF_LOW = 0.002
Constant PSX_DECONV_FILTER_DEF_HIGH = 0.004
Constant PSX_DECONV_FILTER_DEF_ORDER = 101
Constant PSX_DECONV_FILTER_DEF_LOW = 500
Constant PSX_DECONV_FILTER_DEF_HIGH = 50
Constant PSX_DECONV_FILTER_DEF_ORDER = 7

StrConstant PSX_JWN_COMBO_KEYS_NAME = "ComboKeys"

Expand Down
Loading

0 comments on commit 7418adb

Please sign in to comment.