Skip to content

Commit

Permalink
New uncertainty quantification estimates for the corner frequency now…
Browse files Browse the repository at this point in the history
… available in both CCT and CERT spectral plots. The plot will now show the most likely estimate alone with an approximation of the 95% interval of misfit. The CERT plot also includes uncertainty from both the joint and pair-wise inversion for the spectral ratios. You can also turn the corner estimates on and off like the other plot elements from the legend now.

Added new beta version of export and import functionality for CERT. This allows you to manually adjust the spectral ratio windows for envelopes and then export the project for later use. Output is in a simple JSON document with one JSON object per-line so that the entire document need not be serialized. The format may change significantly based on community feedback while in the beta period. When importing the JSON into the tool it will attempt to map the values to any loaded waveforms based on their metadata and warn the user if it can't find mappings that are valid for any values.

Added a feature to allow for calculating the distances between any specific event in CERT. Right click an event in the events column of the main CERT display and select calculate distance to populate the distance column for all events based on the selected event.

Added additional map highlighting for the CERT map when selecting values in the spectral display and in the event table.

Manual updates to address some outdated instructions based on community feedback.
Re-formulated the observed energy calculation to replace a numerically derived constant to instead use an analytical formula that will take into account the MDAC model's propagation and density parameters. This should allow advanced users more control over the estimates and allowed better support for more types of geology overall.

Fixed a spectra plot replotting issue so that when the window within the ratio detail waveform plots is adjusted, the update will preserve the inversion data and replot it all correctly.
  • Loading branch information
justinbarno committed Jan 18, 2024
1 parent f86cdc6 commit dc96b1e
Show file tree
Hide file tree
Showing 2,880 changed files with 50,826 additions and 15,905 deletions.
2 changes: 1 addition & 1 deletion calibration-gui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>gov.llnl.gnem.apps.coda.calibration</groupId>
<artifactId>coda-calibration</artifactId>
<version>1.0.20</version>
<version>1.0.21</version>
</parent>

