Skip to content

Commit fdb5360

Browse files
committed
WIP: ipt
1 parent 86f6692 commit fdb5360

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

Packages/MIES/MIES_MiesUtilities_Algorithm.ipf

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -614,61 +614,61 @@ End
614614
// -----------------------------------------------------------------------------
615615
Function [variable curOrder, WAVE filtered] bandpass_with_RingingDetection(WAVE src, variable fHigh, variable fLow, variable maxOrder)
616616

617-
// ---- parameter sanity ---------------------------------------------------
617+
// ---- parameter sanity ---------------------------------------------------
618618
ASSERT(maxOrder > 0, "maxOrder must be positive")
619-
if(fLow <= fHigh) // Igor band‑pass expects fLow > fHigh
619+
if(fLow <= fHigh) // Igor band‑pass expects fLow > fHigh
620620
variable tmp = fLow
621621
fLow = fHigh
622622
fHigh = tmp
623623
endif
624-
624+
625625
// Sampling rate (Hz) – assumes X scaling is in milliseconds
626626
variable samp = 1 / (DeltaX(src) * MILLI_TO_ONE)
627-
627+
628628
// Pre‑compute SEM(original) once
629629
WaveStats/Q src
630630
variable semOrig = V_sem
631-
variable offset = v_avg
631+
variable offset = v_avg
632632

633633
// Prepare destination wave (same name every call → convenient overwrite)
634634
duplicate/FREE src, src_BPF
635-
WAVE/z filtered = src_BPF
636-
635+
WAVE/Z filtered = src_BPF
636+
637637
// remove offset from src copy
638638
filtered -= offset
639-
639+
640640
curOrder = maxOrder
641641
variable err
642642
do
643643
// -------- copy fresh data into filtered ------------------------------
644-
filtered = src // avoids repeated duplicate/O allocations
645-
644+
filtered = src // avoids repeated duplicate/O allocations
645+
646646
// -------- attempt current order --------------------------------------
647-
FilterIIR/LO=(fLow/samp)/HI=(fHigh/samp)/DIM=(ROWS)/ORD=(curOrder) filtered
647+
FilterIIR/LO=(fLow / samp)/HI=(fHigh / samp)/DIM=(ROWS)/ORD=(curOrder) filtered
648648
err = GetRTError(1)
649649
if(err)
650-
Print "FilterIIR failed (order="+num2str(curOrder)+"): "+GetErrMessage(err)
650+
Print "FilterIIR failed (order=" + num2str(curOrder) + "): " + GetErrMessage(err)
651651
curOrder -= 1
652652
continue
653653
endif
654-
654+
655655
// -------- WaveStats: NaN/Inf + SEM in one call ------------------------
656656
WaveStats/Q filtered
657657
if(V_numNaNs > 0 || V_numInfs > 0)
658658
curOrder -= 1
659-
continue // bad numerical output → lower order
659+
continue // bad numerical output → lower order
660660
endif
661-
662-
if(V_sem > semOrig) // noisier than original → ringing
661+
662+
if(V_sem > semOrig) // noisier than original → ringing
663663
curOrder -= 1
664664
continue
665665
endif
666-
666+
667667
// -------- success -----------------------------------------------------
668-
668+
669669
break
670670
while(curOrder > 0)
671-
671+
672672
if(curOrder <= 0)
673673
Print "bandpass_with_RingingDetection(): all orders down to 1 produced NaNs/Infs or increased SEM."
674674
endif

Packages/MIES/MIES_SweepFormula_PSX.ipf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@ static Function PSX_FitEventDecay(WAVE sweepDataOffFilt, WAVE psxEvent, variable
923923

924924
fitRange = endTime - startTime
925925

926-
if(IsFinite(weightedTau) && weightedTau > (maxTauFactor * fitRange) || fastTau <= 0 || SlowTau <= 0 || weightedTau <= 0)
926+
if((IsFinite(weightedTau) && weightedTau > (maxTauFactor * fitRange)) || fastTau <= 0 || SlowTau <= 0 || weightedTau <= 0)
927927
psxEvent[eventIndex][%$"Fit manual QC call"] = PSX_REJECT
928928
psxEvent[eventIndex][%$"Fit result"] = PSX_DECAY_FIT_ERROR
929929
psxEvent[eventIndex][%weightedTau] = NaN

0 commit comments

Comments
 (0)