Skip to content

PMAPs code confuses RMS and standard deviation #928

@atrettin

Description

@atrettin

When the rms attribute of a Peak is calculated, the code actually returns the standard deviation. The repr of the Peak prints out RMS: {self.rms / units.mus} µs, which is an incorrect labeling. The given quantity is actually the standard deviation. The RMS should correspond to the square of the standard deviation and have units of µs^2, accordingly.

I propose that the attribute rms should contain the square of the standard deviation, and that a separate std attribute is added to contain the standard deviation.

self.rms = self. rms_above_threshold(0)

def rms_above_threshold(self, thr):
i_above_thr = self.pmts.where_above_threshold(thr)
times_above_thr = self.times[i_above_thr]
wf_above_thr = self.pmts.sum_over_sensors[i_above_thr]
if np.size(i_above_thr) < 2 or np.sum(wf_above_thr) == 0:
return 0
return weighted_mean_and_std(times_above_thr, wf_above_thr)[1]

RMS: {self.rms / units.mus} µs

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions