Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
t-b committed Jan 17, 2024
1 parent 05dcedf commit 5f65550
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 28 deletions.
2 changes: 1 addition & 1 deletion Packages/MIES/MIES_AnalysisBrowser.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -2947,7 +2947,7 @@ Function AB_ButtonProc_AddFiles(ba) : ButtonControl
return 0
End

static Function AB_AddElementToSourceList(string entry)
Function AB_AddElementToSourceList(string entry)

variable size

Expand Down
38 changes: 11 additions & 27 deletions Packages/MIES/MIES_SweepFormula_PSX.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -369,38 +369,22 @@ static Function/WAVE PSX_DeconvoluteSweepData(WAVE sweepData, WAVE/C psxKernelFF
end

/// @brief Creates a histogram of the deconvoluted sweep data
static Function/WAVE PSX_CreateHistogramOfDeconvSweepData(WAVE deconvSweepData, [variable bin_start, variable bin_end, variable bin_width])
static Function/WAVE PSX_CreateHistogramOfDeconvSweepData(WAVE deconvSweepData)

variable n_bins, tmp
variable n_bins, start, binWidth, range

StatsQuantiles/Q deconvSweepData
WaveStats/Q deconvSweepData
binWidth = 0.0001
range = V_adev * 0.8
start = V_avg - range
n_bins = 2 * range /binWidth

variable q75 = V_Q75

if(ParamIsDefault(bin_start))
bin_start = q75 * -3
endif

if(ParamIsDefault(bin_end))
bin_end = q75 * 3
endif

if(ParamIsDefault(bin_width))
bin_width = 0.0005
endif

if(bin_start > bin_end)
tmp = bin_end
bin_end = bin_start
bin_start = tmp
endif

n_bins = ceil((bin_end - bin_start) / bin_width)

SFH_ASSERT(n_bins > 1, "Histogram creation failed due to too few data points")
SFH_ASSERT(n_bins > 10, "Histogram creation failed due to too few data points")

Make/FREE/N=0 hist
Histogram/B={bin_start, bin_width, n_bins}/DEST=hist deconvSweepData
// Histogram/B={bin_start, bin_width, n_bins}/DEST=hist deconvSweepData
// Histogram/B=5/DEST=hist deconvSweepData
Histogram/B={start, binWidth, n_bins}/DEST=hist deconvSweepData

return hist
end
Expand Down

0 comments on commit 5f65550

Please sign in to comment.