Skip to content

Commit

Permalink
CCT 1.0.4-M3 Release notes:
Browse files Browse the repository at this point in the history
Improvements and changes:
* Overall optimization for the GUI and calibration modules.
** Calibrations should take ~50% less memory on average and run %10-20 faster.
** The GUI panels should also load and refresh considerably faster as well.
* Group velocities used for selection criteria during calibration are now configurable. See the schema folder for examples of the new JSON block and the Parameters tab for the new table display.
* Data can now be filtered from use in calibration
** Data selection options:
*** From the data tab check the 'used' checkbox or multi-select and right click for a context menu to include/exclude more records at once
*** From shape, path, and site plots you can right click a plotted point and exclude the data that was used to generate that plot point (use with care as you can exclude more data than you expect this way, especially in path!)
*** From the map you can right click a station or event and include/exclude all records that match either that station or event
* Map will now auto (re)center to the data loaded if you tap the 'Map' button while the map is already open (this will also bring the map back to the front if its behind other windows).
* Measured and reference event information in the Site correction tab have been consolidated into a single Mw results table.
* The combined Mw table also includes the number of measurements used to make the measurement for the measured mw fields.
* The Mw results tab now also includes three plots for:
** Reference vs. Measured Mw
** Reference vs. Measured Stress
** Standard deviation of final calibrated measurement by event and frequency.
*** Sd plot is color coded by # of station records in the measurement
* The measured-mw json output for calibration will now include the reference event if there was one for that evid.
* We now remove auto-pick indicator AP picks on waveforms if a human moves the F marker. By moving the F marker this tells the auto-picker that the waveform has been human reviewed and it should not move the F marker during future calibrations.
* The waveform plot now also plots the synthetic out past the F marker as a dashed line. This is intended to help a human decide if the pick could be moved further out without affecting the fit too much.
* The calibration status update bar has been improved with some additional states showing how far along the calibration is.
* If a reference stress value is provided the Site calibration will weight that spectra evenly across all frequencies for that event (default is lower frequencies have higher weight).

Bugfixes:
* Fixed a bug where many overlapping points intersecting with the model line in the Shape tab could make some points stop responding to clicks for plotting purposes.
* The waveform plot should now immediately update and repaint the synthetic when you move the F marker (if it had one).
* Waveform plot won't try to plot a synthetic if the start happens before the expected GV onset for the phase. This criteria was already being used to exclude the synthetic during calibration anyway so no sense in plotting it!
* Workaround implemented for reported hang on Mac 10.13+ caused by a deadlock in the native Apple AWT implementation. The application should no longer occasionally hang on startup.

Known bugs:
* Data selection color changes to indicate used/not-used can be inconsistent until you refresh after excluding/including data on the plots and map. The de/selection does work, however.
  • Loading branch information
justinbarno committed May 7, 2019
1 parent a09d4b8 commit 89b9f48
Show file tree
Hide file tree
Showing 215 changed files with 5,047 additions and 1,584 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![Livermore logo](llnl-logo.gif)

The `Coda Calibration Tool` (CCT) is a Java based application for calibrating 1D shear wave coda measurement models to observed data using a much smaller set of reference MWs calculated from other means (waveform modeling, etc.).
<br/>These calibrated measurement models can then be used in other tools to generate coda MW measurements, source spectra, estimated stress drop, and other useful measurements against the rest of the events and any new data collected in the calibrated region.
<br/>These calibrated measurement models can then be used in other tools to generate coda MW measurements, source spectra, estimated stress, and other useful measurements against the rest of the events and any new data collected in the calibrated region.

> ***<sub>note</sub>*** <br/>
> The `Coda Calibration Tool` currently only does calibration; it requires data to be pre-processed for loading using other tools.
Expand Down Expand Up @@ -97,7 +97,7 @@ As of 1.0, CCT is capable of loading four basic file types
A simple space delimited text file of format:

```text
EVID MW [STRESS_DROP_IN_MPA|0.0]
EVID MW [APPARENT_STRESS_IN_MPA|0.0]
(e.g. 999999 5.1 0.0)
```
> ***<sub>note</sub>*** <br/>
Expand Down
4 changes: 4 additions & 0 deletions calibration-gui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@
<artifactId>mockito-junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,16 @@
import java.util.List;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

