Site fixed

This commit is contained in:
Alexander Nozik 2017-07-09 16:51:47 +03:00
parent badc119e78
commit 3127f1e7be
3 changed files with 35 additions and 5 deletions

View File

@ -3,6 +3,8 @@ package inr.numass.data;
import hep.dataforge.tables.ListTable; import hep.dataforge.tables.ListTable;
import hep.dataforge.tables.Table; import hep.dataforge.tables.Table;
import hep.dataforge.values.Values; import hep.dataforge.values.Values;
import inr.numass.data.api.NumassPoint;
import inr.numass.data.api.NumassSet;
import java.time.Instant; import java.time.Instant;
import java.util.Arrays; import java.util.Arrays;
@ -17,7 +19,7 @@ import java.util.stream.Stream;
*/ */
public class NumassDataUtils { public class NumassDataUtils {
public static Collection<NumassPoint> joinSpectra(Stream<NumassData> spectra) { public static Collection<NumassPoint> joinSpectra(Stream<NumassSet> spectra) {
Map<Double, NumassPoint> map = new LinkedHashMap<>(); Map<Double, NumassPoint> map = new LinkedHashMap<>();
spectra.forEach(datum -> { spectra.forEach(datum -> {
datum.forEach(point -> { datum.forEach(point -> {

View File

@ -1,16 +1,19 @@
package inr.numass.data.analyzers; package inr.numass.data.analyzers;
import hep.dataforge.meta.Meta; import hep.dataforge.meta.Meta;
import hep.dataforge.tables.Table;
import hep.dataforge.tables.TableFormat;
import hep.dataforge.tables.TableFormatBuilder;
import hep.dataforge.tables.ValueMap; import hep.dataforge.tables.ValueMap;
import hep.dataforge.values.Values; import hep.dataforge.values.Values;
import inr.numass.data.api.NumassAnalyzer; import inr.numass.data.api.*;
import inr.numass.data.api.NumassBlock;
import inr.numass.data.api.NumassEvent;
import inr.numass.data.api.SignalProcessor;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import java.util.stream.Stream; import java.util.stream.Stream;
import static hep.dataforge.tables.XYAdapter.*;
import static inr.numass.data.api.NumassPoint.HV_KEY;
/** /**
* A simple event counter * A simple event counter
* Created by darksnake on 07.07.2017. * Created by darksnake on 07.07.2017.
@ -24,6 +27,7 @@ public class SimpleAnalyzer implements NumassAnalyzer {
public SimpleAnalyzer(@Nullable SignalProcessor processor) { public SimpleAnalyzer(@Nullable SignalProcessor processor) {
this.processor = processor; this.processor = processor;
} }
public SimpleAnalyzer() { public SimpleAnalyzer() {
this.processor = null; this.processor = null;
} }
@ -64,4 +68,19 @@ public class SimpleAnalyzer implements NumassAnalyzer {
} }
); );
} }
@Override
public Table analyze(NumassSet set, Meta config) {
TableFormat format = new TableFormatBuilder()
.addNumber(HV_KEY, X_VALUE_KEY)
.addNumber("length")
.addNumber("count")
.addNumber(COUNT_RATE_KEY, Y_VALUE_KEY)
.addNumber(COUNT_RATE_ERROR_KEY, Y_ERROR_KEY)
.addColumn("window")
.addTime()
.build();
}
} }

View File

@ -1,6 +1,7 @@
package inr.numass.data.api; package inr.numass.data.api;
import hep.dataforge.meta.Meta; import hep.dataforge.meta.Meta;
import hep.dataforge.tables.Table;
import hep.dataforge.values.Values; import hep.dataforge.values.Values;
/** /**
@ -20,5 +21,13 @@ public interface NumassAnalyzer {
*/ */
Values analyze(NumassBlock block, Meta config); Values analyze(NumassBlock block, Meta config);
/**
* Analyze the whole set
* @param set
* @param config
* @return
*/
Table analyze(NumassSet set, Meta config);
} }