diff --git a/Packages/MIES/MIES_AnalysisBrowser.ipf b/Packages/MIES/MIES_AnalysisBrowser.ipf index 1e2db96cff..4ea04c607b 100644 --- a/Packages/MIES/MIES_AnalysisBrowser.ipf +++ b/Packages/MIES/MIES_AnalysisBrowser.ipf @@ -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 diff --git a/Packages/MIES/MIES_SweepFormula_PSX.ipf b/Packages/MIES/MIES_SweepFormula_PSX.ipf index 60b1791845..92e1e0ccd0 100644 --- a/Packages/MIES/MIES_SweepFormula_PSX.ipf +++ b/Packages/MIES/MIES_SweepFormula_PSX.ipf @@ -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