Fix numass data histogram

This commit is contained in:
darksnake 2017-03-12 22:23:54 +03:00
parent 2ad98725a0
commit ab006cb10f
2 changed files with 4 additions and 4 deletions

View File

@ -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
) )

View File

@ -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;