Skip to content

Various PSX fixes #2362

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 51 commits into
base: main
Choose a base branch
from
Open

Conversation

t-b
Copy link
Collaborator

@t-b t-b commented Feb 28, 2025

So this should be ready for a first test. I've adapted psxKernel and psxStats to allow passing in multiple selections.

  • Fix assertion, https://aiephys.slack.com/archives/C06P3MYEV6H/p1742330027060869
  • PSX multiple selections (only that) #2376
  • Yesterday, we chatted about moving the baseline search before peak_t, and I think
    that still makes sense. The baseline search shouldn't search past the previous
    peak_t. With the baseline_t of the event available, PSX_CalculateEventPeak, instead
    of using prevDeconvPeak_t to constrain the search, can use the event
    baseline_tinstead. The above makes adding a peakfinding operation, which I suggested
    yesterday, unnecessary.
  • Tweak accept fit average logic: The start point for the fit should be calculated via rise time calculation (20% of amplitude, add control "fit start amplitude"). Use that for onset and peak methods.
  • Debug session with Tim
  • Polish code
    • // TODO add vertical dashed lines at positions
      // 3 checkboxes to turn all of these on/off below suppress update
      // peak_t
      // baseline_t
    • Fix assertion when restoring PSX panel with accepted fit checkbox checked
  • Add three taus to stats
  • Wait for Tim's changes
  • Fix function comment PSX_AppendTracesToAllEventGraph
  • https://aiephys.slack.com/archives/D6WGZV2V8/p1743629846161639
  • Fix slow/fast tau
  • Excel import could be better, see UpdateInfoButtonHelp: Set machine-readable text for C&P #2424
  • Commit cleanup
  • Add psxBPSweepFilter (BP = bandpass) and back down order for sweep/deconv. Handle the high/low frequency input arguments for the user such that the filtering is always bandpass.
  • Rename psxDeconFilter to include the filter type acronym (is this also a bandpass filter?). Manage the frequency arguments for the user such that it doesn't matter what order they are provided.
# psxSweepFilter(lowFreq, highFreq [, order = 6])
# back down on having nonfinite values in filtered data, order -2, output passing order
# back down on deconv order as well, same approach
# use code from Tim to determine the highest possible, reapply that order to all sweep data

@timjarsky

This comment was marked as outdated.

@timjarsky timjarsky assigned t-b and unassigned timjarsky Mar 7, 2025
@t-b

This comment was marked as outdated.

@t-b
Copy link
Collaborator Author

t-b commented Mar 10, 2025

@timjarsky This is very likely due to filter settings.

@t-b t-b assigned timjarsky and unassigned t-b Mar 11, 2025
@t-b t-b assigned t-b and unassigned timjarsky Mar 18, 2025
@t-b t-b force-pushed the bugfix/2362-psx-support-multiple-selections branch from f508957 to f23db8a Compare March 19, 2025 14:41
@t-b t-b assigned timjarsky and t-b and unassigned t-b and timjarsky Mar 19, 2025
@t-b t-b changed the title Support multiple select statements Various PSX fixes Mar 25, 2025
@t-b t-b force-pushed the bugfix/2362-psx-support-multiple-selections branch from 1332271 to 08deb18 Compare March 26, 2025 18:12
@t-b t-b assigned timjarsky and unassigned timjarsky Mar 26, 2025
@t-b t-b force-pushed the bugfix/2362-psx-support-multiple-selections branch 4 times, most recently from a12c1dd to 193bf80 Compare April 8, 2025 19:46
@timjarsky

This comment was marked as outdated.

@timjarsky
Copy link
Collaborator

@t-b I also tested pasting the average fit results into Excel. The row formatting is correct. However, Excel plots all the columns in one column. Excel is dumb. To correct this, paste into Excel, select the cells, select Data from the menu, select Text to Columns, and select the appropriate delimiter in the Excel pop-up GUI.

@timjarsky
Copy link
Collaborator

timjarsky commented Apr 8, 2025

@t-b there may also be issues with the indivdual decay tau values. For example in this case I'm getting a negative weighted tau.

image

@t-b t-b force-pushed the bugfix/2362-psx-support-multiple-selections branch from ca11e4f to 86f6692 Compare May 9, 2025 17:39
@t-b t-b force-pushed the bugfix/2362-psx-support-multiple-selections branch 2 times, most recently from 28e0452 to e037547 Compare May 14, 2025 14:29
timjarsky and others added 13 commits May 14, 2025 22:03
New MiES algorithmic utility for band pass filtering with Nan, Inf, and
ringing rejection and automatic order reduction
Rename it to psxDeconvBPFilter to make it clear that this is a bandpass
filter, see also PSX_DeconvoluteSweepData.

And also reorder the filter frequencies for the user to avoid an
assertion.
Due to implementation details of how FilterIIR implements band pass
filters the used order is always even. If required, odd values are increased by one so
that they are even.

Document that and also make them even already when we get them. We can as
well adap the default value to be even already.
Define all variables at the top, reword the documentation.
When PSX_OperationSweepGathering returns 1 as error code, we wrote the
code so that idx is not incremented in this case. The idea in d359a7a
(PSX_Operation: Handle partial results better, 2024-02-27) was that we
don't want holes in the output wave. But the code was buggy as it, after
an error, would reuse the same data again, and thus error out again, and
therefore ignoring all data behind the first combination with an error.

Fix that by introducing separate indizes for reading and writing.
A common tweaking algorithm done by users is to find the lowest filter
order which has the data from all combinations passing. As that is
manually quite tedious we now do that for her.

The idea is to start at some maximum order and then get he realized order
for each combination. If the realized order is constant for all
combinations, we are done. Otherwise we try the minimum order again and
should then be finished.

This is done for both sweep and deconv.
We need to preprocess the code before we can extract the variables and the
formula. Broken since 8ec6945 (SF: Add support to check also variables
with the check button, 2023-03-29).
@t-b t-b force-pushed the bugfix/2362-psx-support-multiple-selections branch from e037547 to b400252 Compare May 14, 2025 20:04
@t-b t-b mentioned this pull request May 14, 2025
4 tasks
@t-b t-b assigned timjarsky and unassigned t-b May 14, 2025
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.

2 participants