[no commit message]

This commit is contained in:
Alexander Nozik 2016-01-10 22:11:35 +03:00
parent 32cfbff1e2
commit 243f9f541c
10 changed files with 207 additions and 208 deletions

View File

@ -160,7 +160,7 @@ public class NumassPlugin extends BasicPlugin {
double weightReductionFactor = an.getDouble("weightReductionFactor", 2.0); double weightReductionFactor = an.getDouble("weightReductionFactor", 2.0);
Model res = new WeightedXYModel("scatter-variable", spectrum, getAdapter(an), (dp) -> weightReductionFactor); Model res = new WeightedXYModel("scatter-variable", spectrum, getAdapter(an), (dp) -> weightReductionFactor);
res.configure(an); res.setMeta(an);
return res; return res;
}); });
@ -196,7 +196,7 @@ public class NumassPlugin extends BasicPlugin {
double weightReductionFactor = an.getDouble("weightReductionFactor", 2.0); double weightReductionFactor = an.getDouble("weightReductionFactor", 2.0);
Model res = new WeightedXYModel("scatter-empiric-experimental", spectrum, getAdapter(an), (dp) -> weightReductionFactor); Model res = new WeightedXYModel("scatter-empiric-experimental", spectrum, getAdapter(an), (dp) -> weightReductionFactor);
res.configure(an); res.setMeta(an);
return res; return res;
}); });

View File

