MIES icon indicating copy to clipboard operation
MIES copied to clipboard

SweepFormula/psxKernel: Various fixes

Open t-b opened this issue 1 year ago • 9 comments

@timjarsky This has our bugfixes for psxKernel and too large decayTau. I've removed the adaptations for the sweep range extraction as #1990 will fix that in a better way (also for old data).

  • [x] Add test
  • [x] Drop empty results in PSX_Operation
  • [x] intersecting ranges bug IVSCCMiniAnalysis on the FTP (same name, new content)
  • [x] StatsRangeTesting: Check that the correct range was used for multi dataset examples
  • [x] Update psxStats documentation
  • [x] Throw away events which have an amplitude which has a different sign compared to the psxKernel amplitude
  • [x] Replace PSX_DEFAULT_X_START_OFFSET with a factor and the decay tau from psxKernel
  • [x] Fix incorrect usage of StatsQuantiles as /Z with err = ... does not make sense
  • [x] psx should return sweepData waves if there are no events, as psxPrep relies on that for the histogram. Otherwise the data psx uses and what psxPrep plots is different
  • [x] Fix kernelAmp sign check again
  • [x] Reverse order of offsetting and filtering, rename all names

Close #2016 Close #2011 Close #1660

t-b avatar Feb 23 '24 14:02 t-b

@timjarsky Ready for a first look.

t-b avatar Jun 05 '24 22:06 t-b

@t-b

I get the following assertion:

  Igor Pro version: 9.0.6.1 (56565)
  ################################
  !!! Threadsafe assertion FAILED !!!
  Message: "Unexpected number of matches or invalid regex"
  Please provide the following information if you contact the MIES developers:
  ################################
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Stacktrace:
  PSX_PlotInteractionHook(...)#L3927 [MIES_SweepFormula_PSX.ipf]
PSX_MoveMouseForKeyPress(...)#L4083 [MIES_SweepFormula_PSX.ipf]
PSX_MoveAndCenterCursor(...)#L2783 [MIES_SweepFormula_PSX.ipf]
PSX_UpdateSingleEventGraph(...)#L1721 [MIES_SweepFormula_PSX.ipf]
PSX_UpdateSingleEventTextbox(...)#L2613 [MIES_SweepFormula_PSX.ipf]
FormatTextWaveForLegend(...)#L6563 [MIES_Utilities.ipf]
RemoveEndingRegExp(...)#L2126 [MIES_Utilities.ipf]

I put the pxp (PSXTesting.pxp) on the server.

timjarsky avatar Jun 18 '24 16:06 timjarsky

@timjarsky Thanks. Fixed.

t-b avatar Jun 18 '24 19:06 t-b

Fixed conflicts.

t-b avatar Jul 08 '24 11:07 t-b

@timjarsky Thanks for the repro data. I indeed calculated the peak for the event filtering incorrectly. Should be fixed now.

t-b avatar Jul 31 '24 15:07 t-b

@timjarsky Ready for another look.

t-b avatar Sep 04 '24 20:09 t-b

@t-b I get ** a wave read gave error: Index out of range for wave "peakX". when moving between events in the SF window.

I'm also seeing: 1. Many small events being detected. This could be due to Igor's peak finding algorithm, and 2. A filter induced decay. I'm not sure why the decay is from a around +25 mV.

image 2) image

timjarsky avatar Sep 05 '24 17:09 timjarsky

We can have a look together.

t-b avatar Sep 06 '24 14:09 t-b

I've fixed the cursor issue.

@MichaelHuth FYI: 7e0c17ee2 (DeepCopyWaveRefWave: Allow src to cotain null waves, 2024-09-06)

t-b avatar Sep 06 '24 15:09 t-b

@t-b with the latest changes I get:

  !!! Assertion FAILED !!!
  Message: "Expected a band pass filter with low > high"
  Please provide the following information if you contact the MIES developers:
  ################################
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Stacktrace:
  SF_button_sweepFormula_display(...)#L2991 [MIES_SweepFormula.ipf]
SF_ExecuteVariableAssignments(...)#L7125 [MIES_SweepFormula.ipf]
SF_FormulaExecutor(...)#L1145 [MIES_SweepFormula.ipf]
PSX_Operation(...)#L4510 [MIES_SweepFormula_PSX.ipf]
PSX_OperationSweepGathering(...)#L917 [MIES_SweepFormula_PSX.ipf]
PSX_Analysis(...)#L436 [MIES_SweepFormula_PSX.ipf]
PSX_DeconvoluteSweepData(...)#L350 [MIES_SweepFormula_PSX.ipf]
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Time: 2024-12-06T15:43:32-08:00
  Locked device: [- none -]
  Current sweep: [- none -]
  DAQ: [- none -]
  Testpulse: [- none -]
  Acquisition state: [- none -]
  Experiment: Sample NWB files from Jessica (Packed)
  Igor Pro version: 9.0.6.1 (56565)
  MIES version:
  
  ################################

The deconvolved filter settings (50,200) worked with the earlier version. When I swap the filter low and high to resolve the assertion, it bugs out in other ways.


sel=select(selchannels(AD0),selrange([2000,inf]))

dat = data($sel)


rtau=2
dtau=3
amp=-20
SD=5.0
bandfLow=1001
bandfHigh=2
maxtaufactor=5

kernel=psxkernel($sel, $rtau, $dtau, $amp)


PSXey=psx(Timay, $kernel, $SD , $bandfLow, $bandfHigh, $maxTauFactor, psxRiseTime(), psxDeconvFilter(50, 200, 101))

$PSXey

and

psxprep($PSXey, $SD)

and

psxstats(Timay, $sel, tau, accept)

and 

avg(rms($dat),over)

timjarsky avatar Dec 06 '24 23:12 timjarsky

@timjarsky Ready!

t-b avatar Dec 19 '24 17:12 t-b

@timjarsky I've enabled automerge.

t-b avatar Dec 19 '24 21:12 t-b