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