import gov.llnl.gnem.apps.coda.common.mapping.MapProperties;
import gov.llnl.gnem.apps.coda.common.mapping.WMSLayerDescriptor;

@Component
@Configuration
@ConfigurationProperties("app")
public class AppProperties {

private String baseTitle = "Coda Calibration";
private Integer height = 800;
private Integer width = 600;
private Boolean debugEnabled = false;
private Boolean debugEnabled = Boolean.FALSE;
private List<WMSLayerDescriptor> wmsLayers = new ArrayList<>();

public Boolean getDebugEnabled() {
Expand Down Expand Up @@ -75,9 +69,4 @@ public List<WMSLayerDescriptor> getWmsLayers() {
public void setWmsLayers(List<WMSLayerDescriptor> wmsLayers) {
this.wmsLayers = wmsLayers;
}

@Bean
public MapProperties getMapProperties() {
return new MapProperties().setLayers(wmsLayers);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
Expand All @@ -49,14 +48,16 @@
import gov.llnl.gnem.apps.coda.calibration.gui.data.client.api.CalibrationClient;
import gov.llnl.gnem.apps.coda.calibration.gui.data.exporters.ParamExporter;
import gov.llnl.gnem.apps.coda.calibration.gui.events.CalibrationStageShownEvent;
import gov.llnl.gnem.apps.coda.calibration.gui.events.MapIconActivationCallback;
import gov.llnl.gnem.apps.coda.calibration.gui.plotting.WaveformGui;
import gov.llnl.gnem.apps.coda.calibration.gui.util.CalibrationProgressListener;
import gov.llnl.gnem.apps.coda.calibration.model.messaging.CalibrationStatusEvent;
import gov.llnl.gnem.apps.coda.calibration.model.messaging.CalibrationStatusEvent.Status;
import gov.llnl.gnem.apps.coda.common.gui.controllers.ProgressGui;
import gov.llnl.gnem.apps.coda.common.gui.events.EnvelopeLoadCompleteEvent;
import gov.llnl.gnem.apps.coda.common.gui.data.client.api.WaveformClient;
import gov.llnl.gnem.apps.coda.common.gui.events.ShowFailureReportEvent;
import gov.llnl.gnem.apps.coda.common.gui.util.ProgressMonitor;
import gov.llnl.gnem.apps.coda.common.mapping.LeafletMapController;
import gov.llnl.gnem.apps.coda.common.mapping.api.GeoMap;
import javafx.application.Platform;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
Expand All @@ -79,11 +80,12 @@ public class CodaGuiController {
@FXML
private Node rootElement;

private WaveformGui waveformGui;
private DataController data;
private ParametersController param;
private ShapeController shape;
private PathController path;
private SiteController site;
private SiteController site;

@FXML
private Tab dataTab;
Expand Down Expand Up @@ -117,7 +119,9 @@ public class CodaGuiController {

private Label showMapIcon;

private LeafletMapController mapController;
private GeoMap mapController;

private WaveformClient waveformClient;

private EnvelopeLoadingController envelopeLoadingController;

Expand Down Expand Up @@ -153,16 +157,18 @@ public class CodaGuiController {
});

@Autowired
public CodaGuiController(LeafletMapController mapController, EnvelopeLoadingController waveformLoadingController, CodaParamLoadingController codaParamLoadingController,
ReferenceEventLoadingController refEventLoadingController, CalibrationClient calibrationClient, ParamExporter paramExporter, DataController data, ParametersController param,
ShapeController shape, PathController path, SiteController site, EventBus bus) throws IOException {
public CodaGuiController(GeoMap mapController, WaveformClient waveformClient, EnvelopeLoadingController waveformLoadingController, CodaParamLoadingController codaParamLoadingController,
ReferenceEventLoadingController refEventLoadingController, CalibrationClient calibrationClient, ParamExporter paramExporter, WaveformGui waveformGui, DataController data,
ParametersController param, ShapeController shape, PathController path, SiteController site, EventBus bus) throws IOException {
super();
this.mapController = mapController;
this.waveformClient = waveformClient;
this.envelopeLoadingController = waveformLoadingController;
this.codaParamLoadingController = codaParamLoadingController;
this.refEventLoadingController = refEventLoadingController;
this.calibrationClient = calibrationClient;
this.paramExporter = paramExporter;
this.waveformGui = waveformGui;
this.data = data;
this.param = param;
this.shape = shape;
Expand Down Expand Up @@ -213,6 +219,11 @@ private void showMapWindow() {
});
}

@FXML
private void openWaveformDisplay() {
waveformGui.toFront();
}

@FXML
private void openFailureReportDisplay() {
bus.post(new ShowFailureReportEvent());
Expand Down Expand Up @@ -295,21 +306,24 @@ private void openMdacFiWindow() {

@FXML
private void runCalibration() {
calibrationClient.runCalibration(Boolean.FALSE).subscribe(value -> log.trace(value.toString()), err -> log.trace(err.getMessage(), err));
calibrationClient.runCalibration(Boolean.FALSE).subscribe(value -> log.trace(value), err -> log.trace(err.getMessage(), err));
}

@FXML
private void clearData() {
calibrationClient.clearData().subscribe(value -> log.trace(value.toString()), err -> log.trace(err.getMessage(), err));
calibrationClient.clearData().subscribe(value -> log.trace(value), err -> log.trace(err.getMessage(), err), () -> dataRefresh.run());
}

@FXML
private void runAutoPickingCalibration() {
calibrationClient.runCalibration(Boolean.TRUE).subscribe(value -> log.trace(value.toString()), err -> log.trace(err.getMessage(), err));
calibrationClient.runCalibration(Boolean.TRUE).subscribe(value -> log.trace(value), err -> log.trace(err.getMessage(), err));
}

@FXML
public void initialize() {

mapController.registerEventCallback(new MapIconActivationCallback(waveformClient));

activeMapIcon = makeMapLabel();
showMapIcon = makeMapLabel();

Expand Down Expand Up @@ -396,14 +410,29 @@ private void listener(CalibrationStatusEvent event) {

if (event.getStatus() == Status.COMPLETE || event.getStatus() == Status.ERROR) {
final ProgressMonitor monitor = monitors.remove(event.getId());
monitor.setProgressStage("Finished");
service.schedule(() -> loadingGui.removeProgressMonitor(monitor), 15, TimeUnit.MINUTES);
}
}
} else {
ProgressMonitor monitor = monitors.get(event.getId());
if (monitor != null) {
switch (event.getStatus()) {
case PEAK_STARTING:
monitor.setProgressStage("Peak starting");
break;
case SHAPE_STARTING:
monitor.setProgressStage("Shape starting");
break;
case PATH_STARTING:
monitor.setProgressStage("Path starting");
break;
case SITE_STARTING:
monitor.setProgressStage("Site starting");
break;
default:
break;

@Subscribe
private void listener(EnvelopeLoadCompleteEvent evt) {
if (dataTab.isSelected()) {
CompletableFuture.runAsync(dataRefresh);
}
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public void stop() throws Exception {
springContext.stop();
springContext.close();
}).get(1, TimeUnit.SECONDS);
} catch (TimeoutException | ExecutionException | CancellationException | InterruptedException e) {
} catch (TimeoutException | ExecutionException | CancellationException e) {
}
Platform.exit();
System.exit(0);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright (c) 2019, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory
* CODE-743439.
* 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:
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and limitations under the license.
*
* This work was performed under the auspices of the U.S. Department of Energy
* by Lawrence Livermore National Laboratory under Contract DE-AC52-07NA27344.
*/
package gov.llnl.gnem.apps.coda.calibration.gui;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

import gov.llnl.gnem.apps.coda.common.mapping.MapProperties;

@Configuration
@Component
public class MapConfig {

private AppProperties props;

public MapConfig(AppProperties props) {
super();
this.props = props;
}

@Bean
public MapProperties getMapProperties() {
return new MapProperties().setLayers(props.getWmsLayers());
}
}
Loading

0 comments on commit 89b9f48

Please sign in to comment.