Fix numass data histogram
This commit is contained in:
parent
2ad98725a0
commit
ab006cb10f
@ -90,7 +90,7 @@ public class UnderflowCorrection {
|
||||
.entrySet().stream()
|
||||
.filter(entry -> entry.getKey() >= xLow && entry.getKey() <= xHigh)
|
||||
.map(p -> new WeightedObservedPoint(
|
||||
1d / p.getValue() * point.getLength() * point.getLength(), //weight
|
||||
1d,//1d / p.getValue() , //weight
|
||||
p.getKey(), // x
|
||||
p.getValue() / binning / point.getLength()) //y
|
||||
)
|
||||
|
@ -180,12 +180,12 @@ public class NMPoint {
|
||||
|
||||
while (i < RawNMPoint.MAX_CHANEL - binning) {
|
||||
int start = i;
|
||||
double sum = spectrum[start] / norm;
|
||||
double sum = 0;
|
||||
while (i < start + binning) {
|
||||
sum += spectrum[i] / norm;
|
||||
sum += spectrum[i];
|
||||
i++;
|
||||
}
|
||||
res.put(start + binning / 2d, sum);
|
||||
res.put(start + Math.floor(binning / 2d), sum / norm);
|
||||
}
|
||||
return res;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user