[no commit message]
This commit is contained in:
parent
e2dace1504
commit
b50953b119
@ -11,5 +11,6 @@ mainClassName = mainClass
|
||||
dependencies {
|
||||
compile project(':numass-storage:numass-client')
|
||||
compile project(':dataforge-plots')
|
||||
compile project(':dataforge-fx')
|
||||
compile project(':dataforge-control')
|
||||
}
|
@ -12,4 +12,5 @@ dependencies {
|
||||
compile project(':numass-storage:numass-client')
|
||||
compile project(':dataforge-plots')
|
||||
compile project(':dataforge-control')
|
||||
compile project(':dataforge-fx')
|
||||
}
|
@ -13,11 +13,11 @@ import hep.dataforge.meta.Meta
|
||||
import inr.numass.actions.FindBorderAction
|
||||
import hep.dataforge.grind.GrindMetaBuilder
|
||||
|
||||
File dataDir = new File("D:\\Work\\Numass\\data\\2016_04\\T2_data\\Fill_1_7\\set_2_3b127e3254010000")
|
||||
File dataDir = new File("D:\\Work\\Numass\\data\\2016_04\\T2_data\\Fill_2_2\\set_6_e26d123e54010000")
|
||||
if(!dataDir.exists()){
|
||||
println "dataDir directory does not exist"
|
||||
}
|
||||
Meta config = new GrindMetaBuilder().config(lower: 500, upper: 1800)
|
||||
Meta config = new GrindMetaBuilder().config(lower: 400, upper: 1800, reference: 18500)
|
||||
println config
|
||||
NumassData data = NumassDataLoader.fromLocalDir(null, dataDir)
|
||||
new FindBorderAction().eval(data, config)
|
||||
new FindBorderAction().simpleRun(data, config)
|
||||
|
@ -32,6 +32,7 @@ import inr.numass.storage.NumassData;
|
||||
import java.io.OutputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.apache.commons.math3.analysis.UnivariateFunction;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -43,6 +44,8 @@ public class FindBorderAction extends OneToOneAction<NumassData, Table> {
|
||||
private final static String[] names = {"U", "80%", "90%", "95%", "99%"};
|
||||
private final static double[] percents = {0.8, 0.9, 0.95, 0.99};
|
||||
|
||||
private UnivariateFunction normCorrection = e -> 1 + 13.265 * Math.exp(-e / 2343.4);
|
||||
|
||||
@Override
|
||||
protected Table execute(Context context, Reportable log, String name, Laminate meta, NumassData source) throws ContentException {
|
||||
log.report("File {} started", source.getName());
|
||||
@ -97,7 +100,7 @@ public class FindBorderAction extends OneToOneAction<NumassData, Table> {
|
||||
} else {
|
||||
spectrum = point.getMapWithBinning(0, true);
|
||||
}
|
||||
double norm = getNorm(spectrum, lower, upper);
|
||||
double norm = getNorm(spectrum, lower, upper) * normCorrection.value(point.getUset());
|
||||
double counter = 0;
|
||||
int chanel = upper;
|
||||
while (chanel > lower) {
|
||||
@ -111,6 +114,12 @@ public class FindBorderAction extends OneToOneAction<NumassData, Table> {
|
||||
}
|
||||
}
|
||||
}
|
||||
for (String n : names) {
|
||||
if (!map.containsKey(n)) {
|
||||
map.put(n, Value.of(lower));
|
||||
}
|
||||
}
|
||||
|
||||
dataBuilder.addRow(new MapPoint(map));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user