@ -102,7 +102,7 @@ public class MergeDataAction extends ManyToOneAction<DataSet, DataSet> {
* Указываем путь только если он одинаковый для всех входных файлов * Указываем путь только если он одинаковый для всех входных файлов
*/ */
if (numassPath != null) { if (numassPath != null) {
res.configure(res.meta().getBuilder().putValue("numass.path", numassPath).build()); res.setMeta(res.meta().getBuilder().putValue("numass.path", numassPath).build());
} }
res = res.sort("Uset", true); res = res.sort("Uset", true);

View File

@ -34,7 +34,6 @@ import inr.numass.data.NMPoint;
import inr.numass.data.RawNMPoint; import inr.numass.data.RawNMPoint;
import java.io.OutputStream; import java.io.OutputStream;
import java.time.Instant; import java.time.Instant;
import java.time.ZoneOffset;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;

View File

@ -15,7 +15,7 @@
*/ */
package inr.numass.data; package inr.numass.data;
import hep.dataforge.content.AbstractContent; import hep.dataforge.content.NamedMetaHolder;
import hep.dataforge.description.ValueDef; import hep.dataforge.description.ValueDef;
import hep.dataforge.meta.Meta; import hep.dataforge.meta.Meta;
import hep.dataforge.meta.MetaBuilder; import hep.dataforge.meta.MetaBuilder;
@ -33,7 +33,7 @@ import java.util.List;
*/ */
@ValueDef(name = "numass.path", info = "Path to this data file in numass repository.") @ValueDef(name = "numass.path", info = "Path to this data file in numass repository.")
@ValueDef(name = "numass.name", info = "The name of this data file.") @ValueDef(name = "numass.name", info = "The name of this data file.")
public class NMFile extends AbstractContent implements NumassData { public class NMFile extends NamedMetaHolder implements NumassData {
public static NMFile readStream(InputStream is, String fname, Meta config) throws IOException{ public static NMFile readStream(InputStream is, String fname, Meta config) throws IOException{
return new NMFile(new NumassDataReader(is, fname, config).read()); return new NMFile(new NumassDataReader(is, fname, config).read());

View File

@ -15,7 +15,8 @@
*/ */
package inr.numass.data; package inr.numass.data;
import hep.dataforge.content.AbstractContent; import hep.dataforge.content.Content;
import hep.dataforge.content.NamedMetaHolder;
import java.io.BufferedOutputStream; import java.io.BufferedOutputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.io.PrintWriter; import java.io.PrintWriter;
@ -26,7 +27,7 @@ import java.util.List;
* Contains the whole data but requires a lot of memory * Contains the whole data but requires a lot of memory
* @author Darksnake * @author Darksnake
*/ */
public class RawNMFile extends AbstractContent { public class RawNMFile extends NamedMetaHolder implements Content {
// public static String TYPE = ":data:numassdatafile"; // public static String TYPE = ":data:numassdatafile";

View File

@ -16,7 +16,7 @@
package inr.numass.prop.ar; package inr.numass.prop.ar;
import hep.dataforge.meta.Meta; import hep.dataforge.meta.Meta;
import hep.dataforge.content.AbstractContent; import hep.dataforge.content.NamedMetaHolder;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
@ -25,7 +25,7 @@ import java.util.List;
* *
* @author Darksnake * @author Darksnake
*/ */
public class JNAEpisode extends AbstractContent implements Iterable<JNASpectrum> { public class JNAEpisode extends NamedMetaHolder implements Iterable<JNASpectrum> {
private final List<JNASpectrum> spectra; private final List<JNASpectrum> spectra;

View File

@ -17,7 +17,7 @@ package inr.numass.prop.ar;
import hep.dataforge.meta.Meta; import hep.dataforge.meta.Meta;
import hep.dataforge.meta.MetaBuilder; import hep.dataforge.meta.MetaBuilder;
import hep.dataforge.content.AbstractContent; import hep.dataforge.content.NamedMetaHolder;
import hep.dataforge.description.NodeDef; import hep.dataforge.description.NodeDef;
import hep.dataforge.description.ValueDef; import hep.dataforge.description.ValueDef;
import hep.dataforge.data.DataPoint; import hep.dataforge.data.DataPoint;
@ -37,7 +37,7 @@ import java.util.Map;
@NodeDef(name = "temperature", info = "The temperature measurements data for this spectrum.") @NodeDef(name = "temperature", info = "The temperature measurements data for this spectrum.")
@ValueDef(name = "relativeStartTime", type = "NUMBER", info = "Start time in days relative to some starting point.") @ValueDef(name = "relativeStartTime", type = "NUMBER", info = "Start time in days relative to some starting point.")
@ValueDef(name = "relativeStopTime", type = "NUMBER", info = "Stop time in days relative to some starting point.") @ValueDef(name = "relativeStopTime", type = "NUMBER", info = "Stop time in days relative to some starting point.")
public class JNASpectrum extends AbstractContent { public class JNASpectrum extends NamedMetaHolder {
public static String[] names = {"chanel", "count"}; public static String[] names = {"chanel", "count"};

View File

@ -21,7 +21,6 @@ import hep.dataforge.context.Context;
import hep.dataforge.description.ValueDef; import hep.dataforge.description.ValueDef;
import hep.dataforge.description.TypedActionDef; import hep.dataforge.description.TypedActionDef;
import hep.dataforge.io.log.Logable; import hep.dataforge.io.log.Logable;
import hep.dataforge.values.ValueType;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;

View File

@ -42,7 +42,7 @@ public class TestFit {
File sourceDir = new File("c:\\Users\\Darksnake\\Dropbox\\jna_data"); File sourceDir = new File("c:\\Users\\Darksnake\\Dropbox\\jna_data");
FileData file = new FileData(new File(sourceDir, "ar37e2.dat")); FileData file = new FileData(new File(sourceDir, "ar37e2.dat"));
file.annotate(new MetaBuilder("meta") file.setMeta(new MetaBuilder("meta")
.putValue("timeFile", "tar37e2.dat") .putValue("timeFile", "tar37e2.dat")
.putValue("temperatureFile", "e2temp.txt") .putValue("temperatureFile", "e2temp.txt")
); );

View File

@ -45,7 +45,7 @@ public class TestReader {
// new MINUITModule().load(); // new MINUITModule().load();
FileData file = new FileData(new File("c:\\Users\\Darksnake\\Dropbox\\jna_data\\ar37e2.dat")); FileData file = new FileData(new File("c:\\Users\\Darksnake\\Dropbox\\jna_data\\ar37e2.dat"));
file.annotate(new MetaBuilder("meta") file.setMeta(new MetaBuilder("meta")
.putValue("timeFile", "c:\\Users\\Darksnake\\Dropbox\\jna_data\\tar37e2.dat") .putValue("timeFile", "c:\\Users\\Darksnake\\Dropbox\\jna_data\\tar37e2.dat")
.putValue("temperatureFile", "c:\\Users\\Darksnake\\Dropbox\\jna_data\\e2temp.txt") .putValue("temperatureFile", "c:\\Users\\Darksnake\\Dropbox\\jna_data\\e2temp.txt")
); );