<artifactId>calibration-gui</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2023, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory
* CODE-743439.
* CODE-743439, CODE-848318.
* All rights reserved.
* This file is part of CCT. For details, see https://github.com/LLNL/coda-calibration-tool.
*
Expand Down Expand Up @@ -53,6 +53,7 @@
import gov.llnl.gnem.apps.coda.calibration.gui.controllers.ScreenshotEnabledController;
import gov.llnl.gnem.apps.coda.calibration.gui.controllers.ShapeController;
import gov.llnl.gnem.apps.coda.calibration.gui.controllers.SiteController;
import gov.llnl.gnem.apps.coda.calibration.gui.controllers.SpectraRatioLoadingController;
import gov.llnl.gnem.apps.coda.calibration.gui.controllers.parameters.ParametersController;
import gov.llnl.gnem.apps.coda.calibration.gui.data.client.api.CalibrationClient;
import gov.llnl.gnem.apps.coda.calibration.gui.data.client.api.ParameterClient;
Expand Down Expand Up @@ -111,7 +112,7 @@ public class CodaGuiController {

private static final String SCREENSHOT_TITLE = "CERT_Screenshot";

private static final String ABOUT_TEXT = "Version 1.0.20";
private static final String ABOUT_TEXT = "Version 1.0.21";

@FXML
private Node rootElement;
Expand Down Expand Up @@ -186,6 +187,8 @@ public class CodaGuiController {

private ReferenceEventLoadingController refEventLoadingController;

private SpectraRatioLoadingController spectraRatioLoadingController;

private CalibrationClient calibrationClient;

private DirectoryChooser sacDirFileChooser = new DirectoryChooser();
Expand All @@ -197,6 +200,8 @@ public class CodaGuiController {
private FileChooser referenceEventFileChooser = new FileChooser();
private FileChooser psModelFileChooser = new FileChooser();
private FileChooser fiModelFileChooser = new FileChooser();
private DirectoryChooser ratioDirFileChooser = new DirectoryChooser();
private FileChooser ratioFileChooser = new FileChooser();
private final ExtensionFilter allFilesFilter = new ExtensionFilter("All Files", "*.*");

private ParamExporter paramExporter;
Expand Down Expand Up @@ -229,16 +234,17 @@ public class CodaGuiController {

@Autowired
public CodaGuiController(LeafletMapController cctMapController, CertLeafletMapController certMapController, WaveformClient waveformClient, EnvelopeLoadingController waveformLoadingController,
CodaParamLoadingController codaParamLoadingController, ReferenceEventLoadingController refEventLoadingController, CalibrationClient calibrationClient, ParamExporter paramExporter,
LoadRatioEventsGuiController ratioLoadGui, WaveformGui waveformGui, DataController data, EventTableController eventTable, ParametersController param, ShapeController shape,
PathController path, SiteController site, MeasuredMwsController measuredMws, ParameterClient configClient, EnvelopeGuiController envelopeGui, SpectraRatioGuiController spectraGui,
HostnameVerifier hostnameVerifier, SSLContext sslContext, Environment env, EventBus bus) {
CodaParamLoadingController codaParamLoadingController, ReferenceEventLoadingController refEventLoadingController, SpectraRatioLoadingController spectraRatioLoadingController,
CalibrationClient calibrationClient, ParamExporter paramExporter, LoadRatioEventsGuiController ratioLoadGui, WaveformGui waveformGui, DataController data, EventTableController eventTable,
ParametersController param, ShapeController shape, PathController path, SiteController site, MeasuredMwsController measuredMws, ParameterClient configClient,
EnvelopeGuiController envelopeGui, SpectraRatioGuiController spectraGui, HostnameVerifier hostnameVerifier, SSLContext sslContext, Environment env, EventBus bus) {
this.waveformClient = waveformClient;
this.cctMapController = cctMapController;
this.certMapController = certMapController;
this.envelopeLoadingController = waveformLoadingController;
this.codaParamLoadingController = codaParamLoadingController;
this.refEventLoadingController = refEventLoadingController;
this.spectraRatioLoadingController = spectraRatioLoadingController;
this.calibrationClient = calibrationClient;
this.paramExporter = paramExporter;
this.waveformGui = waveformGui;
Expand Down Expand Up @@ -283,6 +289,12 @@ public CodaGuiController(LeafletMapController cctMapController, CertLeafletMapCo
referenceEventFileChooser.getExtensionFilters().add(new ExtensionFilter("Reference Event Files (.txt,.dat)", "*.txt", "*.dat"));
referenceEventFileChooser.getExtensionFilters().add(allFilesFilter);

ratioFileChooser.setTitle("Load Coda Ratio Project File");
ratioFileChooser.getExtensionFilters().add(new ExtensionFilter("Coda Ratio Project File (.json)", "*.json"));
ratioFileChooser.getExtensionFilters().add(allFilesFilter);

ratioDirFileChooser.setTitle("Directory to save Coda Ratio Project");

eventTableRefreshFunction = () -> this.bus.post(new RefreshEventTableAction());
}

Expand Down Expand Up @@ -319,11 +331,6 @@ private void changeAppMode() {
}
}

@FXML
private void openWaveformLoadingWindow() {
Optional.ofNullable(sacFileChooser.showOpenMultipleDialog(rootElement.getScene().getWindow())).ifPresent(envelopeLoadingController::loadFiles);
}

@FXML
private void showMapWindow() {
Platform.runLater(() -> {
Expand Down Expand Up @@ -420,6 +427,11 @@ private void openFailureReportDisplay() {
bus.post(new ShowFailureReportEvent());
}

@FXML
private void openWaveformLoadingWindow() {
Optional.ofNullable(sacFileChooser.showOpenMultipleDialog(rootElement.getScene().getWindow())).ifPresent(envelopeLoadingController::loadFiles);
}

@FXML
private void openCalibrationDataSavingWindow(ActionEvent e) {
//Save all parameters to an archive file and prompt the user about where to save it.
Expand All @@ -440,6 +452,16 @@ private void openCalibrationDataSavingWindow(ActionEvent e) {
}
}

@FXML
private void openRatiosLoadingWindow() {
Optional.ofNullable(ratioFileChooser.showOpenMultipleDialog(rootElement.getScene().getWindow())).ifPresent(spectraRatioLoadingController::loadFiles);
}

@FXML
private void openRatiosSavingWindow() {
Optional.ofNullable(ratioDirFileChooser.showDialog(rootElement.getScene().getWindow())).ifPresent(spectraRatioLoadingController::saveToDirectory);
}

@FXML
private void openWaveformDirectorySavingWindow() {
Optional.ofNullable(sacDirFileChooser.showDialog(rootElement.getScene().getWindow())).ifPresent(envelopeLoadingController::saveToDirectory);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public GuiApplication() {
}

public GuiApplication(ConfigurableApplicationContext springContext, EventBus bus, ApplicationMode mode) {
this.springContext = springContext;
GuiApplication.springContext = springContext;
this.bus = bus;
GuiApplication.startupMode = mode;
}
Expand Down Expand Up @@ -117,7 +117,7 @@ public void init() throws Exception {

@Override
public void start(Stage primaryStage) throws Exception {
this.primaryStage = primaryStage;
GuiApplication.primaryStage = primaryStage;
try (InputStream icon1 = this.getClass().getResourceAsStream("/coda_32x32.png");
InputStream icon2 = this.getClass().getResourceAsStream("/coda_64x64.png");
InputStream icon3 = this.getClass().getResourceAsStream("/coda_128x128.png");
Expand Down Expand Up @@ -261,6 +261,6 @@ public Stage getPrimaryStage() {
}

public void setPrimaryStage(Stage primaryStage) {
this.primaryStage = primaryStage;
GuiApplication.primaryStage = primaryStage;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2023, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory
* CODE-743439.
* CODE-743439, CODE-848318.
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the “Licensee”); you may not use this file except in compliance with the License. You may obtain a copy of the License at:
Expand Down Expand Up @@ -298,7 +298,7 @@ public void initialize() {
stressPlot = plotFactory.basicPlot();
stressPlot.getTitle().setText("Apparent Stress (MPa)");
stressPlot.getTitle().setFontSize(16);
stressPlot.addAxes(plotFactory.axis(Axis.Type.LOG_X, "Measured"), plotFactory.axis(Axis.Type.LOG_Y, "Comparison"));
stressPlot.addAxes(plotFactory.axis(Axis.Type.LOG_X, "Observed"), plotFactory.axis(Axis.Type.LOG_Y, "Comparison"));
final AxisLimits stressXaxis = new AxisLimits(Axis.Type.X, 1.0, 1.0);
final AxisLimits stressYaxis = new AxisLimits(Axis.Type.Y, 1.0, 1.0);
stressPlot.setAxisLimits(stressXaxis, stressYaxis);
Expand Down Expand Up @@ -328,7 +328,7 @@ public void initialize() {
energyVsMomentPlot.attachToDisplayNode(energyVsMomentPane);

apparentStressVsMomentPlot = plotFactory.basicPlot();
apparentStressVsMomentPlot.getTitle().setText("Apparent Stress vs Moment");
apparentStressVsMomentPlot.getTitle().setText("Observed Stress vs Moment");
apparentStressVsMomentPlot.getTitle().setFontSize(16);
apparentStressVsMomentPlot.getTitle().setYOffset(0.92);
apparentStressVsMomentPlot.addAxes(plotFactory.axis(Axis.Type.X, "log10 Mo (N-m)"), plotFactory.axis(Axis.Type.LOG_Y, "App. Stress (MPa)"));
Expand Down Expand Up @@ -538,11 +538,13 @@ private void plotSpectra() {

final boolean showPoorlyConstrainedBanner = likelyPoorlyConstrained;

final MeasuredMwDetails specMwInfo = mwDetails;

spectraControllers.forEach(spc -> {
if (fittingSpectra != null && spc.shouldShowFits()) {
spc.getSpectralPlot().plotXYdata(toPlotPoints(selectedEventMeasurements, spc.getDataFunc()), fittingSpectra, null);
spc.getSpectralPlot().plotXYdata(toPlotPoints(selectedEventMeasurements, spc.getDataFunc()), fittingSpectra, specMwInfo, null);
} else {
spc.getSpectralPlot().plotXYdata(toPlotPoints(selectedEventMeasurements, spc.getDataFunc()), null, null);
spc.getSpectralPlot().plotXYdata(toPlotPoints(selectedEventMeasurements, spc.getDataFunc()), null, specMwInfo, null);
}
spc.getSpectraDataMap().putAll(mapSpectraToPoint(selectedEventMeasurements, spc.getDataFunc()));

Expand Down Expand Up @@ -702,9 +704,9 @@ protected void reloadData() {
}

double m0 = (1.5 * mw) + 9.1;
if (ev.getApparentStressInMpa() != null && ev.getApparentStressInMpa() != 0.0) {
if (ev.getEnergyStress() != null && ev.getEnergyStress() != 0.0) {
apparentStressVsMomentPlot.addPlotObject(
plotFactory.createSymbol(SymbolStyles.CIRCLE, "", m0, ev.getApparentStressInMpa(), Color.BLACK, Color.BLACK, Color.BLACK, ev.getEventId(), false));
plotFactory.createSymbol(SymbolStyles.CIRCLE, "", m0, ev.getEnergyStress(), Color.BLACK, Color.BLACK, Color.BLACK, ev.getEventId(), false));
}
if (ev.getCornerFreq() != null && ev.getCornerFreq() != 0.0) {
Symbol symbol = plotFactory.createSymbol(SymbolStyles.CIRCLE, "Data", ev.getCornerFreq(), m0, Color.BLACK, Color.BLACK, Color.BLACK, ev.getEventId(), false);
Expand Down Expand Up @@ -751,7 +753,7 @@ protected void reloadData() {
mwPlotSymbols.add(valSym);
}

final Double stress = ev.getApparentStressInMpa();
final Double stress = ev.getEnergyStress();
Double refStress = ev.getRefApparentStressInMpa();

if (stress != null) {
Expand Down
Loading

0 comments on commit dc96b1e

Please sign in to comment.