[no commit message]
This commit is contained in:
parent
b15e9e2ad5
commit
468fbb873f
@ -25,6 +25,7 @@ import hep.dataforge.description.ValueDef;
|
||||
import hep.dataforge.exceptions.ContentException;
|
||||
import hep.dataforge.io.reports.Reportable;
|
||||
import hep.dataforge.meta.Laminate;
|
||||
import hep.dataforge.meta.Meta;
|
||||
import hep.dataforge.plots.PlotsPlugin;
|
||||
import hep.dataforge.plots.XYPlotFrame;
|
||||
import hep.dataforge.plots.data.PlottableData;
|
||||
@ -43,7 +44,7 @@ import org.apache.commons.math3.analysis.UnivariateFunction;
|
||||
public class PlotFitResultAction extends OneToOneAction<FitState, FitState> {
|
||||
|
||||
@Override
|
||||
protected FitState execute(Context context,Reportable log, String name, Laminate metaData, FitState input) {
|
||||
protected FitState execute(Context context, Reportable log, String name, Laminate metaData, FitState input) {
|
||||
|
||||
PointSource data = input.getDataSet();
|
||||
if (!(input.getModel() instanceof XYModel)) {
|
||||
@ -65,30 +66,7 @@ public class PlotFitResultAction extends OneToOneAction<FitState, FitState> {
|
||||
|
||||
XYPlotFrame frame = (XYPlotFrame) PlotsPlugin
|
||||
.buildFrom(context).buildPlotFrame(getName(), name,
|
||||
metaData.getNode("plot", null));
|
||||
//JFreeChartFrame.drawFrame(reader.getString("plotTitle", "Fit result plot for "+input.getName()), null);
|
||||
|
||||
// double[] x = new double[data.size()];
|
||||
// double[] y = new double[data.size()];
|
||||
// double xMin = Double.POSITIVE_INFINITY;
|
||||
//
|
||||
// double xMax = Double.NEGATIVE_INFINITY;
|
||||
//
|
||||
// List<DataPoint> points = new ArrayList<>();
|
||||
//
|
||||
// for (int i = 0; i < data.size(); i++) {
|
||||
// x[i] = adapter.getX(data.get(i)).doubleValue();
|
||||
//// y[i] = adapter.getY(data.get(i));
|
||||
//
|
||||
// points.add(adapter.mapToDefault(data.get(i)));
|
||||
// if (x[i] < xMin) {
|
||||
// xMin = x[i];
|
||||
// }
|
||||
//
|
||||
// if (x[i] > xMax) {
|
||||
// xMax = x[i];
|
||||
// }
|
||||
// }
|
||||
metaData.getNode("plot", Meta.empty()));
|
||||
frame.add(new PlottableFunction("fit", function, data, adapter));//FIXME replace by helper
|
||||
|
||||
frame.add(PlottableData.plot("data", adapter, data));
|
||||
|
@ -27,7 +27,6 @@ import hep.dataforge.datafitter.models.XYModel;
|
||||
import hep.dataforge.meta.Meta;
|
||||
import hep.dataforge.plotfit.PlotFitResultAction;
|
||||
import hep.dataforge.plots.PlotDataAction;
|
||||
import hep.dataforge.storage.commons.StorageManager;
|
||||
import hep.dataforge.tables.PointAdapter;
|
||||
import hep.dataforge.tables.XYAdapter;
|
||||
import inr.numass.actions.AdjustErrorsAction;
|
||||
@ -204,6 +203,21 @@ public class NumassPlugin extends BasicPlugin {
|
||||
return res;
|
||||
});
|
||||
|
||||
manager.addModel("sterile-polina", (context, an) -> {
|
||||
double A = an.getDouble("resolution", 8.3e-5);//8.3e-5
|
||||
double from = an.getDouble("from", 13900d);
|
||||
double to = an.getDouble("to", 18700d);
|
||||
BivariateFunction resolutionTail = ResolutionFunction.getRealTail();
|
||||
RangedNamedSetSpectrum beta = new BetaSpectrum(context.io().getFile("FS.txt"));
|
||||
ModularSpectrum sp = new ModularSpectrum(beta, new ResolutionFunction(A, resolutionTail), from, to);
|
||||
if (!an.getBoolean("caching", false)) {
|
||||
sp.setCaching(false);
|
||||
}
|
||||
NBkgSpectrum spectrum = new NBkgSpectrum(sp);
|
||||
|
||||
return new XYModel("tritium", spectrum, getAdapter(an));
|
||||
});
|
||||
|
||||
manager.addModel("modularbeta-unadeabatic", (context, an) -> {
|
||||
double A = an.getDouble("resolution", 8.3e-5);//8.3e-5
|
||||
double from = an.getDouble("from", 14400d);
|
||||
|
@ -54,7 +54,6 @@ import javafx.scene.control.Alert;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Tab;
|
||||
import javafx.scene.control.TabPane;
|
||||
import javafx.scene.control.TextArea;
|
||||
import javafx.scene.control.TitledPane;
|
||||
import javafx.scene.control.ToggleButton;
|
||||
import javafx.stage.FileChooser;
|
||||
@ -324,7 +323,7 @@ public class NumassWorkbenchController implements Initializable, StagePaneHolder
|
||||
} catch (Exception ex) {
|
||||
GlobalContext.instance().getLogger().error("Exception while executing action chain", ex);
|
||||
Platform.runLater(() -> {
|
||||
// ex.printStackTrace();
|
||||
ex.printStackTrace();
|
||||
statusBar.setText("Execution failed");
|
||||
Alert alert = new Alert(Alert.AlertType.ERROR);
|
||||
alert.setTitle("Exception!");
|
||||
|
Loading…
Reference in New Issue
Block a user