diff --git a/README.md b/README.md index 628caf7d..4d04a723 100644 --- a/README.md +++ b/README.md @@ -42,18 +42,18 @@ We don't presently deploy versioned artifacts into a public repository like the #### **As a single runnable JAR** ```shell -java -jar coda-calibration/calibration-standalone/target/calibration-standalone-1.0.10-runnable.jar +java -jar coda-calibration/calibration-standalone/target/calibration-standalone-1.0.11-runnable.jar ``` #### **GUI alone** ```shell -java -jar coda-calibration/calibration-gui/target/calibration-gui-1.0.10-runnable.jar +java -jar coda-calibration/calibration-gui/target/calibration-gui-1.0.11-runnable.jar ``` #### **Calibration REST service alone** ```shell -java -jar coda-calibration/calibration-service/application/target/application-1.0.10-runnable.jar +java -jar coda-calibration/calibration-service/application/target/application-1.0.11-runnable.jar ``` #### A note about HTTPS diff --git a/calibration-gui/pom.xml b/calibration-gui/pom.xml index 6a7282a2..578be632 100644 --- a/calibration-gui/pom.xml +++ b/calibration-gui/pom.xml @@ -7,7 +7,7 @@ gov.llnl.gnem.apps.coda.calibration coda-calibration - 1.0.10 + 1.0.11 calibration-gui @@ -46,10 +46,6 @@ gov.llnl.gnem.apps.coda.calibration externals - - gov.llnl.gnem.apps.coda.common - common-gui - gov.llnl.gnem.apps.coda.common mapping @@ -189,13 +185,6 @@ prepare-package - - gov.llnl.gnem.apps.coda.common - common-gui - ${project.version} - ** - gov/** - gov.llnl.gnem.apps.coda.common mapping diff --git a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/CodaGuiController.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/CodaGuiController.java index 5e22855f..e183fda6 100644 --- a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/CodaGuiController.java +++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/CodaGuiController.java @@ -68,6 +68,7 @@ import gov.llnl.gnem.apps.coda.common.gui.util.SnapshotUtils; import gov.llnl.gnem.apps.coda.common.mapping.api.GeoMap; import gov.llnl.gnem.apps.coda.common.model.domain.Pair; +import gov.llnl.gnem.apps.coda.envelope.gui.EnvelopeGuiController; import javafx.application.Platform; import javafx.event.ActionEvent; import javafx.fxml.FXML; @@ -134,6 +135,8 @@ public class CodaGuiController { @FXML private CheckMenuItem waveformFocus; + + private EnvelopeGuiController envelopeGui; private Label activeMapIcon; @@ -142,7 +145,7 @@ public class CodaGuiController { private GeoMap mapController; private WaveformClient waveformClient; - + private ParameterClient configClient; private EnvelopeLoadingController envelopeLoadingController; @@ -184,7 +187,8 @@ public class CodaGuiController { @Autowired 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, MeasuredMwsController measuredMws, ParameterClient configClient, EventBus bus) { + ParametersController param, ShapeController shape, PathController path, SiteController site, MeasuredMwsController measuredMws, ParameterClient configClient, EnvelopeGuiController envelopeGui, + EventBus bus) { super(); this.mapController = mapController; this.waveformClient = waveformClient; @@ -201,6 +205,7 @@ public CodaGuiController(GeoMap mapController, WaveformClient waveformClient, En this.site = site; this.measuredMws = measuredMws; this.configClient = configClient; + this.envelopeGui = envelopeGui; this.bus = bus; bus.register(this); @@ -225,7 +230,7 @@ public CodaGuiController(GeoMap mapController, WaveformClient waveformClient, En fiModelFileChooser.getExtensionFilters().add(allFilesFilter); referenceEventFileChooser.getExtensionFilters().add(new ExtensionFilter("Reference Event Files (.txt,.dat)", "*.txt", "*.dat")); - referenceEventFileChooser.getExtensionFilters().add(allFilesFilter); + referenceEventFileChooser.getExtensionFilters().add(allFilesFilter); } @FXML @@ -420,6 +425,11 @@ private void refreshTab(ActionEvent e) { activeTabRefresh.run(); } + @FXML + private void openEnvelopeTool(ActionEvent e) { + envelopeGui.toFront(); + } + @FXML private void snapshotTab(ActionEvent e) { File folder = screenshotFolderChooser.showDialog(rootElement.getScene().getWindow()); @@ -463,7 +473,7 @@ private void listener(UpdateMapPolygonEvent event) { mapController.setPolygonGeoJSON(event.getGeoJSON()); } } - + //TODO: Move this to a controller @Subscribe private void listener(CalibrationStatusEvent event) { diff --git a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/GuiApplication.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/GuiApplication.java index 26372a6a..5efeefd4 100644 --- a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/GuiApplication.java +++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/GuiApplication.java @@ -15,7 +15,9 @@ package gov.llnl.gnem.apps.coda.calibration.gui; import java.io.IOException; +import java.io.InputStream; import java.net.URL; +import java.util.Locale; import java.util.TimeZone; import java.util.concurrent.CancellationException; import java.util.concurrent.CompletableFuture; @@ -54,6 +56,8 @@ @SpringBootApplication @ComponentScan("gov.llnl.gnem.apps.coda.common.mapping") @ComponentScan("gov.llnl.gnem.apps.coda.common.gui") +@ComponentScan("gov.llnl.gnem.apps.coda.envelope.model") +@ComponentScan("gov.llnl.gnem.apps.coda.envelope.gui") @ComponentScan("gov.llnl.gnem.apps.coda.calibration.gui") public class GuiApplication extends Application { @@ -67,6 +71,7 @@ public class GuiApplication extends Application { @PostConstruct void started() { + Locale.setDefault(Locale.ENGLISH); TimeZone.setDefault(TimeZone.getTimeZone("UTC")); } @@ -98,10 +103,15 @@ public void init() throws Exception { @Override public void start(Stage primaryStage) throws Exception { this.primaryStage = primaryStage; - primaryStage.getIcons().add(new Image(this.getClass().getResourceAsStream("/coda_32x32.png"))); - primaryStage.getIcons().add(new Image(this.getClass().getResourceAsStream("/coda_64x64.png"))); - primaryStage.getIcons().add(new Image(this.getClass().getResourceAsStream("/coda_128x128.png"))); - primaryStage.getIcons().add(new Image(this.getClass().getResourceAsStream("/coda_256x256.png"))); + 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"); + InputStream icon4 = this.getClass().getResourceAsStream("/coda_256x256.png");) { + primaryStage.getIcons().add(new Image(icon1)); + primaryStage.getIcons().add(new Image(icon2)); + primaryStage.getIcons().add(new Image(icon3)); + primaryStage.getIcons().add(new Image(icon4)); + } primaryStage.setOnCloseRequest((evt) -> Platform.exit()); primaryStage.setOnShown((evt) -> bus.post(new CalibrationStageShownEvent())); diff --git a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/AbstractMeasurementController.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/AbstractMeasurementController.java index 5d19be9d..98551ee2 100644 --- a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/AbstractMeasurementController.java +++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/AbstractMeasurementController.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2020, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory +* Copyright (c) 2021, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory * CODE-743439. * All rights reserved. * @@ -30,6 +30,7 @@ import java.util.Collections; import java.util.DoubleSummaryStatistics; import java.util.HashMap; +import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Map.Entry; @@ -37,6 +38,7 @@ import java.util.Observable; import java.util.Observer; import java.util.Optional; +import java.util.Stack; import java.util.concurrent.atomic.AtomicReference; import java.util.function.BiConsumer; import java.util.function.Consumer; @@ -75,6 +77,7 @@ import gov.llnl.gnem.apps.coda.common.mapping.api.GeoMap; import gov.llnl.gnem.apps.coda.common.model.domain.Event; import gov.llnl.gnem.apps.coda.common.model.domain.Pair; +import gov.llnl.gnem.apps.coda.common.model.domain.SharedFrequencyBandParameters; import gov.llnl.gnem.apps.coda.common.model.domain.Waveform; import gov.llnl.gnem.apps.coda.common.model.messaging.WaveformChangeEvent; import javafx.application.Platform; @@ -100,16 +103,19 @@ import javafx.scene.input.MouseButton; import javafx.scene.layout.StackPane; import llnl.gnem.core.gui.plotting.HorizPinEdge; +import llnl.gnem.core.gui.plotting.Limits; import llnl.gnem.core.gui.plotting.PaintMode; import llnl.gnem.core.gui.plotting.PenStyle; import llnl.gnem.core.gui.plotting.PlotObjectClicked; import llnl.gnem.core.gui.plotting.SymbolLegend; import llnl.gnem.core.gui.plotting.SymbolLegend.SymbolTextPair; import llnl.gnem.core.gui.plotting.VertPinEdge; +import llnl.gnem.core.gui.plotting.ZoomLimits; import llnl.gnem.core.gui.plotting.color.ColorMap; import llnl.gnem.core.gui.plotting.color.ViridisColorMap; import llnl.gnem.core.gui.plotting.jmultiaxisplot.JMultiAxisPlot; import llnl.gnem.core.gui.plotting.jmultiaxisplot.JSubplot; +import llnl.gnem.core.gui.plotting.jmultiaxisplot.SubplotZoomData; import llnl.gnem.core.gui.plotting.plotobject.Circle; import llnl.gnem.core.gui.plotting.plotobject.Line; import llnl.gnem.core.gui.plotting.plotobject.PlotObject; @@ -270,7 +276,7 @@ public abstract class AbstractMeasurementController implements MapListeningContr } }; - //TODO: Break this up into components so this isn't so incredibly huge. + // TODO: Break this up into components so this isn't so incredibly huge. public AbstractMeasurementController(SpectraClient spectraClient, ParameterClient paramClient, EventClient referenceEventClient, WaveformClient waveformClient, SymbolStyleMapFactory styleFactory, GeoMap map, MapPlottingUtilities iconFactory, EventBus bus) { this.spectraClient = spectraClient; @@ -368,8 +374,8 @@ public void initialize() { }); evidCombo.valueProperty().addListener((observable, oldValue, newValue) -> { - if (newValue != null && !newValue.equals(oldValue)) { - refreshView(); + if (newValue != null && !newValue.equals(oldValue) && isVisible) { + refreshViewAndZoomOut(); } }); @@ -392,11 +398,11 @@ public void initialize() { CellBindingUtils.attachTextCellFactories(measuredMwUq2LowCol, MeasuredMwDetails::getMw2Min, dfmt4); CellBindingUtils.attachTextCellFactories(measuredMwUq2HighCol, MeasuredMwDetails::getMw2Max, dfmt4); - iterationsCol.setCellValueFactory(x -> Bindings.createIntegerBinding(() -> Optional.ofNullable(x).map(CellDataFeatures::getValue).map(MeasuredMwDetails::getIterations).orElseGet(() -> 0)) - .asObject()); + iterationsCol.setCellValueFactory( + x -> Bindings.createIntegerBinding(() -> Optional.ofNullable(x).map(CellDataFeatures::getValue).map(MeasuredMwDetails::getIterations).orElseGet(() -> 0)).asObject()); - dataCountCol.setCellValueFactory(x -> Bindings.createIntegerBinding(() -> Optional.ofNullable(x).map(CellDataFeatures::getValue).map(MeasuredMwDetails::getDataCount).orElseGet(() -> 0)) - .asObject()); + dataCountCol.setCellValueFactory( + x -> Bindings.createIntegerBinding(() -> Optional.ofNullable(x).map(CellDataFeatures::getValue).map(MeasuredMwDetails::getDataCount).orElseGet(() -> 0)).asObject()); iconCol.setCellValueFactory(x -> Bindings.createObjectBinding(() -> Optional.ofNullable(x).map(CellDataFeatures::getValue).map(pp -> { BufferedImage iconLayer = SymbolFactory.createSymbol(pp.getStyle(), 0, 0, 2.0, pp.getColor(), Color.BLACK, pp.getColor(), "", true, false, 10.0).getBufferedImage(216); @@ -409,7 +415,7 @@ public void initialize() { g.drawImage(iconLayer, 20, 20, null); g.dispose(); - ImageView imView = new ImageView(SwingFXUtils.toFXImage(combined, null)); + ImageView imView = new ImageView(SwingFXUtils.toFXImage(combined, null)); imView.setFitHeight(16); imView.setFitWidth(16); return imView; @@ -460,12 +466,14 @@ private void plotSpectra() { fittingSpectra.add(referenceSpectra); Spectra validationSpectra = spectraClient.getValidationSpectra(evidCombo.getSelectionModel().getSelectedItem()).block(Duration.ofSeconds(2)); fittingSpectra.add(validationSpectra); - if (filteredMeasurements != null && filteredMeasurements.size() > 0 && filteredMeasurements.get(0).getWaveform() != null) { + if (filteredMeasurements != null && !filteredMeasurements.isEmpty() && filteredMeasurements.get(0).getWaveform() != null) { Event event = filteredMeasurements.get(0).getWaveform().getEvent(); eventTime.setText("Date: " + DateTimeFormatter.ISO_INSTANT.format(event.getOriginTime().toInstant())); eventLoc.setText("Lat: " + dfmt4.format(event.getLatitude()) + " Lon: " + dfmt4.format(event.getLongitude())); eventTime.setVisible(true); eventLoc.setVisible(true); + } else { + filteredMeasurements = Collections.emptyList(); } } else { eventTime.setVisible(false); @@ -474,23 +482,25 @@ private void plotSpectra() { fittingSpectra = null; } + final List selectedEventMeasurements = filteredMeasurements; + spectraControllers.forEach(spc -> { if (fittingSpectra != null) { - spc.getSpectralPlot().plotXYdata(toPlotPoints(filteredMeasurements, spc.getDataFunc()), SHOW_LEGEND, fittingSpectra); + spc.getSpectralPlot().plotXYdata(toPlotPoints(selectedEventMeasurements, spc.getDataFunc()), SHOW_LEGEND, fittingSpectra); } else { - spc.getSpectralPlot().plotXYdata(toPlotPoints(filteredMeasurements, spc.getDataFunc()), HIDE_LEGEND); + spc.getSpectralPlot().plotXYdata(toPlotPoints(selectedEventMeasurements, spc.getDataFunc()), HIDE_LEGEND); } - spc.getSymbolMap().putAll(mapSpectraToPoint(filteredMeasurements, spc.getDataFunc())); + spc.getSymbolMap().putAll(mapSpectraToPoint(selectedEventMeasurements, spc.getDataFunc())); }); - mapMeasurements(filteredMeasurements); + mapMeasurements(selectedEventMeasurements); minY.set(100.0); maxY.set(0.0); - DoubleSummaryStatistics stats = filteredMeasurements.stream() - .filter(Objects::nonNull) - .map(spec -> spec.getPathAndSiteCorrected()) - .filter(v -> v != 0.0) - .collect(Collectors.summarizingDouble(Double::doubleValue)); + DoubleSummaryStatistics stats = selectedEventMeasurements.stream() + .filter(Objects::nonNull) + .map(spec -> spec.getPathAndSiteCorrected()) + .filter(v -> v != 0.0) + .collect(Collectors.summarizingDouble(Double::doubleValue)); maxY.set(stats.getMax() + .1); minY.set(stats.getMin() - .1); @@ -499,9 +509,11 @@ private void plotSpectra() { private void mapMeasurements(List measurements) { if (measurements != null) { - mapImpl.addIcons(iconFactory.genIconsFromWaveforms(eventSelectionCallback, - stationSelectionCallback, - measurements.stream().map(m -> m.getWaveform()).filter(Objects::nonNull).collect(Collectors.toList()))); + mapImpl.addIcons( + iconFactory.genIconsFromWaveforms( + eventSelectionCallback, + stationSelectionCallback, + measurements.stream().map(m -> m.getWaveform()).filter(Objects::nonNull).collect(Collectors.toList()))); } } @@ -516,24 +528,29 @@ private List filterToEvent(String selectedItem, List mapSpectraToPoint(List spectralMeasurements, Function func) { return spectralMeasurements.stream() .filter(spectra -> !func.apply(spectra).equals(0.0)) - .collect(Collectors.toMap(spectra -> new Point2D.Double(Math.log10(centerFreq(spectra.getWaveform().getLowFrequency(), spectra.getWaveform().getHighFrequency())), - func.apply(spectra)), - Function.identity(), - (a, b) -> b, - HashMap::new)); + .collect( + Collectors.toMap( + spectra -> new Point2D.Double(Math.log10(centerFreq(spectra.getWaveform().getLowFrequency(), spectra.getWaveform().getHighFrequency())), + func.apply(spectra)), + Function.identity(), + (a, b) -> b, + HashMap::new)); } private List toPlotPoints(List spectralMeasurements, Function func) { List list = spectralMeasurements.stream() .filter(spectra -> !func.apply(spectra).equals(0.0)) - .filter(spectra -> spectra != null && spectra.getWaveform() != null && spectra.getWaveform().getStream() != null - && spectra.getWaveform().getStream().getStation() != null) + .filter( + spectra -> spectra != null + && spectra.getWaveform() != null + && spectra.getWaveform().getStream() != null + && spectra.getWaveform().getStream().getStation() != null) .map(spectra -> { String key = spectra.getWaveform().getStream().getStation().getStationName(); PlotPoint pp = getPlotPoint(key, spectra.getWaveform().isActive()); PlotPoint point = new LabeledPlotPoint(key, - new PlotPoint(Math.log10(centerFreq(spectra.getWaveform().getLowFrequency(), - spectra.getWaveform().getHighFrequency())), + new PlotPoint(Math.log10( + centerFreq(spectra.getWaveform().getLowFrequency(), spectra.getWaveform().getHighFrequency())), func.apply(spectra), pp.getStyle(), pp.getColor())); @@ -556,8 +573,13 @@ private PlotPoint getPlotPoint(String key, boolean active) { } private boolean hasEventAndStation(SpectraMeasurement spectra) { - return spectra != null && spectra.getWaveform() != null && spectra.getWaveform().getEvent() != null && spectra.getWaveform().getEvent().getEventId() != null - && spectra.getWaveform().getStream() != null && spectra.getWaveform().getStream().getStation() != null && spectra.getWaveform().getStream().getStation().getStationName() != null; + return spectra != null + && spectra.getWaveform() != null + && spectra.getWaveform().getEvent() != null + && spectra.getWaveform().getEvent().getEventId() != null + && spectra.getWaveform().getStream() != null + && spectra.getWaveform().getStream().getStation() != null + && spectra.getWaveform().getStream().getStation().getStationName() != null; } private double centerFreq(Double lowFrequency, Double highFrequency) { @@ -570,215 +592,217 @@ protected void reloadData() { maxFreq.set(-0.0); minFreq.set(1.0); - DoubleSummaryStatistics stats = paramClient.getSharedFrequencyBandParameters() - .filter(Objects::nonNull) - .collectList() - .block(Duration.of(10l, ChronoUnit.SECONDS)) - .stream() + List results = paramClient.getSharedFrequencyBandParameters().filter(Objects::nonNull).collectList().block(Duration.of(10l, ChronoUnit.SECONDS)); + + if (results != null) { + DoubleSummaryStatistics stats = results.stream() .map(sfb -> Math.log10(centerFreq(sfb.getLowFrequency(), sfb.getHighFrequency()))) .collect(Collectors.summarizingDouble(Double::doubleValue)); - maxFreq.set(stats.getMax()); - minFreq.set(stats.getMin()); - - preloadData(); - spectralMeasurements.clear(); - spectralMeasurements.addAll(getSpectraData()); - - runGuiUpdate(() -> { - mwParameters.clear(); - mwPlotFigure.Clear(); - stressPlotFigure.Clear(); - sdPlotFigure.Clear(); - mwPlotFigure.AddPlotObject(mwZeroLine); - stressPlotFigure.AddPlotObject(stressZeroLine); - List evs = getEvents(); - - double minMw = 10.0; - double maxMw = 0.0; - double minStress = 1.0; - double maxStress = 0.0; - for (MeasuredMwDetails ev : evs) { - mwParameters.add(ev); - - if (ev.getMw() != null && ev.getMw() != 0.0) { - Double mw = ev.getMw(); - if (mw < minMw) { - minMw = mw; - } - if (mw > maxMw) { - maxMw = mw; - } - - Double valMw = ev.getValMw(); - if (valMw != null && valMw != 0.0) { - if (valMw < minMw) { - minMw = valMw; + maxFreq.set(stats.getMax()); + minFreq.set(stats.getMin()); + + preloadData(); + spectralMeasurements.clear(); + spectralMeasurements.addAll(getSpectraData()); + + runGuiUpdate(() -> { + mwParameters.clear(); + mwPlotFigure.Clear(); + stressPlotFigure.Clear(); + sdPlotFigure.Clear(); + mwPlotFigure.AddPlotObject(mwZeroLine); + stressPlotFigure.AddPlotObject(stressZeroLine); + List evs = getEvents(); + + double minMw = 10.0; + double maxMw = 0.0; + double minStress = 1.0; + double maxStress = 0.0; + for (MeasuredMwDetails ev : evs) { + mwParameters.add(ev); + + if (ev.getMw() != null && ev.getMw() != 0.0) { + Double mw = ev.getMw(); + if (mw < minMw) { + minMw = mw; } - if (valMw > maxMw) { - maxMw = valMw; + if (mw > maxMw) { + maxMw = mw; } - Square valSym = new Square(mw, valMw, 2.2, Color.BLACK, Color.BLACK, Color.BLACK, ev.getEventId(), true, false, 6.0); - mwPlotFigure.AddPlotObject(valSym); - } + Double valMw = ev.getValMw(); + if (valMw != null && valMw != 0.0) { + if (valMw < minMw) { + minMw = valMw; + } + if (valMw > maxMw) { + maxMw = valMw; + } - if (ev.getRefMw() != null && ev.getRefMw() != 0.0) { - Double ref = ev.getRefMw(); - if (ref < minMw) { - minMw = ref; - } - if (ref > maxMw) { - maxMw = ref; + Square valSym = new Square(mw, valMw, 2.2, Color.BLACK, Color.BLACK, Color.BLACK, ev.getEventId(), true, false, 6.0); + mwPlotFigure.AddPlotObject(valSym); } - Circle mwSym = new Circle(mw, ref, 2.0, Color.RED, Color.RED, Color.RED, ev.getEventId(), true, false, 6.0); - mwPlotFigure.AddPlotObject(mwSym); - } - - Double stress = ev.getApparentStressInMpa(); - Double refStress = ev.getRefApparentStressInMpa(); + if (ev.getRefMw() != null && ev.getRefMw() != 0.0) { + Double ref = ev.getRefMw(); + if (ref < minMw) { + minMw = ref; + } + if (ref > maxMw) { + maxMw = ref; + } - if (stress != null) { - if (stress < minStress) { - minStress = stress; - } - if (stress > maxStress) { - maxStress = stress; + Circle mwSym = new Circle(mw, ref, 2.0, Color.RED, Color.RED, Color.RED, ev.getEventId(), true, false, 6.0); + mwPlotFigure.AddPlotObject(mwSym); } - if (refStress == null) { - refStress = 0.0; - } + Double stress = ev.getApparentStressInMpa(); + Double refStress = ev.getRefApparentStressInMpa(); - Double valStress = ev.getValApparentStressInMpa(); - if (valStress != null && valStress != 0.0) { - if (valStress < minStress) { - minStress = valStress; + if (stress != null) { + if (stress < minStress) { + minStress = stress; } - if (valStress > maxStress) { - maxStress = valStress; + if (stress > maxStress) { + maxStress = stress; } - Square valSym = new Square(stress, valStress, 2.2, Color.BLACK, Color.BLACK, Color.BLACK, ev.getEventId(), true, false, 6.0); - stressPlotFigure.AddPlotObject(valSym); - } - - if (refStress != null && refStress != 0.0) { - if (refStress < minStress) { - minStress = refStress; + if (refStress == null) { + refStress = 0.0; } - if (refStress > maxStress) { - maxStress = refStress; + + Double valStress = ev.getValApparentStressInMpa(); + if (valStress != null && valStress != 0.0) { + if (valStress < minStress) { + minStress = valStress; + } + if (valStress > maxStress) { + maxStress = valStress; + } + + Square valSym = new Square(stress, valStress, 2.2, Color.BLACK, Color.BLACK, Color.BLACK, ev.getEventId(), true, false, 6.0); + stressPlotFigure.AddPlotObject(valSym); } - Circle stressSym = new Circle(stress, refStress, 2.0, Color.RED, Color.RED, Color.RED, ev.getEventId(), true, false, 6.0); - stressPlotFigure.AddPlotObject(stressSym); + if (refStress != null && refStress != 0.0) { + if (refStress < minStress) { + minStress = refStress; + } + if (refStress > maxStress) { + maxStress = refStress; + } + + Circle stressSym = new Circle(stress, refStress, 2.0, Color.RED, Color.RED, Color.RED, ev.getEventId(), true, false, 6.0); + stressPlotFigure.AddPlotObject(stressSym); + } } } } - } - maxMw = maxMw + .1; - minMw = minMw > maxMw ? minMw = maxMw - .1 : minMw - .1; + maxMw = maxMw + .1; + minMw = minMw > maxMw ? minMw = maxMw - .1 : minMw - .1; - mwPlotFigure.setAxisLimits(minMw, maxMw, minMw, maxMw); + mwPlotFigure.setAxisLimits(minMw, maxMw, minMw, maxMw); - maxStress = maxStress + .1; - minStress = minStress > maxStress ? minStress = maxStress - .1 : minStress - .1; + maxStress = maxStress + .1; + minStress = minStress > maxStress ? minStress = maxStress - .1 : minStress - .1; - stressPlotFigure.setAxisLimits(minStress, maxStress, minStress, maxStress); - }); - - symbolStyleMap = symbolStyleMapFactory.build(spectralMeasurements, new Function() { - @Override - public String apply(SpectraMeasurement t) { - return t.getWaveform().getStream().getStation().getStationName(); - } - }); + stressPlotFigure.setAxisLimits(minStress, maxStress, minStress, maxStress); + }); - runGuiUpdate(() -> { - stationSymbols.clear(); - stationSymbols.addAll(symbolStyleMap.entrySet().stream().map(e -> new LabeledPlotPoint(e.getKey(), e.getValue())).collect(Collectors.toList())); - - Platform.runLater(() -> { - evids.clear(); - evids.add("All"); - evids.addAll(spectralMeasurements.stream() - .map(spec -> spec.getWaveform().getEvent().getEventId()) - .distinct() - .sorted(new MaybeNumericStringComparator()) - .collect(Collectors.toList())); - eventTable.sort(); + symbolStyleMap = symbolStyleMapFactory.build(spectralMeasurements, new Function() { + @Override + public String apply(SpectraMeasurement t) { + return t.getWaveform().getStream().getStation().getStationName(); + } }); - Map> evidStats = new HashMap<>(); + runGuiUpdate(() -> { + stationSymbols.clear(); + stationSymbols.addAll(symbolStyleMap.entrySet().stream().map(e -> new LabeledPlotPoint(e.getKey(), e.getValue())).collect(Collectors.toList())); + + Platform.runLater(() -> { + evids.clear(); + evids.add("All"); + evids.addAll( + spectralMeasurements.stream() + .map(spec -> spec.getWaveform().getEvent().getEventId()) + .distinct() + .sorted(new MaybeNumericStringComparator()) + .collect(Collectors.toList())); + eventTable.sort(); + }); - double minSite = 1E2; - double maxSite = -1E2; - double minFreq = 1E2; - double maxFreq = -1E2; - int minStations = 2; - int maxStations = 3; + Map> evidStats = new HashMap<>(); - for (SpectraMeasurement meas : spectralMeasurements) { - String evid = meas.getWaveform().getEvent().getEventId(); - Double freq = centerFreq(meas.getWaveform()); - evidStats.computeIfAbsent(evid, key -> new HashMap<>()).computeIfAbsent(freq, (key) -> new SummaryStatistics()).addValue(meas.getPathAndSiteCorrected()); - } + double minSite = 1E2; + double maxSite = -1E2; + double minFreq = 1E2; + double maxFreq = -1E2; + int minStations = 2; + int maxStations = 3; - for (Map freqStats : evidStats.values()) { - for (Entry entry : freqStats.entrySet()) { - double site = entry.getValue().getStandardDeviation(); - if (entry.getValue() != null && entry.getValue().getN() > 1) { - if (maxStations < entry.getValue().getN()) { - maxStations = (int) entry.getValue().getN(); - } - if (site < minSite) { - minSite = site; - } - if (site > maxSite) { - maxSite = site; - } - if (entry.getKey() < minFreq) { - minFreq = entry.getKey(); - } - if (entry.getKey() > maxFreq) { - maxFreq = entry.getKey(); + for (SpectraMeasurement meas : spectralMeasurements) { + String evid = meas.getWaveform().getEvent().getEventId(); + Double freq = centerFreq(meas.getWaveform()); + evidStats.computeIfAbsent(evid, key -> new HashMap<>()).computeIfAbsent(freq, (key) -> new SummaryStatistics()).addValue(meas.getPathAndSiteCorrected()); + } + + for (Map freqStats : evidStats.values()) { + for (Entry entry : freqStats.entrySet()) { + double site = entry.getValue().getStandardDeviation(); + if (entry.getValue() != null && entry.getValue().getN() > 1) { + if (maxStations < entry.getValue().getN()) { + maxStations = (int) entry.getValue().getN(); + } + if (site < minSite) { + minSite = site; + } + if (site > maxSite) { + maxSite = site; + } + if (entry.getKey() < minFreq) { + minFreq = entry.getKey(); + } + if (entry.getKey() > maxFreq) { + maxFreq = entry.getKey(); + } } } } - } - colorMap.setRange(minStations, maxStations); + colorMap.setRange(minStations, maxStations); - for (Map freqStats : evidStats.values()) { - for (Entry entry : freqStats.entrySet()) { - double site = entry.getValue().getStandardDeviation(); - if (entry.getValue() != null && entry.getValue().getN() > 1) { - Color color = colorMap.getColor(entry.getValue().getN()); - Circle sdSym = new Circle(entry.getKey(), site, 2.0, color, color, color, "", true, false, 6.0); - sdPlotFigure.AddPlotObject(sdSym); + for (Map freqStats : evidStats.values()) { + for (Entry entry : freqStats.entrySet()) { + double site = entry.getValue().getStandardDeviation(); + if (entry.getValue() != null && entry.getValue().getN() > 1) { + Color color = colorMap.getColor(entry.getValue().getN()); + Circle sdSym = new Circle(entry.getKey(), site, 2.0, color, color, color, "", true, false, 6.0); + sdPlotFigure.AddPlotObject(sdSym); + } } } - } - maxSite = maxSite + .1; - minSite = minSite > maxSite ? minSite = maxSite - .1 : minSite - .1; + maxSite = maxSite + .1; + minSite = minSite > maxSite ? minSite = maxSite - .1 : minSite - .1; - maxFreq = maxFreq + 5.0; - minFreq = minFreq > maxFreq ? minFreq = maxFreq - .1 : minFreq - 1.0; + maxFreq = maxFreq + 5.0; + minFreq = minFreq > maxFreq ? minFreq = maxFreq - .1 : minFreq - 1.0; - sdPlotFigure.setAxisLimits(minFreq, maxFreq, minSite, maxSite); - sdPlotFigure.AddPlotObject(createColorLegend(minStations, maxStations)); - }); + sdPlotFigure.setAxisLimits(minFreq, maxFreq, minSite, maxSite); + sdPlotFigure.AddPlotObject(createColorLegend(minStations, maxStations)); + }); + } runGuiUpdate(() -> { mwPlot.repaint(); stressPlot.repaint(); sdPlot.repaint(); }); + } catch (InvocationTargetException ex) { - //nop + // nop } catch (InterruptedException ex) { log.warn("Swing interrupt during re-plotting of controller", ex); Thread.currentThread().interrupt(); @@ -786,7 +810,8 @@ public String apply(SpectraMeasurement t) { } protected void preloadData() { - // Placeholder to allow children to overload any pre-fetching needed before data calls + // Placeholder to allow children to overload any pre-fetching needed before data + // calls } private PlotObject createColorLegend(int minVal, int maxVal) { @@ -816,14 +841,77 @@ private Double centerFreq(Waveform waveform) { return ((waveform.getHighFrequency() - waveform.getLowFrequency()) / 2.0) + waveform.getLowFrequency(); } + public List getZoomLimits() { + + List zLimits = new ArrayList<>(); + + // If no data is loaded, don't do anything + if (spectralMeasurements.isEmpty()) { + return zLimits; + } + + spectraControllers.forEach(spc -> { + + Limits xlimit = spc.getSpectralPlot().getSubplot().getLastXLimits(); + Limits ylimit = spc.getSpectralPlot().getSubplot().getLastYLimits(); + + Stack limits = spc.getSpectralPlot().getSubplotManager().getZoomLimits(spc.getSpectralPlot().getSubplot()); + + // If no zoom limits, doesn't matter, leave limits as null + if (limits.isEmpty()) { + zLimits.add(null); + } else { + // Save last zoom level + ZoomLimits newLimit = new ZoomLimits(xlimit, ylimit); + zLimits.add(newLimit); + } + }); + + return zLimits; + } + + public void setZoomLimits(List limits) { + + // Nothing to restore if zoomLimits is empty + if (!limits.isEmpty()) { + for (int i = 0; i < spectraControllers.size(); i++) { + + SpectraPlotController spc = spectraControllers.get(i); + + Iterator iter = spc.getSpectralPlot().getSubplotManager().iterator(); + + while (iter.hasNext()) { + SubplotZoomData zoomData = iter.next(); + + // Only restore zoom limit if there is one + if (limits.get(i) != null) { + zoomData.zoomIn(isVisible, limits.get(i)); + } + } + } + } + } + + public void refreshViewAndZoomOut() { + mapImpl.clearIcons(); + plotSpectra(); + + Platform.runLater(() -> { + spectraControllers.forEach(spc -> spc.getSpectralPlot().repaint()); + }); + } + @Override public void refreshView() { if (isVisible) { - mapImpl.clearIcons(); - plotSpectra(); - Platform.runLater(() -> { - spectraControllers.forEach(spc -> spc.getSpectralPlot().repaint()); - }); + + // Save current zoom limits + List limits = getZoomLimits(); + + refreshViewAndZoomOut(); + + // Restore zoom limits + setZoomLimits(limits); } } @@ -945,12 +1033,15 @@ private void listener(WaveformChangeEvent wce) { synchronized (spectralMeasurements) { Map activeMeasurements = spectralMeasurements.stream().collect(Collectors.toMap(x -> x.getWaveform().getId(), Function.identity())); if (wce.isAddOrUpdate()) { - waveformClient.getWaveformMetadataFromIds(nonNull).collect(Collectors.toList()).block(Duration.ofSeconds(10l)).forEach(md -> { - SpectraMeasurement measurement = activeMeasurements.get(md.getId()); - if (measurement != null) { - measurement.getWaveform().setActive(md.isActive()); - } - }); + List results = waveformClient.getWaveformMetadataFromIds(nonNull).collect(Collectors.toList()).block(Duration.ofSeconds(10l)); + if (results != null) { + results.forEach(md -> { + SpectraMeasurement measurement = activeMeasurements.get(md.getId()); + if (measurement != null) { + measurement.getWaveform().setActive(md.isActive()); + } + }); + } } else if (wce.isDelete()) { nonNull.forEach(id -> { SpectraMeasurement measurement = activeMeasurements.remove(id); @@ -972,9 +1063,9 @@ protected void handlePlotObjectClicked(Object obj, Function menu.hide()); } else if (SwingUtilities.isRightMouseButton(poc.getMouseEvent())) { showContextMenu(Collections.singletonList(spectra.getWaveform()), Collections.singletonList((Symbol) po), poc.getMouseEvent(), (objs, active) -> { @@ -1043,7 +1134,7 @@ private void removeRefEvents() { private void toggleValidationEvent() { List evs = new ArrayList<>(eventTable.getSelectionModel().getSelectedIndices().size()); eventTable.getSelectionModel().getSelectedIndices().forEach(i -> evs.add(mwParameters.get(i))); - if (evs != null && !evs.isEmpty()) { + if (!evs.isEmpty()) { referenceEventClient.toggleValidationEventsByEventId(evs.stream().map(mwd -> mwd.getEventId()).distinct().collect(Collectors.toList())) .doOnComplete(() -> Platform.runLater(() -> reloadData())) .subscribe(); diff --git a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/DataController.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/DataController.java index 7ebf9f2d..750f2366 100644 --- a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/DataController.java +++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/DataController.java @@ -236,7 +236,7 @@ public void initialize() { box.setStyle(""); } box.selectedProperty().addListener((obs, o, n) -> { - if (n != null && o != n) { + if (n != null && !o.equals(n)) { client.setWaveformsActiveByIds(Collections.singletonList(waveform.getId()), n).subscribe(); } }); diff --git a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/MeasuredMwsController.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/MeasuredMwsController.java index a5b36b48..4125f718 100644 --- a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/MeasuredMwsController.java +++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/MeasuredMwsController.java @@ -168,29 +168,31 @@ protected void preloadData() { .doOnError(err -> log.trace(err.getMessage(), err)) .doFinally((s) -> Platform.runLater(() -> progressGui.hide())) .block(Duration.of(1000l, ChronoUnit.SECONDS)); - fitSpectra.putAll(mfs.getFitSpectra()); - - List refEvs = referenceEventClient.getMeasuredEventDetails() - .filter(ev -> ev.getEventId() != null) - .collect(Collectors.toList()) - .subscribeOn(Schedulers.boundedElastic()) - .block(Duration.ofSeconds(10l)); - Collection measMws = mfs.getMeasuredMwDetails().values(); - - //Not terribly efficient but this list should never be huge so eh... - for (MeasuredMwDetails ref : refEvs) { - for (MeasuredMwDetails meas : measMws) { - if (meas.getEventId().equals(ref.getEventId())) { - meas.setRefMw(ref.getRefMw()); - meas.setRefApparentStressInMpa(ref.getRefApparentStressInMpa()); - meas.setValMw(ref.getValMw()); - meas.setValApparentStressInMpa(ref.getValApparentStressInMpa()); - break; + if (mfs != null) { + fitSpectra.putAll(mfs.getFitSpectra()); + + List refEvs = referenceEventClient.getMeasuredEventDetails() + .filter(ev -> ev.getEventId() != null) + .collect(Collectors.toList()) + .subscribeOn(Schedulers.boundedElastic()) + .block(Duration.ofSeconds(10l)); + Collection measMws = mfs.getMeasuredMwDetails().values(); + + //Not terribly efficient but this list should never be huge so eh... + for (MeasuredMwDetails ref : refEvs) { + for (MeasuredMwDetails meas : measMws) { + if (meas.getEventId().equals(ref.getEventId())) { + meas.setRefMw(ref.getRefMw()); + meas.setRefApparentStressInMpa(ref.getRefApparentStressInMpa()); + meas.setValMw(ref.getValMw()); + meas.setValApparentStressInMpa(ref.getValApparentStressInMpa()); + break; + } } } - } - mwDetails.addAll(measMws); + mwDetails.addAll(measMws); + } } @Override diff --git a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/ShapeController.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/ShapeController.java index ba55efbb..e3a16211 100644 --- a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/ShapeController.java +++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/ShapeController.java @@ -551,13 +551,16 @@ private void listener(WaveformChangeEvent wce) { List nonNull = wce.getIds().stream().filter(Objects::nonNull).collect(Collectors.toList()); synchronized (waveformIdMapping) { if (wce.isAddOrUpdate()) { - waveformClient.getWaveformMetadataFromIds(nonNull).collect(Collectors.toList()).block(Duration.ofSeconds(10l)).forEach(md -> { - Pair, List> pair = waveformIdMapping.get(md.getId()); - if (pair != null) { - pair.getLeft().forEach(v -> v.getWaveform().setActive(md.isActive())); - pair.getRight().forEach(v -> v.getWaveform().setActive(md.isActive())); - } - }); + List results = waveformClient.getWaveformMetadataFromIds(nonNull).collect(Collectors.toList()).block(Duration.ofSeconds(10l)); + if (results != null) { + results.forEach(md -> { + Pair, List> pair = waveformIdMapping.get(md.getId()); + if (pair != null) { + pair.getLeft().forEach(v -> v.getWaveform().setActive(md.isActive())); + pair.getRight().forEach(v -> v.getWaveform().setActive(md.isActive())); + } + }); + } Platform.runLater(() -> refreshView()); } } diff --git a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/parameters/ShapeConfigurationController.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/parameters/ShapeConfigurationController.java index 585ef432..fbac8440 100644 --- a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/parameters/ShapeConfigurationController.java +++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/controllers/parameters/ShapeConfigurationController.java @@ -43,6 +43,8 @@ public class ShapeConfigurationController { private static final Logger log = LoggerFactory.getLogger(ShapeConfigurationController.class); private final NumberFormat dfmt2 = NumberFormatFactory.twoDecimalOneLeadingZero(); + + private final NumberFormat dfmt4 = NumberFormatFactory.fourDecimalOneLeadingZero(); @FXML private TableView shapeVelConfTableView; @@ -140,6 +142,8 @@ public class ShapeConfigurationController { TableColumn iterations; @FXML TableColumn fittingPointCount; + @FXML + TableColumn lengthWeight; private ObservableList data = FXCollections.observableArrayList(); @@ -209,7 +213,8 @@ public void initialize() { CellBindingUtils.attachEditableTextCellFactories(maxGamma, ShapeFitterConstraints::getMaxGamma, ShapeFitterConstraints::setMaxGamma, dfmt2); CellBindingUtils.attachEditableIntegerCellFactories(iterations, ShapeFitterConstraints::getIterations, ShapeFitterConstraints::setIterations); CellBindingUtils.attachEditableIntegerCellFactories(fittingPointCount, ShapeFitterConstraints::getFittingPointCount, ShapeFitterConstraints::setFittingPointCount); - + CellBindingUtils.attachEditableTextCellFactories(lengthWeight, ShapeFitterConstraints::getLengthWeight, ShapeFitterConstraints::setLengthWeight, dfmt4); + shapeVelConfTableView.setItems(data); shapeBetaConfTableView.setItems(data); shapeGammaConfTableView.setItems(data); diff --git a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/data/client/CalibrationWebClient.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/data/client/CalibrationWebClient.java index 2c978947..04db5cf3 100644 --- a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/data/client/CalibrationWebClient.java +++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/data/client/CalibrationWebClient.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2018, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory +* Copyright (c) 2021, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory * CODE-743439. * All rights reserved. * This file is part of CCT. For details, see https://github.com/LLNL/coda-calibration-tool. @@ -42,7 +42,7 @@ public CalibrationWebClient(WebClient client) { @Override public Mono runCalibration(Boolean autoPickingEnabled) { - return client.get().uri("/calibration/start/" + autoPickingEnabled).accept(MediaType.APPLICATION_JSON).exchange().flatMap(resp -> resp.bodyToMono(String.class)); + return client.get().uri("/calibration/start/" + autoPickingEnabled).accept(MediaType.APPLICATION_JSON).retrieve().bodyToMono(String.class); } @Override @@ -52,10 +52,11 @@ public Mono cancelCalibration(Long id) { .contentType(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON) .bodyValue(id) - .exchange() + .retrieve() + .bodyToMono(String.class) .doOnError(e -> log.error(e.getMessage(), e)) .doOnSuccess(cr -> log.error(cr.toString())) - .flatMap(resp -> resp.bodyToMono(String.class).map(Boolean::valueOf)); + .map(Boolean::valueOf); } @Override @@ -69,14 +70,14 @@ public Mono makeMwMeasurements(Boolean autoPickingEnabl .uri("/measurement/measure-mws") .bodyValue(new MeasurementJob().setAutopickingEnabled(autoPickingEnabled).setPersistResults(Boolean.TRUE).setEventIds(eventIds)) .accept(MediaType.APPLICATION_JSON) - .exchange() + .retrieve() + .bodyToMono(MeasuredMwReportByEvent.class) .doOnError(e -> log.trace(e.getMessage(), e)) - .doOnSuccess(cr -> log.trace(cr.toString())) - .flatMap(resp -> resp.bodyToMono(MeasuredMwReportByEvent.class)); + .doOnSuccess(cr -> log.trace(cr.toString())); } @Override public Mono clearData() { - return client.get().uri("/calibration/clear-data").accept(MediaType.APPLICATION_JSON).exchange().flatMap(resp -> resp.bodyToMono(String.class)); + return client.get().uri("/calibration/clear-data").accept(MediaType.APPLICATION_JSON).retrieve().bodyToMono(String.class); } } diff --git a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/data/client/EventWebClient.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/data/client/EventWebClient.java index fd4aa413..c266c9a2 100644 --- a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/data/client/EventWebClient.java +++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/data/client/EventWebClient.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2018, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory +* Copyright (c) 2021, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory * CODE-743439. * All rights reserved. * This file is part of CCT. For details, see https://github.com/LLNL/coda-calibration-tool. @@ -47,8 +47,8 @@ public Flux getReferenceEvents() { return client.get() .uri("/reference-events") .accept(MediaType.APPLICATION_JSON) - .exchange() - .flatMapMany(response -> response.bodyToFlux(ReferenceMwParameters.class)) + .retrieve() + .bodyToFlux(ReferenceMwParameters.class) .onErrorReturn(new ReferenceMwParameters()); } @@ -59,8 +59,8 @@ public Mono postReferenceEvents(List refEvents) t .contentType(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON) .bodyValue(refEvents) - .exchange() - .flatMap(resp -> resp.bodyToMono(String.class)); + .retrieve() + .bodyToMono(String.class); } @Override @@ -68,14 +68,14 @@ public Flux getMeasuredEvents() { return client.get() .uri("/measured-mws") .accept(MediaType.APPLICATION_JSON) - .exchange() - .flatMapMany(response -> response.bodyToFlux(MeasuredMwParameters.class)) + .retrieve() + .bodyToFlux(MeasuredMwParameters.class) .onErrorReturn(new MeasuredMwParameters()); } @Override public Mono getEvent(String eventId) { - return client.get().uri("/events/" + eventId).accept(MediaType.APPLICATION_JSON).exchange().flatMap(response -> response.bodyToMono(Event.class)).onErrorReturn(new Event()); + return client.get().uri("/events/" + eventId).accept(MediaType.APPLICATION_JSON).retrieve().bodyToMono(Event.class).onErrorReturn(new Event()); } @Override @@ -83,8 +83,8 @@ public Flux getMeasuredEventDetails() { return client.get() .uri("/measured-mws/details") .accept(MediaType.APPLICATION_JSON) - .exchange() - .flatMapMany(response -> response.bodyToFlux(MeasuredMwDetails.class)) + .retrieve() + .bodyToFlux(MeasuredMwDetails.class) .onErrorReturn(new MeasuredMwDetails()); } @@ -95,8 +95,8 @@ public Mono removeReferenceEventsByEventId(List evids) { .contentType(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON) .bodyValue(evids) - .exchange() - .flatMap(resp -> Mono.empty()); + .retrieve() + .toBodilessEntity().flatMap(resp -> Mono.empty()); } @Override @@ -104,8 +104,8 @@ public Flux getValidationEvents() { return client.get() .uri("/validation-events") .accept(MediaType.APPLICATION_JSON) - .exchange() - .flatMapMany(response -> response.bodyToFlux(ValidationMwParameters.class)) + .retrieve() + .bodyToFlux(ValidationMwParameters.class) .onErrorReturn(new ValidationMwParameters()); } @@ -116,8 +116,8 @@ public Mono postValidationEvents(List events) th .contentType(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON) .bodyValue(events) - .exchange() - .flatMap(resp -> resp.bodyToMono(String.class)); + .retrieve() + .bodyToMono(String.class); } @Override @@ -127,8 +127,8 @@ public Mono removeValidationEventsByEventId(List evids) { .contentType(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON) .bodyValue(evids) - .exchange() - .flatMap(resp -> Mono.empty()); + .retrieve() + .toBodilessEntity().flatMap(resp -> Mono.empty()); } @Override @@ -138,9 +138,8 @@ public Flux toggleValidationEventsByEventId(List evids) { .contentType(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON) .bodyValue(evids) - .exchange() - .flux() - .flatMap(resp -> resp.bodyToFlux(String.class)); + .retrieve() + .bodyToFlux(String.class); } } diff --git a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/data/client/ParameterWebClient.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/data/client/ParameterWebClient.java index 5c18149e..8a8c79a5 100644 --- a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/data/client/ParameterWebClient.java +++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/data/client/ParameterWebClient.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2020, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory +* Copyright (c) 2021, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory * CODE-743439. * All rights reserved. * This file is part of CCT. For details, see https://github.com/LLNL/coda-calibration-tool. @@ -51,8 +51,8 @@ public Mono setSharedFrequencyBandParameter(SharedFrequencyBandParameter .contentType(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON) .bodyValue(parameters) - .exchange() - .flatMap(resp -> resp.bodyToMono(String.class)); + .retrieve() + .bodyToMono(String.class); } @Override @@ -62,8 +62,8 @@ public Mono removeSharedFrequencyBandParameter(SharedFrequencyBandParame .contentType(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON) .bodyValue(parameters) - .exchange() - .flatMap(resp -> resp.bodyToMono(String.class)); + .retrieve() + .bodyToMono(String.class); } @Override @@ -71,8 +71,8 @@ public Flux getSharedFrequencyBandParameters() { return client.get() .uri("/params/shared-fb-parameters/") .accept(MediaType.APPLICATION_JSON) - .exchange() - .flatMapMany(response -> response.bodyToFlux(SharedFrequencyBandParameters.class)) + .retrieve() + .bodyToFlux(SharedFrequencyBandParameters.class) .onErrorReturn(new SharedFrequencyBandParameters()); } @@ -84,8 +84,8 @@ public Mono setSiteSpecificFrequencyBandParameter(List resp.bodyToMono(String.class)); + .retrieve() + .bodyToMono(String.class); } @Override @@ -93,8 +93,8 @@ public Flux getSiteSpecificFrequencyBandParameters( return client.get() .uri("/params/site-fb-parameters/") .accept(MediaType.APPLICATION_JSON) - .exchange() - .flatMapMany(response -> response.bodyToFlux(SiteFrequencyBandParameters.class)) + .retrieve() + .bodyToFlux(SiteFrequencyBandParameters.class) .onErrorReturn(new SiteFrequencyBandParameters()); } @@ -105,8 +105,8 @@ public Mono setPsParameter(MdacParametersPS parameters) throws JsonProce .contentType(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON) .bodyValue(parameters) - .exchange() - .flatMap(resp -> resp.bodyToMono(String.class)); + .retrieve() + .bodyToMono(String.class); } @Override @@ -116,13 +116,13 @@ public Mono removePsParameter(MdacParametersPS parameters) { .contentType(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON) .bodyValue(parameters) - .exchange() - .flatMap(resp -> resp.bodyToMono(String.class)); + .retrieve() + .bodyToMono(String.class); } @Override public Flux getPsParameters() { - return client.get().uri("/params/ps/").accept(MediaType.APPLICATION_JSON).exchange().flatMapMany(response -> response.bodyToFlux(MdacParametersPS.class)).onErrorReturn(new MdacParametersPS()); + return client.get().uri("/params/ps/").accept(MediaType.APPLICATION_JSON).retrieve().bodyToFlux(MdacParametersPS.class).onErrorReturn(new MdacParametersPS()); } @Override @@ -132,8 +132,8 @@ public Mono setFiParameter(MdacParametersFI parameters) throws JsonProce .contentType(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON) .bodyValue(parameters) - .exchange() - .flatMap(resp -> resp.bodyToMono(String.class)); + .retrieve() + .bodyToMono(String.class); } @Override @@ -143,13 +143,13 @@ public Mono removeFiParameter(MdacParametersFI parameters) { .contentType(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON) .bodyValue(parameters) - .exchange() - .flatMap(resp -> resp.bodyToMono(String.class)); + .retrieve() + .bodyToMono(String.class); } @Override public Flux getFiParameters() { - return client.get().uri("/params/fi/").accept(MediaType.APPLICATION_JSON).exchange().flatMapMany(response -> response.bodyToFlux(MdacParametersFI.class)).onErrorReturn(new MdacParametersFI()); + return client.get().uri("/params/fi/").accept(MediaType.APPLICATION_JSON).retrieve().bodyToFlux(MdacParametersFI.class).onErrorReturn(new MdacParametersFI()); } @Override @@ -159,8 +159,8 @@ public Mono getSharedFrequencyBandParametersForFr .contentType(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON) .bodyValue(frequencyBand) - .exchange() - .flatMap(response -> response.bodyToMono(SharedFrequencyBandParameters.class)); + .retrieve() + .bodyToMono(SharedFrequencyBandParameters.class); } @Override @@ -168,14 +168,14 @@ public Mono getVelocityConfiguration() { return client.get() .uri("/config/velocity/") .accept(MediaType.APPLICATION_JSON) - .exchange() - .flatMap(response -> response.bodyToMono(VelocityConfiguration.class)) + .retrieve() + .bodyToMono(VelocityConfiguration.class) .onErrorReturn(new VelocityConfiguration()); } @Override public Mono updateVelocityConfiguration(VelocityConfiguration velConf) { - return client.post().uri("/config/velocity/update").accept(MediaType.APPLICATION_JSON).bodyValue(velConf).exchange().flatMap(response -> response.bodyToMono(String.class)).onErrorReturn(""); + return client.post().uri("/config/velocity/update").accept(MediaType.APPLICATION_JSON).bodyValue(velConf).retrieve().bodyToMono(String.class).onErrorReturn(""); } @Override @@ -183,19 +183,19 @@ public Mono getShapeFitterConstraints() { return client.get() .uri("/config/shape/") .accept(MediaType.APPLICATION_JSON) - .exchange() - .flatMap(response -> response.bodyToMono(ShapeFitterConstraints.class)) + .retrieve() + .bodyToMono(ShapeFitterConstraints.class) .onErrorReturn(new ShapeFitterConstraints()); } @Override public Mono updateShapeFitterConstraints(ShapeFitterConstraints conf) { - return client.post().uri("/config/shape/update").accept(MediaType.APPLICATION_JSON).bodyValue(conf).exchange().flatMap(response -> response.bodyToMono(String.class)).onErrorReturn(""); + return client.post().uri("/config/shape/update").accept(MediaType.APPLICATION_JSON).bodyValue(conf).retrieve().bodyToMono(String.class).onErrorReturn(""); } @Override public Mono updateMapPolygon(String rawGeoJSON) { - return client.post().uri("/config/polygon/update").accept(MediaType.APPLICATION_JSON).bodyValue(rawGeoJSON).exchange().flatMap(response -> response.bodyToMono(String.class)).onErrorReturn(""); + return client.post().uri("/config/polygon/update").accept(MediaType.APPLICATION_JSON).bodyValue(rawGeoJSON).retrieve().bodyToMono(String.class).onErrorReturn(""); } @Override @@ -203,8 +203,8 @@ public Mono getMapPolygon() { return client.get() .uri("/config/polygon/") .accept(MediaType.APPLICATION_JSON) - .exchange() - .flatMap(response -> response.bodyToMono(String.class)) + .retrieve() + .bodyToMono(String.class) .onErrorReturn(""); } } diff --git a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/data/client/PeakVelocityWebClient.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/data/client/PeakVelocityWebClient.java index 4cd57aec..850a1e67 100644 --- a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/data/client/PeakVelocityWebClient.java +++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/data/client/PeakVelocityWebClient.java @@ -43,8 +43,8 @@ public Flux getMeasuredPeakVelocities() { return client.get() .uri("/peak-velocity-measurements/all") .accept(MediaType.APPLICATION_JSON) - .exchange() - .flatMapMany(response -> response.bodyToFlux(PeakVelocityMeasurement.class)) + .retrieve() + .bodyToFlux(PeakVelocityMeasurement.class) .onErrorReturn(new PeakVelocityMeasurement()); } @@ -53,8 +53,8 @@ public Flux getMeasuredPeakVelocitiesMetadata() { return client.get() .uri("/peak-velocity-measurements/metadata/all") .accept(MediaType.APPLICATION_JSON) - .exchange() - .flatMapMany(response -> response.bodyToFlux(PeakVelocityMeasurement.class)) + .retrieve() + .bodyToFlux(PeakVelocityMeasurement.class) .onErrorReturn(new PeakVelocityMeasurement()); } @@ -63,8 +63,8 @@ public Mono getNoiseForWaveform(Long id) { return client.get() .uri("/peak-velocity-measurements/metadata/by-id/" + id) .accept(MediaType.APPLICATION_JSON) - .exchange() - .flatMap(response -> response.bodyToMono(PeakVelocityMeasurement.class)) + .retrieve() + .bodyToMono(PeakVelocityMeasurement.class) .onErrorReturn(new PeakVelocityMeasurement()); } } diff --git a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/data/client/ShapeMeasurementWebClient.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/data/client/ShapeMeasurementWebClient.java index bdcc75be..671337fe 100644 --- a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/data/client/ShapeMeasurementWebClient.java +++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/data/client/ShapeMeasurementWebClient.java @@ -39,8 +39,8 @@ public Flux getMeasuredShapes() { return client.get() .uri("/shape-measurements/all/") .accept(MediaType.APPLICATION_JSON) - .exchange() - .flatMapMany(response -> response.bodyToFlux(ShapeMeasurement.class)) + .retrieve() + .bodyToFlux(ShapeMeasurement.class) .onErrorReturn(new ShapeMeasurement()); } @@ -49,8 +49,8 @@ public Mono getMeasuredShape(Long id) { return client.get() .uri("/shape-measurements/byWaveformId/" + id) .accept(MediaType.APPLICATION_JSON) - .exchange() - .flatMap(response -> response.bodyToMono(ShapeMeasurement.class)) + .retrieve() + .bodyToMono(ShapeMeasurement.class) .onErrorReturn(new ShapeMeasurement()); } @@ -59,8 +59,8 @@ public Flux getMeasuredShapesMetadata() { return client.get() .uri("/shape-measurements/metadata/all/") .accept(MediaType.APPLICATION_JSON) - .exchange() - .flatMapMany(response -> response.bodyToFlux(ShapeMeasurement.class)) + .retrieve() + .bodyToFlux(ShapeMeasurement.class) .onErrorReturn(new ShapeMeasurement()); } @@ -69,8 +69,8 @@ public Mono getMeasuredShapeMetadata(Long id) { return client.get() .uri("/shape-measurements/metadata/byWaveformId/" + id) .accept(MediaType.APPLICATION_JSON) - .exchange() - .flatMap(response -> response.bodyToMono(ShapeMeasurement.class)) + .retrieve() + .bodyToMono(ShapeMeasurement.class) .onErrorReturn(new ShapeMeasurement()); } } diff --git a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/data/client/SpectraWebClient.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/data/client/SpectraWebClient.java index fa7a36b6..1686c3f4 100644 --- a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/data/client/SpectraWebClient.java +++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/data/client/SpectraWebClient.java @@ -41,22 +41,12 @@ public SpectraWebClient(WebClient client) { @Override public Flux getMeasuredSpectra() { - return client.get() - .uri("/spectra-measurements/all") - .accept(MediaType.APPLICATION_JSON) - .exchange() - .flatMapMany(response -> response.bodyToFlux(SpectraMeasurement.class)) - .onErrorReturn(new SpectraMeasurement()); + return client.get().uri("/spectra-measurements/all").accept(MediaType.APPLICATION_JSON).retrieve().bodyToFlux(SpectraMeasurement.class).onErrorReturn(new SpectraMeasurement()); } @Override public Flux getMeasuredSpectraMetadata() { - return client.get() - .uri("/spectra-measurements/metadata/all") - .accept(MediaType.APPLICATION_JSON) - .exchange() - .flatMapMany(response -> response.bodyToFlux(SpectraMeasurement.class)) - .onErrorReturn(new SpectraMeasurement()); + return client.get().uri("/spectra-measurements/metadata/all").accept(MediaType.APPLICATION_JSON).retrieve().bodyToFlux(SpectraMeasurement.class).onErrorReturn(new SpectraMeasurement()); } @Override @@ -66,11 +56,11 @@ public Mono getReferenceSpectra(String eventId) { .contentType(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON) .bodyValue(eventId) - .exchange() - .flatMap(response -> response.bodyToMono(Spectra.class)) + .retrieve() + .bodyToMono(Spectra.class) .onErrorReturn(new Spectra()); } - + @Override public Mono getValidationSpectra(String eventId) { return client.post() @@ -78,10 +68,10 @@ public Mono getValidationSpectra(String eventId) { .contentType(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON) .bodyValue(eventId) - .exchange() - .flatMap(response -> response.bodyToMono(Spectra.class)) + .retrieve() + .bodyToMono(Spectra.class) .onErrorReturn(new Spectra()); - } + } @Override public Mono> getFitSpectra(String eventId) { @@ -90,9 +80,9 @@ public Mono> getFitSpectra(String eventId) { .contentType(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON) .bodyValue(eventId) - .exchange() - .flatMap(response -> response.bodyToMono(new ParameterizedTypeReference>() { - })) + .retrieve() + .bodyToMono(new ParameterizedTypeReference>() { + }) .onErrorReturn(new ArrayList()); } } diff --git a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/data/exporters/ParamExporter.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/data/exporters/ParamExporter.java index 05bdfed0..e059b7b3 100644 --- a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/data/exporters/ParamExporter.java +++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/data/exporters/ParamExporter.java @@ -16,6 +16,7 @@ import java.io.File; import java.io.IOException; +import java.io.InputStream; import java.nio.file.Files; import java.nio.file.Path; import java.time.Duration; @@ -137,7 +138,7 @@ public File createExportArchive() throws IOException { writer.writeReferenceMwParams(tmpFolder, referenceMws); } } - + if (validationMwWriters != null) { List validationMws = new ArrayList<>(); validationMws.addAll(eventClient.getValidationEvents().filter(Objects::nonNull).toStream().collect(Collectors.toList())); @@ -155,11 +156,12 @@ public File createExportArchive() throws IOException { try (ArchiveOutputStream os = new ArchiveStreamFactory().createArchiveOutputStream("zip", Files.newOutputStream(zipDir.toPath()))) { for (File file : files) { os.putArchiveEntry(new ZipArchiveEntry(file, file.getName())); - IOUtils.copy(Files.newInputStream(file.toPath()), os); + try (InputStream fis = Files.newInputStream(file.toPath())) { + IOUtils.copy(fis, os); + } os.closeArchiveEntry(); } os.flush(); - os.close(); } catch (ArchiveException e) { throw new IOException(e); } diff --git a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/plotting/CodaWaveformPlot.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/plotting/CodaWaveformPlot.java index b5a991ef..2047a644 100644 --- a/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/plotting/CodaWaveformPlot.java +++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/calibration/gui/plotting/CodaWaveformPlot.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2018, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory +* Copyright (c) 2021, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory * CODE-743439. * All rights reserved. * This file is part of CCT. For details, see https://github.com/LLNL/coda-calibration-tool. @@ -50,7 +50,6 @@ import llnl.gnem.core.gui.plotting.jmultiaxisplot.PickMovedState; import llnl.gnem.core.gui.plotting.jmultiaxisplot.VPickLine; import llnl.gnem.core.gui.plotting.plotobject.AbstractLine; -import llnl.gnem.core.gui.plotting.plotobject.JDataRectangle; import llnl.gnem.core.gui.plotting.plotobject.Line; import llnl.gnem.core.gui.plotting.plotobject.PinnedText; import llnl.gnem.core.gui.plotting.plotobject.PlotObject; @@ -258,44 +257,27 @@ private void plotSynthetic(Waveform waveform, SyntheticCoda synth, final TimeT b interpolatedSeries.interpolate(synthSeriesBeforeEndMarker.getSamprate()); - double vr = params.getVelocity0() - params.getVelocity1() / (params.getVelocity2() + distance); - if (vr == 0.0) { - vr = 1.0; - } - TimeT startTime; - TimeT trimTime = originTime.add(distance / vr); - if (trimTime.lt(endTime)) { - TimeSeries trimmedWaveform = new TimeSeries(waveformSegment, waveform.getSampleRate(), beginTime); - try { - trimmedWaveform.cutBefore(trimTime); - trimmedWaveform.cutAfter(trimTime.add(30.0)); - startTime = new TimeT(trimTime.getEpochTime() + trimmedWaveform.getMaxTime()[0]); - } catch (IllegalArgumentException e) { - startTime = trimTime; - } - - if (startTime.lt(endTime)) { - interpolatedSeries.cut(startTime, endTime); - synthSeriesBeforeEndMarker.cut(startTime, endTime); - if (synthSeriesBeforeEndMarker.getLength() > 1) { - TimeSeries diffSeis = interpolatedSeries.subtract(synthSeriesBeforeEndMarker); - int synthStartTimeShift = (int) (startTime.subtractD(beginTime) + 0.5); - double median = diffSeis.getMedian(); - - subplot.DeletePlotObject(legendRef); - subplot.AddPlotObject(createLegend(labelText + "Shift: " + dfmt4.format(median))); - subplot.AddPlotObject(createLine(synthStartTimeShift, median, synthSeriesBeforeEndMarker, Color.GREEN), PLOT_ORDERING.MODEL_FIT.getZOrder()); - - if (endTime.lt(synthSeriesRemaining.getEndtime())) { - synthSeriesRemaining.cutBefore(endTime); - int remainingStartTimeShift = (int) (endTime.subtractD(beginTime) + 0.5); - if (synthSeriesRemaining.getLength() > 1) { - subplot.AddPlotObject(createLine(remainingStartTimeShift, median, synthSeriesRemaining, Color.GREEN, DEFAULT_LINE_WIDTH, PenStyle.DASH), - PLOT_ORDERING.MODEL_FIT.getZOrder()); - } + TimeT startTime = new TimeT(synth.getBeginTime()); + if (startTime.lt(endTime)) { + interpolatedSeries.cut(startTime, endTime); + synthSeriesBeforeEndMarker.cut(startTime, endTime); + if (synthSeriesBeforeEndMarker.getLength() > 1) { + TimeSeries diffSeis = interpolatedSeries.subtract(synthSeriesBeforeEndMarker); + int synthStartTimeShift = (int) (startTime.subtractD(beginTime) + 0.5); + double median = diffSeis.getMedian(); + + subplot.DeletePlotObject(legendRef); + subplot.AddPlotObject(createLegend(labelText + "Shift: " + dfmt4.format(median))); + subplot.AddPlotObject(createLine(synthStartTimeShift, median, synthSeriesBeforeEndMarker, Color.GREEN), PLOT_ORDERING.MODEL_FIT.getZOrder()); + + if (endTime.lt(synthSeriesRemaining.getEndtime())) { + synthSeriesRemaining.cutBefore(endTime); + int remainingStartTimeShift = (int) (endTime.subtractD(beginTime) + 0.5); + if (synthSeriesRemaining.getLength() > 1) { + subplot.AddPlotObject(createLine(remainingStartTimeShift, median, synthSeriesRemaining, Color.GREEN, DEFAULT_LINE_WIDTH, PenStyle.DASH), PLOT_ORDERING.MODEL_FIT.getZOrder()); } - repaint(); } + repaint(); } } } @@ -341,12 +323,6 @@ protected void addPlotObject(JSubplot subplot, PlotObject object) { subplot.AddPlotObject(object, PLOT_ORDERING.PICKS.getZOrder()); } - private PlotObject createRectangle(int timeStart, int timeEnd, int heightMin, int heightMax, Color pink) { - JDataRectangle rect = new JDataRectangle(timeStart, heightMin, timeEnd - timeStart, heightMax - heightMin); - rect.setFillColor(pink); - return rect; - } - /* * (non-Javadoc) * @@ -367,11 +343,12 @@ protected void handlePickMovedState(Object obj) { pick.setPickTimeSecFromOrigin((float) (vpl.getXval() - new TimeT(pick.getWaveform().getEvent().getOriginTime()).subtractD(new TimeT(pick.getWaveform().getBeginTime())))); if (pick.getPickName() != null && PICK_TYPES.F.getPhase().equalsIgnoreCase(pick.getPickName().trim())) { pick.getWaveform() - .setAssociatedPicks(pick.getWaveform() - .getAssociatedPicks() - .stream() - .filter(p -> p.getPickName() != null && !PICK_TYPES.AP.getPhase().equalsIgnoreCase(p.getPickName().trim())) - .collect(Collectors.toList())); + .setAssociatedPicks( + pick.getWaveform() + .getAssociatedPicks() + .stream() + .filter(p -> p.getPickName() != null && !PICK_TYPES.AP.getPhase().equalsIgnoreCase(p.getPickName().trim())) + .collect(Collectors.toList())); } waveformClient.postWaveform(pick.getWaveform()).subscribe(this::setWaveform); } diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/FXMLLoaderBuilder.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/FXMLLoaderBuilder.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/FXMLLoaderBuilder.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/FXMLLoaderBuilder.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/SimpleGuiPreloader.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/SimpleGuiPreloader.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/SimpleGuiPreloader.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/SimpleGuiPreloader.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/WebclientConfig.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/WebclientConfig.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/WebclientConfig.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/WebclientConfig.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/controllers/AbstractSeismogramSaveLoadController.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/controllers/AbstractSeismogramSaveLoadController.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/controllers/AbstractSeismogramSaveLoadController.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/controllers/AbstractSeismogramSaveLoadController.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/controllers/FailureReportController.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/controllers/FailureReportController.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/controllers/FailureReportController.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/controllers/FailureReportController.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/controllers/ProgressGui.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/controllers/ProgressGui.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/controllers/ProgressGui.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/controllers/ProgressGui.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/converters/api/CodaFilenameParser.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/converters/api/CodaFilenameParser.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/converters/api/CodaFilenameParser.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/converters/api/CodaFilenameParser.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/converters/api/FileToEnvelopeConverter.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/converters/api/FileToEnvelopeConverter.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/converters/api/FileToEnvelopeConverter.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/converters/api/FileToEnvelopeConverter.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/converters/api/FileToSeismogramConverter.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/converters/api/FileToSeismogramConverter.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/converters/api/FileToSeismogramConverter.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/converters/api/FileToSeismogramConverter.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/converters/api/FileToWaveformConverter.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/converters/api/FileToWaveformConverter.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/converters/api/FileToWaveformConverter.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/converters/api/FileToWaveformConverter.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/converters/api/StackInfo.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/converters/api/StackInfo.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/converters/api/StackInfo.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/converters/api/StackInfo.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/converters/sac/CodaFilenameParserImpl.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/converters/sac/CodaFilenameParserImpl.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/converters/sac/CodaFilenameParserImpl.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/converters/sac/CodaFilenameParserImpl.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/converters/sac/SacExporter.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/converters/sac/SacExporter.java similarity index 99% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/converters/sac/SacExporter.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/converters/sac/SacExporter.java index c2f00e05..cf8bd04b 100644 --- a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/converters/sac/SacExporter.java +++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/converters/sac/SacExporter.java @@ -148,7 +148,7 @@ public String getFileName(Waveform w) { if (segType.length() > 3) { segType = segType.substring(0, 3); } - segType = segType.toUpperCase(); + segType = segType.toUpperCase(Locale.ENGLISH); } else { segType = "UNK"; } diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/converters/sac/SacLoader.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/converters/sac/SacLoader.java similarity index 99% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/converters/sac/SacLoader.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/converters/sac/SacLoader.java index 2ff52fb7..0f711a6e 100644 --- a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/converters/sac/SacLoader.java +++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/converters/sac/SacLoader.java @@ -366,7 +366,7 @@ public String getOrCreateEvid(Waveform waveform) { evid = waveform.getEvent().getEventId(); } - if (evid == null || evid == "0") { + if (evid == null || "0".equals(evid)) { evid = String.valueOf(createJDateMinuteResolutionFromEpoch(time)); } return evid; @@ -391,7 +391,7 @@ public String getOrCreateEvid(SACHeader header) { evid = String.valueOf(header.nevid); } - if (evid == null || evid == "0") { + if (evid == null || "0".equals(evid)) { evid = String.valueOf(createJDateMinuteResolutionFromEpoch(time)); } diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/data/client/CodaWebClientBuilder.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/data/client/CodaWebClientBuilder.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/data/client/CodaWebClientBuilder.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/data/client/CodaWebClientBuilder.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/data/client/EventBusBuilder.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/data/client/EventBusBuilder.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/data/client/EventBusBuilder.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/data/client/EventBusBuilder.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/data/client/EventBusStompSessionHandler.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/data/client/EventBusStompSessionHandler.java similarity index 86% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/data/client/EventBusStompSessionHandler.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/data/client/EventBusStompSessionHandler.java index 78bf4ac0..e94ce3dd 100644 --- a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/data/client/EventBusStompSessionHandler.java +++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/data/client/EventBusStompSessionHandler.java @@ -46,13 +46,21 @@ public EventBusStompSessionHandler(EventBus bus) { @Override public Type getPayloadType(StompHeaders headers) { Type c; - if (headers.containsKey(MESSAGE_HEADERS.PAYLOAD_CLASSNAME) && headers.getFirst(MESSAGE_HEADERS.PAYLOAD_CLASSNAME).toLowerCase(Locale.ENGLISH).startsWith("gov.llnl.gnem.apps.coda")) { - try { - c = Class.forName(headers.getFirst(MESSAGE_HEADERS.PAYLOAD_CLASSNAME)); - } catch (ReflectiveOperationException e) { + if (headers.containsKey(MESSAGE_HEADERS.PAYLOAD_CLASSNAME)) { + String className = headers.getFirst(MESSAGE_HEADERS.PAYLOAD_CLASSNAME); + if (className != null) { + className.toLowerCase(Locale.ENGLISH).startsWith("gov.llnl.gnem.apps.coda"); + try { + c = Class.forName(headers.getFirst(MESSAGE_HEADERS.PAYLOAD_CLASSNAME)); + } catch (ReflectiveOperationException e) { + c = super.getPayloadType(headers); + } + } + else { c = super.getPayloadType(headers); } - } else { + } + else { c = super.getPayloadType(headers); } return c; diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/data/client/WaveformWebClient.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/data/client/WaveformWebClient.java similarity index 73% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/data/client/WaveformWebClient.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/data/client/WaveformWebClient.java index eab9e0b8..35487329 100644 --- a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/data/client/WaveformWebClient.java +++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/data/client/WaveformWebClient.java @@ -47,34 +47,22 @@ public WaveformWebClient(WebClient client) { @Override public Mono getWaveformFromId(Long id) { - return client.get().uri("/single-waveform/{id}", id).accept(MediaType.APPLICATION_JSON).exchange().flatMap(response -> response.bodyToMono(Waveform.class)); + return client.get().uri("/single-waveform/{id}", id).accept(MediaType.APPLICATION_JSON).retrieve().bodyToMono(Waveform.class); } @Override public Mono getSyntheticFromWaveformId(Long id) { - return client.get().uri("/synthetics/single/{id}", id).accept(MediaType.APPLICATION_JSON).exchange().flatMap(response -> response.bodyToMono(SyntheticCoda.class)); + return client.get().uri("/synthetics/single/{id}", id).accept(MediaType.APPLICATION_JSON).retrieve().bodyToMono(SyntheticCoda.class); } @Override public Mono postWaveform(Waveform segment) throws JsonProcessingException { - return client.post() - .uri("/single-waveform") - .contentType(MediaType.APPLICATION_JSON) - .accept(MediaType.APPLICATION_JSON) - .bodyValue(segment) - .exchange() - .flatMap(response -> response.bodyToMono(Waveform.class)); + return client.post().uri("/single-waveform").contentType(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON).bodyValue(segment).retrieve().bodyToMono(Waveform.class); } @Override public Flux postWaveforms(Long sessionId, List segments) { - return client.post() - .uri("/waveforms/batch/" + sessionId) - .contentType(MediaType.APPLICATION_JSON) - .accept(MediaType.APPLICATION_JSON) - .bodyValue(segments) - .exchange() - .flatMapMany(resp -> Flux.just(resp.toString())); + return client.post().uri("/waveforms/batch/" + sessionId).contentType(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON).bodyValue(segments).retrieve().bodyToFlux(String.class); } @Override @@ -82,8 +70,8 @@ public Flux getAllStacks() { return client.get() .uri("/waveforms/query/stacks") .accept(MediaType.APPLICATION_JSON) - .exchange() - .flatMapMany(response -> response.bodyToFlux(Waveform.class)) + .retrieve() + .bodyToFlux(Waveform.class) .doOnError(e -> log.error(e.getMessage(), e)) .onErrorReturn(new Waveform()); } @@ -93,8 +81,8 @@ public Flux getAllActiveStacks() { return client.get() .uri("/waveforms/query/active-stacks") .accept(MediaType.APPLICATION_JSON) - .exchange() - .flatMapMany(response -> response.bodyToFlux(Waveform.class)) + .retrieve() + .bodyToFlux(Waveform.class) .doOnError(e -> log.error(e.getMessage(), e)) .onErrorReturn(new Waveform()); } @@ -104,8 +92,8 @@ public Flux getUniqueEventStationMetadataForStacks() { return client.get() .uri("/waveforms/query/unique-by-event-station") .accept(MediaType.APPLICATION_JSON) - .exchange() - .flatMapMany(response -> response.bodyToFlux(Waveform.class)) + .retrieve() + .bodyToFlux(Waveform.class) .filter(w -> w != null && w.getId() != null) .onErrorReturn(new Waveform()); } @@ -115,8 +103,8 @@ public Flux getWaveformsFromIds(Collection ids) { return client.get() .uri("/waveforms/batch/{ids}", ids.toString().replaceAll("\\[|\\]", "")) .accept(MediaType.APPLICATION_JSON) - .exchange() - .flatMapMany(response -> response.bodyToFlux(Waveform.class)) + .retrieve() + .bodyToFlux(Waveform.class) .filter(Objects::nonNull) .onErrorReturn(new Waveform()); } @@ -126,8 +114,8 @@ public Flux getWaveformMetadataFromIds(List ids) { return client.get() .uri("/waveforms/metadata/batch/{ids}", ids.toString().replaceAll("\\[|\\]", "")) .accept(MediaType.APPLICATION_JSON) - .exchange() - .flatMapMany(response -> response.bodyToFlux(Waveform.class)) + .retrieve() + .bodyToFlux(Waveform.class) .filter(Objects::nonNull) .onErrorReturn(new Waveform()); } @@ -137,8 +125,8 @@ public Flux getSyntheticsFromWaveformIds(Collection ids) { return client.get() .uri("/synthetics/batch/{ids}", ids.toString().replaceAll("\\[|\\]", "")) .accept(MediaType.APPLICATION_JSON) - .exchange() - .flatMapMany(response -> response.bodyToFlux(SyntheticCoda.class)) + .retrieve() + .bodyToFlux(SyntheticCoda.class) .filter(Objects::nonNull) .onErrorReturn(new SyntheticCoda()); } @@ -150,8 +138,8 @@ public Flux setWaveformsActiveByIds(List selectedWaveforms, boolea .contentType(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON) .bodyValue(selectedWaveforms) - .exchange() - .flatMapMany(resp -> Flux.just(resp.toString())); + .retrieve() + .bodyToFlux(String.class); } @Override @@ -161,8 +149,8 @@ public Flux setWaveformsActiveByEventId(String id, boolean active) { .contentType(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON) .bodyValue(id) - .exchange() - .flatMapMany(resp -> Flux.just(resp.toString())); + .retrieve() + .bodyToFlux(String.class); } @Override @@ -172,27 +160,27 @@ public Flux setWaveformsActiveByStationName(String id, boolean active) { .contentType(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON) .bodyValue(id) - .exchange() - .flatMapMany(resp -> Flux.just(resp.toString())); + .retrieve() + .bodyToFlux(String.class); } @Override public Flux setWaveformsActiveOutsidePolygon(boolean active) { return client.post() - .uri("/geometry/set-active/waveforms-outside-polygon/" + active) - .contentType(MediaType.APPLICATION_JSON) - .accept(MediaType.APPLICATION_JSON) - .exchange() - .flatMapMany(resp -> Flux.just(resp.toString())); + .uri("/geometry/set-active/waveforms-outside-polygon/" + active) + .contentType(MediaType.APPLICATION_JSON) + .accept(MediaType.APPLICATION_JSON) + .retrieve() + .bodyToFlux(String.class); } - + @Override public Flux setWaveformsActiveInsidePolygon(boolean active) { return client.post() - .uri("/geometry/set-active/waveforms-inside-polygon/" + active) - .contentType(MediaType.APPLICATION_JSON) - .accept(MediaType.APPLICATION_JSON) - .exchange() - .flatMapMany(resp -> Flux.just(resp.toString())); + .uri("/geometry/set-active/waveforms-inside-polygon/" + active) + .contentType(MediaType.APPLICATION_JSON) + .accept(MediaType.APPLICATION_JSON) + .retrieve() + .bodyToFlux(String.class); } } diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/data/client/api/WaveformClient.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/data/client/api/WaveformClient.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/data/client/api/WaveformClient.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/data/client/api/WaveformClient.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/events/EnvelopeLoadCompleteEvent.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/events/EnvelopeLoadCompleteEvent.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/events/EnvelopeLoadCompleteEvent.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/events/EnvelopeLoadCompleteEvent.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/events/EnvelopeLoadStartingEvent.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/events/EnvelopeLoadStartingEvent.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/events/EnvelopeLoadStartingEvent.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/events/EnvelopeLoadStartingEvent.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/events/ShowFailureReportEvent.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/events/ShowFailureReportEvent.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/events/ShowFailureReportEvent.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/events/ShowFailureReportEvent.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/events/SocketDisconnectEvent.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/events/SocketDisconnectEvent.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/events/SocketDisconnectEvent.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/events/SocketDisconnectEvent.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/events/WaveformSelectionEvent.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/events/WaveformSelectionEvent.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/events/WaveformSelectionEvent.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/events/WaveformSelectionEvent.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/plotting/LabeledPlotPoint.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/plotting/LabeledPlotPoint.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/plotting/LabeledPlotPoint.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/plotting/LabeledPlotPoint.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/plotting/PlotPoint.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/plotting/PlotPoint.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/plotting/PlotPoint.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/plotting/PlotPoint.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/plotting/SymbolStyleMapFactory.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/plotting/SymbolStyleMapFactory.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/plotting/SymbolStyleMapFactory.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/plotting/SymbolStyleMapFactory.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/CellBindingUtils.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/CellBindingUtils.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/CellBindingUtils.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/CellBindingUtils.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/ClickUtils.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/ClickUtils.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/ClickUtils.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/ClickUtils.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/CombinedTrustManager.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/CombinedTrustManager.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/CombinedTrustManager.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/CombinedTrustManager.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/CommonGuiUtils.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/CommonGuiUtils.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/CommonGuiUtils.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/CommonGuiUtils.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/DoubleWrappingEventHandler.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/DoubleWrappingEventHandler.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/DoubleWrappingEventHandler.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/DoubleWrappingEventHandler.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/EventStaFreqStringComparator.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/EventStaFreqStringComparator.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/EventStaFreqStringComparator.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/EventStaFreqStringComparator.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/IntegerWrappingEventHandler.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/IntegerWrappingEventHandler.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/IntegerWrappingEventHandler.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/IntegerWrappingEventHandler.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/MaybeNumericStringComparator.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/MaybeNumericStringComparator.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/MaybeNumericStringComparator.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/MaybeNumericStringComparator.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/NumberFormatFactory.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/NumberFormatFactory.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/NumberFormatFactory.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/NumberFormatFactory.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/PassFailEventProgressListener.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/PassFailEventProgressListener.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/PassFailEventProgressListener.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/PassFailEventProgressListener.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/ProgressEventProgressListener.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/ProgressEventProgressListener.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/ProgressEventProgressListener.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/ProgressEventProgressListener.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/ProgressListener.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/ProgressListener.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/ProgressListener.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/ProgressListener.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/ProgressMonitor.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/ProgressMonitor.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/ProgressMonitor.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/ProgressMonitor.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/SnapshotUtils.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/SnapshotUtils.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/SnapshotUtils.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/SnapshotUtils.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/SslUtils.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/SslUtils.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/SslUtils.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/SslUtils.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/TableUtils.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/TableUtils.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/TableUtils.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/TableUtils.java diff --git a/common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/WrappingEventHandler.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/WrappingEventHandler.java similarity index 100% rename from common-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/WrappingEventHandler.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/common/gui/util/WrappingEventHandler.java diff --git a/envelope-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/EnvelopeGuiController.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/EnvelopeGuiController.java similarity index 74% rename from envelope-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/EnvelopeGuiController.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/EnvelopeGuiController.java index 79edd058..76b92f7e 100644 --- a/envelope-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/EnvelopeGuiController.java +++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/EnvelopeGuiController.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2018, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory +* Copyright (c) 2021, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory * CODE-743439. * All rights reserved. * This file is part of CCT. For details, see https://github.com/LLNL/coda-calibration-tool. @@ -28,6 +28,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.ConfigurableApplicationContext; import org.springframework.stereotype.Component; import com.google.common.eventbus.EventBus; @@ -36,13 +37,17 @@ import gov.llnl.gnem.apps.coda.envelope.gui.controllers.WaveformLoadingController; import javafx.application.Platform; import javafx.fxml.FXML; -import javafx.scene.Node; +import javafx.fxml.FXMLLoader; +import javafx.scene.Parent; +import javafx.scene.Scene; import javafx.scene.control.Alert; import javafx.scene.control.Alert.AlertType; import javafx.scene.input.TransferMode; import javafx.stage.DirectoryChooser; import javafx.stage.FileChooser; import javafx.stage.FileChooser.ExtensionFilter; +import javafx.stage.Stage; +import javafx.stage.StageStyle; @Component public class EnvelopeGuiController { @@ -50,7 +55,7 @@ public class EnvelopeGuiController { private static final Logger log = LoggerFactory.getLogger(EnvelopeGuiController.class); @FXML - private Node rootElement; + private Parent envelopeGuiRoot; private WaveformLoadingController waveformLoadingController; private EnvelopeParamsPorter envelopeParamsPorter; @@ -69,8 +74,10 @@ public class EnvelopeGuiController { return thread; }); + private Stage stage; + @Autowired - public EnvelopeGuiController(WaveformLoadingController waveformLoadingController, EventBus bus, EnvelopeParamsPorter envelopeParamsPorter) throws IOException { + public EnvelopeGuiController(WaveformLoadingController waveformLoadingController, EventBus bus, EnvelopeParamsPorter envelopeParamsPorter, ConfigurableApplicationContext springContext) throws IOException { super(); this.waveformLoadingController = waveformLoadingController; this.bus = bus; @@ -82,11 +89,24 @@ public EnvelopeGuiController(WaveformLoadingController waveformLoadingController sacFileChooser.getExtensionFilters().addAll(new ExtensionFilter("Sac files (.sac)", "*.sac"), new ExtensionFilter("All files", "*.*")); confSaveFileChooser.getExtensionFilters().addAll(new ExtensionFilter("JSON Config File", "*.json"), new ExtensionFilter("All files", "*.*")); confLoadFileChooser.getExtensionFilters().addAll(new ExtensionFilter("JSON Config File", "*.json"), new ExtensionFilter("All files", "*.*")); + Platform.runLater(() -> { + FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/fxml/EnvelopeGui.fxml")); + fxmlLoader.setController(this); + fxmlLoader.setControllerFactory(springContext::getBean); + stage = new Stage(StageStyle.DECORATED); + try { + envelopeGuiRoot = fxmlLoader.load(); + Scene scene = new Scene(envelopeGuiRoot); + stage.setScene(scene); + } catch (IOException e) { + throw new IllegalStateException(e); + } + }); } @FXML private void openWaveformLoadingWindow() { - Optional.ofNullable(sacFileChooser.showOpenMultipleDialog(rootElement.getScene().getWindow())).ifPresent(this::handleDroppedFiles); + Optional.ofNullable(sacFileChooser.showOpenMultipleDialog(envelopeGuiRoot.getScene().getWindow())).ifPresent(this::handleDroppedFiles); } @FXML @@ -96,26 +116,26 @@ private void openFailureReportDisplay() { @FXML private Optional openWaveformDirectorySavingWindow() { - Optional opt = Optional.ofNullable(sacSaveDirChooser.showDialog(rootElement.getScene().getWindow())); + Optional opt = Optional.ofNullable(sacSaveDirChooser.showDialog(envelopeGuiRoot.getScene().getWindow())); opt.ifPresent(waveformLoadingController::setExportPath); return opt; } @FXML private void openWaveformDirectoryLoadingWindow() { - Optional.ofNullable(sacDirFileChooser.showDialog(rootElement.getScene().getWindow())).map(Collections::singletonList).ifPresent(this::handleDroppedFiles); + Optional.ofNullable(sacDirFileChooser.showDialog(envelopeGuiRoot.getScene().getWindow())).map(Collections::singletonList).ifPresent(this::handleDroppedFiles); } @FXML private Optional openJobSavingWindow() { - Optional opt = Optional.ofNullable(confSaveFileChooser.showSaveDialog(rootElement.getScene().getWindow())); + Optional opt = Optional.ofNullable(confSaveFileChooser.showSaveDialog(envelopeGuiRoot.getScene().getWindow())); opt.ifPresent(envelopeParamsPorter::saveParams); return opt; } @FXML private void openJobLoadingWindow() { - Optional.ofNullable(confLoadFileChooser.showOpenDialog(rootElement.getScene().getWindow())).map(Collections::singletonList).ifPresent(this::handleDroppedFiles); + Optional.ofNullable(confLoadFileChooser.showOpenDialog(envelopeGuiRoot.getScene().getWindow())).map(Collections::singletonList).ifPresent(this::handleDroppedFiles); } private void handleDroppedFiles(List files) { @@ -124,7 +144,7 @@ private void handleDroppedFiles(List files) { envelopeParamsPorter.loadParams(files); } - if (files.size() > 1 || files.size() > 0 && !hasJson) { + if (files.size() > 1 || !files.isEmpty() && !hasJson) { Optional opt = openWaveformDirectorySavingWindow(); if (opt.isPresent()) { waveformLoadingController.loadFiles(files); @@ -142,16 +162,16 @@ private void handleDroppedFiles(List files) { @FXML public void initialize() { - rootElement.setOnDragOver(event -> { - if (event.getGestureSource() != rootElement && event.getDragboard().hasFiles()) { + envelopeGuiRoot.setOnDragOver(event -> { + if (event.getGestureSource() != envelopeGuiRoot && event.getDragboard().hasFiles()) { event.acceptTransferModes(TransferMode.COPY); event.consume(); } }); - rootElement.setOnDragDropped(event -> { + envelopeGuiRoot.setOnDragDropped(event -> { boolean success = false; - if (event.getGestureSource() != rootElement && event.getDragboard().hasFiles()) { + if (event.getGestureSource() != envelopeGuiRoot && event.getDragboard().hasFiles()) { handleDroppedFiles(event.getDragboard().getFiles()); success = true; } @@ -166,4 +186,9 @@ public void initialize() { private void cleanUp() { service.shutdownNow(); } + + public void toFront() { + stage.show(); + stage.toFront(); + } } diff --git a/envelope-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/EnvelopeParamsPorter.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/EnvelopeParamsPorter.java similarity index 95% rename from envelope-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/EnvelopeParamsPorter.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/EnvelopeParamsPorter.java index da917e46..dce089f9 100644 --- a/envelope-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/EnvelopeParamsPorter.java +++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/EnvelopeParamsPorter.java @@ -39,6 +39,7 @@ @Service public class EnvelopeParamsPorter { + private static final String JSON_EXT = ".json"; private final Logger log = LoggerFactory.getLogger(this.getClass()); private EnvelopeParamsClient envParamsClient; private EventBus bus; @@ -74,7 +75,7 @@ private List getJsonFiles(List inputFiles) { List files = new ArrayList<>(); if (files != null) { try (Stream fs = inputFiles.stream()) { - files = fs.filter(f -> f.isFile() && f.getName().toLowerCase().endsWith(".json")).collect(Collectors.toList()); + files = fs.filter(f -> f.isFile() && f.getName().toLowerCase(Locale.ENGLISH).endsWith(JSON_EXT)).collect(Collectors.toList()); } } return files; @@ -88,8 +89,8 @@ public void saveParams(File file) { envParamsClient.getEnvelopeJobConfiguration().subscribe(jobConf -> { ObjectWriter writer = new ObjectMapper().writerWithDefaultPrettyPrinter(); try { - if (!file.getName().toLowerCase(Locale.ENGLISH).endsWith(".json")) { - writer.writeValue(new File(file.getAbsolutePath() + ".json"), jobConf); + if (!file.getName().toLowerCase(Locale.ENGLISH).endsWith(JSON_EXT)) { + writer.writeValue(new File(file.getAbsolutePath() + JSON_EXT), jobConf); } else { writer.writeValue(file, jobConf); } diff --git a/envelope-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/controllers/EnvelopeParamsController.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/controllers/EnvelopeParamsController.java similarity index 100% rename from envelope-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/controllers/EnvelopeParamsController.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/controllers/EnvelopeParamsController.java diff --git a/envelope-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/controllers/WaveformLoadingController.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/controllers/WaveformLoadingController.java similarity index 96% rename from envelope-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/controllers/WaveformLoadingController.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/controllers/WaveformLoadingController.java index e898739c..15ce8401 100644 --- a/envelope-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/controllers/WaveformLoadingController.java +++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/controllers/WaveformLoadingController.java @@ -26,6 +26,7 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; +import java.util.SortedMap; import java.util.TreeMap; import java.util.concurrent.atomic.AtomicLong; import java.util.stream.Collectors; @@ -107,7 +108,7 @@ private List getSacFiles(Path path) { List files = new ArrayList<>(); if (path != null) { try (Stream fs = Files.walk(path)) { - files = fs.map(p -> p.toFile()).filter(f -> f.isFile() && f.getName().toLowerCase().endsWith(".env")).collect(Collectors.toList()); + files = fs.map(p -> p.toFile()).filter(f -> f.isFile() && f.getName().toLowerCase(Locale.ENGLISH).endsWith(".env")).collect(Collectors.toList()); } catch (IOException e) { log.warn(e.getMessage(), e); } @@ -129,14 +130,15 @@ public void loadFiles(List inputFiles) { } } - public TreeMap> createEnvelopeMapping(List files) { + public SortedMap> createEnvelopeMapping(List files) { TreeMap> evidStaFreqMap = new TreeMap<>(); for (int ii = 0; ii < files.size(); ii++) { try { File file = files.get(ii); Result res = filenameParser.parse(file.getName().toUpperCase(Locale.ENGLISH)); - if (res.isSuccess() && res.getResultPayload().isPresent()) { - StackInfo info = res.getResultPayload().get(); + Optional payload = res.getResultPayload(); + if (res.isSuccess() && payload.isPresent()) { + StackInfo info = payload.get(); try (SACHeader header = new SACHeader(file)) { if (isValidStationName(header)) { String evid = null; @@ -172,7 +174,7 @@ private boolean isValidStationName(SACHeader header) { return header.kstnm != null && !SACHeader.STRINGDEFAULT.equalsIgnoreCase(header.kstnm) && !"".equalsIgnoreCase(header.kstnm) && !"0".equalsIgnoreCase(header.kstnm); } - public void stackEnvelopes(TreeMap> evidStaFreqMap) { + public void stackEnvelopes(SortedMap> evidStaFreqMap) { final AtomicLong count = new AtomicLong(0); progress.setTotal((long) evidStaFreqMap.size()); progress.setCurrent(count.get()); diff --git a/envelope-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/data/api/EnvelopeClient.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/data/api/EnvelopeClient.java similarity index 100% rename from envelope-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/data/api/EnvelopeClient.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/data/api/EnvelopeClient.java diff --git a/envelope-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/data/api/EnvelopeParamsClient.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/data/api/EnvelopeParamsClient.java similarity index 100% rename from envelope-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/data/api/EnvelopeParamsClient.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/data/api/EnvelopeParamsClient.java diff --git a/envelope-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/data/client/EnvelopeParamsWebClient.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/data/client/EnvelopeParamsWebClient.java similarity index 72% rename from envelope-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/data/client/EnvelopeParamsWebClient.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/data/client/EnvelopeParamsWebClient.java index 640b0f51..0920dbd0 100644 --- a/envelope-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/data/client/EnvelopeParamsWebClient.java +++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/data/client/EnvelopeParamsWebClient.java @@ -42,19 +42,23 @@ public EnvelopeParamsWebClient(WebClient client) { @Override public Mono postEnvelopeJobConfiguration(EnvelopeJobConfiguration config) { - return client.post().uri("/envelopes/job-configuration/update").contentType(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON).bodyValue(config).exchange().doOnSuccess(resp -> { - if (!HttpStatus.OK.equals(resp.statusCode())) { - throw new LightweightIllegalStateException(resp.toString()); - } - }).map(resp -> resp.toString()); + return client.post() + .uri("/envelopes/job-configuration/update") + .contentType(MediaType.APPLICATION_JSON) + .accept(MediaType.APPLICATION_JSON) + .bodyValue(config) + .retrieve() + .onStatus(code -> !HttpStatus.OK.equals(code), resp -> { + return Mono.just(new LightweightIllegalStateException(resp.toString())); + }) + .toBodilessEntity() + .map(resp -> resp.toString()); } @Override public Mono getEnvelopeJobConfiguration() { - return client.get().uri("/envelopes/job-configuration").accept(MediaType.APPLICATION_JSON).exchange().doOnSuccess(resp -> { - if (!HttpStatus.OK.equals(resp.statusCode())) { - throw new LightweightIllegalStateException(resp.toString()); - } - }).flatMap(response -> response.bodyToMono(EnvelopeJobConfiguration.class)); + return client.get().uri("/envelopes/job-configuration").accept(MediaType.APPLICATION_JSON).retrieve().onStatus(code -> !HttpStatus.OK.equals(code), resp -> { + return Mono.just(new LightweightIllegalStateException(resp.toString())); + }).bodyToMono(EnvelopeJobConfiguration.class); } } diff --git a/envelope-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/data/client/EnvelopeWebClient.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/data/client/EnvelopeWebClient.java similarity index 77% rename from envelope-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/data/client/EnvelopeWebClient.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/data/client/EnvelopeWebClient.java index cc1e00f3..0d63271d 100644 --- a/envelope-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/data/client/EnvelopeWebClient.java +++ b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/data/client/EnvelopeWebClient.java @@ -51,7 +51,7 @@ public EnvelopeWebClient(WebClient client) { @Override public Mono getEnvelopeFromId(Long id) { - return client.get().uri("/single-waveform/{id}", id).accept(MediaType.APPLICATION_JSON).exchange().flatMap(response -> response.bodyToMono(Waveform.class)); + return client.get().uri("/single-waveform/{id}", id).accept(MediaType.APPLICATION_JSON).retrieve().bodyToMono(Waveform.class); } @Override @@ -66,16 +66,14 @@ public Flux postEnvelopes(Long sessionId, List segments, Env .contentType(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON) .bodyValue(new EnvelopeJob().setData(segments).setJobConfig(job)) - .exchange() - .flatMapMany(resp -> { - Mono>> respMono = resp.bodyToMono(POST_ENV_RETURN_TYPE); - return respMono.doOnError(e -> log.error(resp.toString())).doOnError(e -> log.error(e.getMessage(), e)).flatMapMany(results -> { - if (results.isSuccess()) { - return Flux.fromStream(results.getResultPayload().orElseGet(() -> new ArrayList()).stream()); - } else { - return Flux.empty(); - } - }); + .retrieve() + .bodyToMono(POST_ENV_RETURN_TYPE) + .flatMapMany(results -> { + if (results.isSuccess()) { + return Flux.fromStream(results.getResultPayload().orElseGet(() -> new ArrayList()).stream()); + } else { + return Flux.empty(); + } }); } @@ -86,13 +84,13 @@ public Flux getEnvelopesMatchingAllFields(Waveform segment) { .contentType(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON) .bodyValue(segment) - .exchange() - .flatMapMany(response -> response.bodyToFlux(Waveform.class)) + .retrieve() + .bodyToFlux(Waveform.class) .onErrorReturn(new Waveform()); } @Override public Flux getAllEnvelopes() { - return client.get().uri("/waveforms/query/all").accept(MediaType.APPLICATION_JSON).exchange().flatMapMany(response -> response.bodyToFlux(Waveform.class)).onErrorReturn(new Waveform()); + return client.get().uri("/waveforms/query/all").accept(MediaType.APPLICATION_JSON).retrieve().bodyToFlux(Waveform.class).onErrorReturn(new Waveform()); } } diff --git a/envelope-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/events/EnvelopeJobConfigLoadCompleteEvent.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/events/EnvelopeJobConfigLoadCompleteEvent.java similarity index 100% rename from envelope-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/events/EnvelopeJobConfigLoadCompleteEvent.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/events/EnvelopeJobConfigLoadCompleteEvent.java diff --git a/envelope-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/util/BandGenerator.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/util/BandGenerator.java similarity index 100% rename from envelope-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/util/BandGenerator.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/util/BandGenerator.java diff --git a/envelope-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/util/LinearBandGenerator.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/util/LinearBandGenerator.java similarity index 100% rename from envelope-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/util/LinearBandGenerator.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/util/LinearBandGenerator.java diff --git a/envelope-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/util/LogBandGenerator.java b/calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/util/LogBandGenerator.java similarity index 100% rename from envelope-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/util/LogBandGenerator.java rename to calibration-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/util/LogBandGenerator.java diff --git a/common-gui/src/main/resources/coda_128x128.png b/calibration-gui/src/main/resources/coda_128x128.png similarity index 100% rename from common-gui/src/main/resources/coda_128x128.png rename to calibration-gui/src/main/resources/coda_128x128.png diff --git a/common-gui/src/main/resources/coda_256x256.png b/calibration-gui/src/main/resources/coda_256x256.png similarity index 100% rename from common-gui/src/main/resources/coda_256x256.png rename to calibration-gui/src/main/resources/coda_256x256.png diff --git a/common-gui/src/main/resources/coda_32x32.png b/calibration-gui/src/main/resources/coda_32x32.png similarity index 100% rename from common-gui/src/main/resources/coda_32x32.png rename to calibration-gui/src/main/resources/coda_32x32.png diff --git a/common-gui/src/main/resources/coda_64x64.png b/calibration-gui/src/main/resources/coda_64x64.png similarity index 100% rename from common-gui/src/main/resources/coda_64x64.png rename to calibration-gui/src/main/resources/coda_64x64.png diff --git a/calibration-gui/src/main/resources/fxml/CodaGui.fxml b/calibration-gui/src/main/resources/fxml/CodaGui.fxml index 1ac520d6..ce2f5ec0 100644 --- a/calibration-gui/src/main/resources/fxml/CodaGui.fxml +++ b/calibration-gui/src/main/resources/fxml/CodaGui.fxml @@ -76,6 +76,11 @@ + + + + + diff --git a/calibration-gui/src/main/resources/fxml/CommonGui.css b/calibration-gui/src/main/resources/fxml/CommonGui.css index 4ae2cc21..9a750245 100644 --- a/calibration-gui/src/main/resources/fxml/CommonGui.css +++ b/calibration-gui/src/main/resources/fxml/CommonGui.css @@ -49,4 +49,4 @@ .text-input:readonly { -fx-background-color: transparent; -} \ No newline at end of file +} diff --git a/calibration-gui/src/main/resources/fxml/EnvelopeGui.fxml b/calibration-gui/src/main/resources/fxml/EnvelopeGui.fxml new file mode 100644 index 00000000..dd52b682 --- /dev/null +++ b/calibration-gui/src/main/resources/fxml/EnvelopeGui.fxml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/envelope-gui/src/main/resources/fxml/EnvelopeParamsTabPane.fxml b/calibration-gui/src/main/resources/fxml/EnvelopeParamsTabPane.fxml similarity index 100% rename from envelope-gui/src/main/resources/fxml/EnvelopeParamsTabPane.fxml rename to calibration-gui/src/main/resources/fxml/EnvelopeParamsTabPane.fxml diff --git a/common-gui/src/main/resources/fxml/FailureReport.fxml b/calibration-gui/src/main/resources/fxml/FailureReport.fxml similarity index 100% rename from common-gui/src/main/resources/fxml/FailureReport.fxml rename to calibration-gui/src/main/resources/fxml/FailureReport.fxml diff --git a/common-gui/src/main/resources/fxml/ProgressDisplay.fxml b/calibration-gui/src/main/resources/fxml/ProgressDisplay.fxml similarity index 100% rename from common-gui/src/main/resources/fxml/ProgressDisplay.fxml rename to calibration-gui/src/main/resources/fxml/ProgressDisplay.fxml diff --git a/common-gui/src/main/resources/fxml/ProgressMonitor.fxml b/calibration-gui/src/main/resources/fxml/ProgressMonitor.fxml similarity index 100% rename from common-gui/src/main/resources/fxml/ProgressMonitor.fxml rename to calibration-gui/src/main/resources/fxml/ProgressMonitor.fxml diff --git a/calibration-gui/src/main/resources/fxml/ShapeConstraints.fxml b/calibration-gui/src/main/resources/fxml/ShapeConstraints.fxml index 0e0efad5..5c0223d2 100644 --- a/calibration-gui/src/main/resources/fxml/ShapeConstraints.fxml +++ b/calibration-gui/src/main/resources/fxml/ShapeConstraints.fxml @@ -77,6 +77,7 @@ + diff --git a/common-gui/src/main/resources/selfsigned.crt b/calibration-gui/src/main/resources/selfsigned.crt similarity index 98% rename from common-gui/src/main/resources/selfsigned.crt rename to calibration-gui/src/main/resources/selfsigned.crt index 2d54a209..a91f342e 100644 --- a/common-gui/src/main/resources/selfsigned.crt +++ b/calibration-gui/src/main/resources/selfsigned.crt @@ -1,21 +1,21 @@ -----BEGIN CERTIFICATE----- -MIIDfzCCAmegAwIBAgIEToeHrTANBgkqhkiG9w0BAQsFADBiMQswCQYDVQQGEwJV -UzELMAkGA1UECBMCQ0ExEjAQBgNVBAcTCUxpdmVybW9yZTENMAsGA1UEChMETExO -TDEMMAoGA1UECxMDR01QMRUwEwYDVQQDEwxKdXN0aW4gQmFybm8wHhcNMTcwODAx -MTYyMTM5WhcNMjcwNjEwMTYyMTM5WjBiMQswCQYDVQQGEwJVUzELMAkGA1UECBMC -Q0ExEjAQBgNVBAcTCUxpdmVybW9yZTENMAsGA1UEChMETExOTDEMMAoGA1UECxMD -R01QMRUwEwYDVQQDEwxKdXN0aW4gQmFybm8wggEiMA0GCSqGSIb3DQEBAQUAA4IB -DwAwggEKAoIBAQCqv3lR2mgSRgvnBfF8YdI5nIv1R9inUX1CJhbGyp422q2IV//a -jMPaJaz3/IojUP1u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QUAA4IB +DwAwggEKAoIBAQCqv3lR2mgSRgvnBfF8YdI5nIv1R9inUX1CJhbGyp422q2IV//a +jMPaJaz3/IojUP1u7HQFh8WLNK4KtZtrX2stOeheTyA7Vxpfd4nZeeMjEV2KOFNq +oGz25dplga0QpTTahVIxF9MGTfvEp5nAi/iDzaM//owPSkEk3Ft973R/w6zvwCRg +5ZYJRh/LJfHOOJuDYfiaJWc3fGvg+nL9AnZ4aeuephoN7X2p6hmRnB7GryecaWPn +TZ+JDlL8kjpMkctAeE8R+0qeC6S6TQkjZSxhkrTLiRKnYJz2rPs7M9+kEYz2aboT +lNcqbxgAONyPxsCMv3/GxvJ5rixVpvXvYPqPAgMBAAGjPTA7MBoGA1UdEQQTMBGC +CWxvY2FsaG9zdIcEfwAAATAdBgNVHQ4EFgQUFvgNEmd7aXSyzGSH9iOaAwILFw0w +DQYJKoZIhvcNAQELBQADggEBAGzTs/hdtqN9l5B9GstCDiRQklDlJ8wuyZp/LRtC +hl/VQ7/+gqmzXlNk+4LV2sK/xzScu53j5/vuXssYM161v8WM+PTAE2mYKh2gjQDp +vHEJT8rTP1vHDDxfwjrWx81QCx/1CJuleNg5TKFj12e4Fprnh7WlNzoZhpEcEeBt +EiRkk56M/uo0TMQaV/CvW+GAXHF2WjP1ilNi5qblf+JU4J828mJ2X9dcA/VZfP3O +7dAHy+W88u3fQxWJR1Lh8LZpB8f8SYmxBhbHFf3FfhASj1gc++q4jMzpHbViUseL r6gx2GkQ2+Fcxd8FsAr5pVf1VYNQvmbvRxPirm2pW7zmvPM= -----END CERTIFICATE----- diff --git a/calibration-gui/src/test/java/gov/llnl/gnem/apps/coda/calibration/gui/converters/param/CodaJsonParamLoaderTest.java b/calibration-gui/src/test/java/gov/llnl/gnem/apps/coda/calibration/gui/converters/param/CodaJsonParamLoaderTest.java index 59817330..5dc64942 100644 --- a/calibration-gui/src/test/java/gov/llnl/gnem/apps/coda/calibration/gui/converters/param/CodaJsonParamLoaderTest.java +++ b/calibration-gui/src/test/java/gov/llnl/gnem/apps/coda/calibration/gui/converters/param/CodaJsonParamLoaderTest.java @@ -73,18 +73,16 @@ public final void testValidSiteCorrections(String filePath) throws Exception { Assertions.assertNotNull(siteCorrections, "Expected to have 1 site correction object"); Assertions.assertEquals(1, siteCorrections.getSiteCorrections().stream().map(sc -> sc.getStation().getNetworkName()).distinct().count(), "Expected to have 1 networks"); Assertions.assertEquals(3, siteCorrections.getSiteCorrections().stream().map(sc -> sc.getStation().getStationName()).distinct().count(), "Expected to have 3 stations"); - Assertions.assertEquals(14, - siteCorrections.getSiteCorrections() - .stream() - .filter(sfb -> sfb.getStation() - .getStationName() - .equalsIgnoreCase(siteCorrections.getSiteCorrections() - .stream() - .map(sc -> sc.getStation().getStationName()) - .findFirst() - .orElseGet(null))) - .count(), - "Expected to have 14 bands for the first station"); + Assertions.assertEquals( + 14, + siteCorrections.getSiteCorrections() + .stream() + .filter( + sfb -> sfb.getStation() + .getStationName() + .equalsIgnoreCase(siteCorrections.getSiteCorrections().stream().map(sc -> sc.getStation().getStationName()).findFirst().orElseGet(null))) + .count(), + "Expected to have 14 bands for the first station"); Assertions.assertEquals(42, siteCorrections.getSiteCorrections().size(), "Expected to have 42 site correction bands"); } @@ -92,36 +90,40 @@ public final void testValidSiteCorrections(String filePath) throws Exception { @MethodSource("filePaths") public final void testValidPs(String filePath) throws Exception { Flux> results = convertFile(filePath); - Assertions.assertEquals(Long.valueOf(1l), - results.filter(r -> r.isSuccess() && r.getResultPayload().orElse(null) instanceof MdacParametersFI).count().block(), - "Expected to have 1 valid MDAC FI definition"); + Assertions.assertEquals( + Long.valueOf(1l), + results.filter(r -> r.isSuccess() && r.getResultPayload().orElse(null) instanceof MdacParametersFI).count().block(), + "Expected to have 1 valid MDAC FI definition"); } @ParameterizedTest @MethodSource("filePaths") public final void testFi(String filePath) throws Exception { Flux> results = convertFile(filePath); - Assertions.assertEquals(Long.valueOf(4l), - results.filter(r -> r.isSuccess() && r.getResultPayload().orElse(null) instanceof MdacParametersPS).count().block(), - "Expected to have 4 valid MDAC PS definitions"); + Assertions.assertEquals( + Long.valueOf(4l), + results.filter(r -> r.isSuccess() && r.getResultPayload().orElse(null) instanceof MdacParametersPS).count().block(), + "Expected to have 4 valid MDAC PS definitions"); } @ParameterizedTest @MethodSource("filePaths") public final void testRefMw(String filePath) throws Exception { Flux> results = convertFile(filePath); - Assertions.assertEquals(Long.valueOf(2l), - results.filter(r -> r.isSuccess() && r.getResultPayload().orElse(null) instanceof ReferenceMwParameters).count().block(), - "Expected to have 2 valid reference event definitions"); + Assertions.assertEquals( + Long.valueOf(2l), + results.filter(r -> r.isSuccess() && r.getResultPayload().orElse(null) instanceof ReferenceMwParameters).count().block(), + "Expected to have 2 valid reference event definitions"); } @ParameterizedTest @MethodSource("filePaths") public final void testValidationMw(String filePath) throws Exception { Flux> results = convertFile(filePath); - Assertions.assertEquals(Long.valueOf(2l), - results.filter(r -> r.isSuccess() && r.getResultPayload().orElse(null) instanceof ValidationMwParameters).count().block(), - "Expected to have 14 valid band definitions"); + Assertions.assertEquals( + Long.valueOf(2l), + results.filter(r -> r.isSuccess() && r.getResultPayload().orElse(null) instanceof ValidationMwParameters).count().block(), + "Expected to have 14 valid band definitions"); } @ParameterizedTest @@ -130,21 +132,21 @@ public final void testMultiplePolygons(String filePath) throws Exception { Flux> results = convertFile(filePath); RawGeoJSON result = (RawGeoJSON) results.filter(r -> r.isSuccess() && r.getResultPayload().orElse(null) instanceof RawGeoJSON).blockFirst().getResultPayload().get(); - Assertions.assertEquals("{\"features\":[{\"type\":\"Feature\",\"properties\":{},\"geometry\":{\"type\":\"Polygon\",\"coordinates\":[[[0.0,3.0],[3.0,3.0],[3.0,0.0],[0.0,0.0],[0.0,3.0]]]}}]}", - result.getRawGeoJSON(), - "Expected RawGeoJSON collection to match contents of calibration JSON"); + Assertions.assertEquals( + "{\"features\":[{\"type\":\"Feature\",\"properties\":{},\"geometry\":{\"type\":\"Polygon\",\"coordinates\":[[[0.0,3.0],[3.0,3.0],[3.0,0.0],[0.0,0.0],[0.0,3.0]]]}}]}", + result.getRawGeoJSON(), + "Expected RawGeoJSON collection to match contents of calibration JSON"); } @ParameterizedTest @MethodSource("filePaths") public final void testShapeConstraint(String filePath) throws Exception { Flux> results = convertFile(filePath); - Assertions.assertEquals(Long.valueOf(1l), - results.filter(r -> r.isSuccess() && r.getResultPayload().orElse(null) instanceof ShapeFitterConstraints).count().block(), - "Expected to have 1 valid shape constraint definition"); - assertThat(((ShapeFitterConstraints) results.filter(r -> r.getResultPayload().orElse(null) instanceof ShapeFitterConstraints) - .blockFirst() - .getResultPayload() - .get()).getMaxBeta()).isCloseTo(-11.0E-4, within(0.001)).describedAs("Expected values containing 'E-' scientific notation serialize correctly"); + Assertions.assertEquals( + Long.valueOf(1l), + results.filter(r -> r.isSuccess() && r.getResultPayload().orElse(null) instanceof ShapeFitterConstraints).count().block(), + "Expected to have 1 valid shape constraint definition"); + assertThat(((ShapeFitterConstraints) results.filter(r -> r.getResultPayload().orElse(null) instanceof ShapeFitterConstraints).blockFirst().getResultPayload().get()).getMaxBeta()).describedAs( + "Expected values containing 'E-' scientific notation serialize correctly").isCloseTo(-11.0E-4, within(0.001)); } } diff --git a/common-gui/src/test/java/gov/llnl/gnem/apps/coda/common/gui/converters/sac/SacExporterTest.java b/calibration-gui/src/test/java/gov/llnl/gnem/apps/coda/common/gui/converters/sac/SacExporterTest.java similarity index 100% rename from common-gui/src/test/java/gov/llnl/gnem/apps/coda/common/gui/converters/sac/SacExporterTest.java rename to calibration-gui/src/test/java/gov/llnl/gnem/apps/coda/common/gui/converters/sac/SacExporterTest.java diff --git a/common-gui/src/test/java/gov/llnl/gnem/apps/coda/common/gui/converters/sac/SacLoaderTest.java b/calibration-gui/src/test/java/gov/llnl/gnem/apps/coda/common/gui/converters/sac/SacLoaderTest.java similarity index 100% rename from common-gui/src/test/java/gov/llnl/gnem/apps/coda/common/gui/converters/sac/SacLoaderTest.java rename to calibration-gui/src/test/java/gov/llnl/gnem/apps/coda/common/gui/converters/sac/SacLoaderTest.java diff --git a/common-gui/src/test/resources/logback-test.xml b/calibration-gui/src/test/resources/logback-test.xml similarity index 100% rename from common-gui/src/test/resources/logback-test.xml rename to calibration-gui/src/test/resources/logback-test.xml diff --git a/common-gui/src/test/resources/sac/IU.ANMO.SE.MXE.sac b/calibration-gui/src/test/resources/sac/IU.ANMO.SE.MXE.sac similarity index 100% rename from common-gui/src/test/resources/sac/IU.ANMO.SE.MXE.sac rename to calibration-gui/src/test/resources/sac/IU.ANMO.SE.MXE.sac diff --git a/common-gui/src/test/resources/sac/IU.ANMO.SE.MXN.sac b/calibration-gui/src/test/resources/sac/IU.ANMO.SE.MXN.sac similarity index 100% rename from common-gui/src/test/resources/sac/IU.ANMO.SE.MXN.sac rename to calibration-gui/src/test/resources/sac/IU.ANMO.SE.MXN.sac diff --git a/common-gui/src/test/resources/sac/IU.ANMO.SE.MXZ.sac b/calibration-gui/src/test/resources/sac/IU.ANMO.SE.MXZ.sac similarity index 100% rename from common-gui/src/test/resources/sac/IU.ANMO.SE.MXZ.sac rename to calibration-gui/src/test/resources/sac/IU.ANMO.SE.MXZ.sac diff --git a/calibration-service/calibration-application/pom.xml b/calibration-service/calibration-application/pom.xml index f183dc94..4400f1b0 100644 --- a/calibration-service/calibration-application/pom.xml +++ b/calibration-service/calibration-application/pom.xml @@ -5,7 +5,7 @@ gov.llnl.gnem.apps.coda.calibration calibration-service - 1.0.10 + 1.0.11 4.0.0 @@ -86,8 +86,9 @@ spring-boot-starter-web - gov.llnl.gnem.apps.coda.common - common-application + org.junit.jupiter + junit-jupiter + test diff --git a/calibration-service/calibration-application/src/main/java/gov/llnl/gnem/apps/coda/calibration/CalibrationApplication.java b/calibration-service/calibration-application/src/main/java/gov/llnl/gnem/apps/coda/calibration/CalibrationApplication.java index 3ac5fa3d..80684453 100644 --- a/calibration-service/calibration-application/src/main/java/gov/llnl/gnem/apps/coda/calibration/CalibrationApplication.java +++ b/calibration-service/calibration-application/src/main/java/gov/llnl/gnem/apps/coda/calibration/CalibrationApplication.java @@ -14,6 +14,7 @@ */ package gov.llnl.gnem.apps.coda.calibration; +import java.util.Locale; import java.util.TimeZone; import javax.annotation.PostConstruct; @@ -31,12 +32,14 @@ @EnableAutoConfiguration @ComponentScan("gov.llnl.gnem.apps.coda.common.application") @ComponentScan("gov.llnl.gnem.apps.coda.common.service") +@ComponentScan("gov.llnl.gnem.apps.coda.envelope") @ComponentScan("gov.llnl.gnem.apps.coda.calibration") -@EntityScan(basePackages = { "gov.llnl.gnem.apps.coda.calibration", "gov.llnl.gnem.apps.coda.common" }) -@EnableJpaRepositories(basePackages = { "gov.llnl.gnem.apps.coda.calibration", "gov.llnl.gnem.apps.coda.common" }, repositoryBaseClass = DetachableJpaRepoImpl.class) +@EntityScan(basePackages = { "gov.llnl.gnem.apps.coda.calibration", "gov.llnl.gnem.apps.coda.envelope.model.domain", "gov.llnl.gnem.apps.coda.common" }) +@EnableJpaRepositories(basePackages = { "gov.llnl.gnem.apps.coda.calibration", "gov.llnl.gnem.apps.coda.envelope", "gov.llnl.gnem.apps.coda.common" }, repositoryBaseClass = DetachableJpaRepoImpl.class) public class CalibrationApplication { @PostConstruct void started() { + Locale.setDefault(Locale.ENGLISH); TimeZone.setDefault(TimeZone.getTimeZone("UTC")); } diff --git a/calibration-service/calibration-application/src/main/java/gov/llnl/gnem/apps/coda/calibration/ConfigureJacksonMixins.java b/calibration-service/calibration-application/src/main/java/gov/llnl/gnem/apps/coda/calibration/ConfigureJacksonMixins.java index b9183bd2..9c50ccbe 100644 --- a/calibration-service/calibration-application/src/main/java/gov/llnl/gnem/apps/coda/calibration/ConfigureJacksonMixins.java +++ b/calibration-service/calibration-application/src/main/java/gov/llnl/gnem/apps/coda/calibration/ConfigureJacksonMixins.java @@ -21,6 +21,7 @@ import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.stereotype.Component; +import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import gov.llnl.gnem.apps.coda.calibration.model.domain.SiteFrequencyBandParameters; @@ -36,7 +37,8 @@ public class ConfigureJacksonMixins { @Bean public MappingJackson2HttpMessageConverter configureJackson() { MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter(); - ObjectMapper mapper = new ObjectMapper(); + ObjectMapper mapper = converter.getObjectMapper(); + mapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); mapper.addMixIn(SharedFrequencyBandParameters.class, SharedFrequencyBandParametersJsonMixin.class); mapper.addMixIn(SiteFrequencyBandParameters.class, SiteFrequencyBandParametersJsonMixin.class); converter.setObjectMapper(mapper); diff --git a/common-service/common-application/src/main/java/gov/llnl/gnem/apps/coda/common/application/config/WebSocketConfig.java b/calibration-service/calibration-application/src/main/java/gov/llnl/gnem/apps/coda/common/application/config/WebSocketConfig.java similarity index 100% rename from common-service/common-application/src/main/java/gov/llnl/gnem/apps/coda/common/application/config/WebSocketConfig.java rename to calibration-service/calibration-application/src/main/java/gov/llnl/gnem/apps/coda/common/application/config/WebSocketConfig.java diff --git a/common-service/common-application/src/main/java/gov/llnl/gnem/apps/coda/common/application/web/BasicNotificationStompController.java b/calibration-service/calibration-application/src/main/java/gov/llnl/gnem/apps/coda/common/application/web/BasicNotificationStompController.java similarity index 100% rename from common-service/common-application/src/main/java/gov/llnl/gnem/apps/coda/common/application/web/BasicNotificationStompController.java rename to calibration-service/calibration-application/src/main/java/gov/llnl/gnem/apps/coda/common/application/web/BasicNotificationStompController.java diff --git a/common-service/common-application/src/main/java/gov/llnl/gnem/apps/coda/common/application/web/TypingMessageTemplate.java b/calibration-service/calibration-application/src/main/java/gov/llnl/gnem/apps/coda/common/application/web/TypingMessageTemplate.java similarity index 100% rename from common-service/common-application/src/main/java/gov/llnl/gnem/apps/coda/common/application/web/TypingMessageTemplate.java rename to calibration-service/calibration-application/src/main/java/gov/llnl/gnem/apps/coda/common/application/web/TypingMessageTemplate.java diff --git a/common-service/common-application/src/main/java/gov/llnl/gnem/apps/coda/common/application/web/WaveformPicksCollectionJsonController.java b/calibration-service/calibration-application/src/main/java/gov/llnl/gnem/apps/coda/common/application/web/WaveformPicksCollectionJsonController.java similarity index 100% rename from common-service/common-application/src/main/java/gov/llnl/gnem/apps/coda/common/application/web/WaveformPicksCollectionJsonController.java rename to calibration-service/calibration-application/src/main/java/gov/llnl/gnem/apps/coda/common/application/web/WaveformPicksCollectionJsonController.java diff --git a/common-service/common-application/src/main/java/gov/llnl/gnem/apps/coda/common/application/web/WaveformPicksItemJsonController.java b/calibration-service/calibration-application/src/main/java/gov/llnl/gnem/apps/coda/common/application/web/WaveformPicksItemJsonController.java similarity index 100% rename from common-service/common-application/src/main/java/gov/llnl/gnem/apps/coda/common/application/web/WaveformPicksItemJsonController.java rename to calibration-service/calibration-application/src/main/java/gov/llnl/gnem/apps/coda/common/application/web/WaveformPicksItemJsonController.java diff --git a/common-service/common-application/src/main/java/gov/llnl/gnem/apps/coda/common/application/web/WaveformsCollectionJsonController.java b/calibration-service/calibration-application/src/main/java/gov/llnl/gnem/apps/coda/common/application/web/WaveformsCollectionJsonController.java similarity index 100% rename from common-service/common-application/src/main/java/gov/llnl/gnem/apps/coda/common/application/web/WaveformsCollectionJsonController.java rename to calibration-service/calibration-application/src/main/java/gov/llnl/gnem/apps/coda/common/application/web/WaveformsCollectionJsonController.java diff --git a/common-service/common-application/src/main/java/gov/llnl/gnem/apps/coda/common/application/web/WaveformsItemJsonController.java b/calibration-service/calibration-application/src/main/java/gov/llnl/gnem/apps/coda/common/application/web/WaveformsItemJsonController.java similarity index 100% rename from common-service/common-application/src/main/java/gov/llnl/gnem/apps/coda/common/application/web/WaveformsItemJsonController.java rename to calibration-service/calibration-application/src/main/java/gov/llnl/gnem/apps/coda/common/application/web/WaveformsItemJsonController.java diff --git a/common-service/common-application/src/main/java/gov/llnl/gnem/apps/coda/common/util/NumberFormatFactory.java b/calibration-service/calibration-application/src/main/java/gov/llnl/gnem/apps/coda/common/util/NumberFormatFactory.java similarity index 100% rename from common-service/common-application/src/main/java/gov/llnl/gnem/apps/coda/common/util/NumberFormatFactory.java rename to calibration-service/calibration-application/src/main/java/gov/llnl/gnem/apps/coda/common/util/NumberFormatFactory.java diff --git a/envelope-service/envelope-application/src/main/java/gov/llnl/gnem/apps/coda/envelope/application/web/EnvelopeJsonController.java b/calibration-service/calibration-application/src/main/java/gov/llnl/gnem/apps/coda/envelope/application/web/EnvelopeJsonController.java similarity index 100% rename from envelope-service/envelope-application/src/main/java/gov/llnl/gnem/apps/coda/envelope/application/web/EnvelopeJsonController.java rename to calibration-service/calibration-application/src/main/java/gov/llnl/gnem/apps/coda/envelope/application/web/EnvelopeJsonController.java diff --git a/envelope-service/envelope-application/src/main/java/gov/llnl/gnem/apps/coda/envelope/application/web/EnvelopeParamsJsonController.java b/calibration-service/calibration-application/src/main/java/gov/llnl/gnem/apps/coda/envelope/application/web/EnvelopeParamsJsonController.java similarity index 100% rename from envelope-service/envelope-application/src/main/java/gov/llnl/gnem/apps/coda/envelope/application/web/EnvelopeParamsJsonController.java rename to calibration-service/calibration-application/src/main/java/gov/llnl/gnem/apps/coda/envelope/application/web/EnvelopeParamsJsonController.java diff --git a/calibration-service/calibration-application/src/main/resources/application.properties b/calibration-service/calibration-application/src/main/resources/application.properties index c5bc1873..ce49b134 100644 --- a/calibration-service/calibration-application/src/main/resources/application.properties +++ b/calibration-service/calibration-application/src/main/resources/application.properties @@ -3,6 +3,8 @@ spring.jpa.open-in-view=false logging.level.root=ERROR logging.level.gov.llnl.gnem.apps.coda.*=INFO spring.datasource.driver-class-name=org.h2.Driver +spring.datasource.username=sa + spring.datasource.url=jdbc:h2:mem:./coda;DB_CLOSE_DELAY=-1;COMPRESS=TRUE server.port=53921 server.address=127.0.0.1 diff --git a/common-service/common-application/src/main/resources/favicon.ico b/calibration-service/calibration-application/src/main/resources/favicon.ico similarity index 100% rename from common-service/common-application/src/main/resources/favicon.ico rename to calibration-service/calibration-application/src/main/resources/favicon.ico diff --git a/calibration-service/calibration-application/src/main/resources/data.sql b/calibration-service/calibration-application/src/main/resources/import.sql similarity index 100% rename from calibration-service/calibration-application/src/main/resources/data.sql rename to calibration-service/calibration-application/src/main/resources/import.sql diff --git a/common-service/common-application/src/test/java/gov/llnl/gnem/apps/coda/common/util/NumberFormatFactoryTest.java b/calibration-service/calibration-application/src/test/java/gov/llnl/gnem/apps/coda/common/util/NumberFormatFactoryTest.java similarity index 100% rename from common-service/common-application/src/test/java/gov/llnl/gnem/apps/coda/common/util/NumberFormatFactoryTest.java rename to calibration-service/calibration-application/src/test/java/gov/llnl/gnem/apps/coda/common/util/NumberFormatFactoryTest.java diff --git a/calibration-service/calibration-integration/LICENSE.txt b/calibration-service/calibration-integration/LICENSE.txt deleted file mode 100644 index c463fc26..00000000 --- a/calibration-service/calibration-integration/LICENSE.txt +++ /dev/null @@ -1,206 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2017 Lawrence Livermore National Laboratory - - Licensed under the Apache License, Version 2.0 (the "License"); - 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. - - LLNL DISCLAIMER - - This work was performed under the auspices of the U.S. Department of Energy -by Lawrence Livermore National Laboratory under Contract DE-AC52-07NA27344. diff --git a/calibration-service/calibration-integration/pom.xml b/calibration-service/calibration-integration/pom.xml deleted file mode 100644 index 7a50a639..00000000 --- a/calibration-service/calibration-integration/pom.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - gov.llnl.gnem.apps.coda.calibration - calibration-service - 1.0.10 - - - 4.0.0 - calibration-integration - jar - calibration-integration - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - - diff --git a/calibration-service/calibration-model/pom.xml b/calibration-service/calibration-model/pom.xml index d2e99094..6cb198a1 100644 --- a/calibration-service/calibration-model/pom.xml +++ b/calibration-service/calibration-model/pom.xml @@ -5,7 +5,7 @@ gov.llnl.gnem.apps.coda.calibration calibration-service - 1.0.10 + 1.0.11 4.0.0 @@ -14,30 +14,42 @@ calibration-model - - org.springframework.data - spring-data-jpa - - - org.springframework.data - spring-data-commons - - - javax.validation - validation-api - - - com.fasterxml.jackson.core - jackson-annotations - - - org.eclipse.persistence - javax.persistence - - - gov.llnl.gnem.apps.coda.common - common-model - + + org.eclipse.collections + eclipse-collections-api + + + org.eclipse.collections + eclipse-collections + + + org.springframework + spring-context + + + org.springframework.data + spring-data-jpa + + + org.springframework.data + spring-data-commons + + + javax.validation + validation-api + + + com.fasterxml.jackson.core + jackson-annotations + + + org.eclipse.persistence + javax.persistence + + + org.junit.jupiter + junit-jupiter-api + org.junit.jupiter junit-jupiter diff --git a/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/calibration/model/domain/EnvelopeFit.java b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/calibration/model/domain/EnvelopeFit.java index e40d91d6..39318971 100644 --- a/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/calibration/model/domain/EnvelopeFit.java +++ b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/calibration/model/domain/EnvelopeFit.java @@ -14,12 +14,15 @@ */ package gov.llnl.gnem.apps.coda.calibration.model.domain; +import java.util.Objects; + public class EnvelopeFit { private Double gamma; private Double beta; private Double intercept; private Double error; + private double endTime = -1d; public Double getGamma() { return gamma; @@ -57,20 +60,18 @@ public EnvelopeFit setError(Double error) { return this; } - @Override - public String toString() { - return "EnvelopeFit [gamma=" + gamma + ", beta=" + beta + ", intercept=" + intercept + ", error=" + error + "]"; + public double getEndTime() { + return endTime; + } + + public EnvelopeFit setEndTime(double endTime) { + this.endTime = endTime; + return this; } @Override public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((beta == null) ? 0 : beta.hashCode()); - result = prime * result + ((error == null) ? 0 : error.hashCode()); - result = prime * result + ((gamma == null) ? 0 : gamma.hashCode()); - result = prime * result + ((intercept == null) ? 0 : intercept.hashCode()); - return result; + return Objects.hash(beta, endTime, error, gamma, intercept); } @Override @@ -78,42 +79,20 @@ public boolean equals(Object obj) { if (this == obj) { return true; } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { + if (!(obj instanceof EnvelopeFit)) { return false; } EnvelopeFit other = (EnvelopeFit) obj; - if (beta == null) { - if (other.beta != null) { - return false; - } - } else if (!beta.equals(other.beta)) { - return false; - } - if (error == null) { - if (other.error != null) { - return false; - } - } else if (!error.equals(other.error)) { - return false; - } - if (gamma == null) { - if (other.gamma != null) { - return false; - } - } else if (!gamma.equals(other.gamma)) { - return false; - } - if (intercept == null) { - if (other.intercept != null) { - return false; - } - } else if (!intercept.equals(other.intercept)) { - return false; - } - return true; + return Objects.equals(beta, other.beta) + && Double.doubleToLongBits(endTime) == Double.doubleToLongBits(other.endTime) + && Objects.equals(error, other.error) + && Objects.equals(gamma, other.gamma) + && Objects.equals(intercept, other.intercept); + } + + @Override + public String toString() { + return "EnvelopeFit [gamma=" + gamma + ", beta=" + beta + ", intercept=" + intercept + ", error=" + error + ", endTime=" + endTime + "]"; } } diff --git a/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/calibration/model/domain/InjectedCalibrationShapeFitterConstraints.java b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/calibration/model/domain/InjectedCalibrationShapeFitterConstraints.java index 6a945f4c..6ca8b26a 100644 --- a/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/calibration/model/domain/InjectedCalibrationShapeFitterConstraints.java +++ b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/calibration/model/domain/InjectedCalibrationShapeFitterConstraints.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2019, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory +* Copyright (c) 2021, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory * CODE-743439. * All rights reserved. * This file is part of CCT. For details, see https://github.com/LLNL/coda-calibration-tool. @@ -146,8 +146,11 @@ public class InjectedCalibrationShapeFitterConstraints { @Value("${shape-constraints.iterations:10}") private int iterations; - @Value("${shape-constraints.fitting-point-count:10000}") + @Value("${shape-constraints.fittingPointCount:10000}") private int fittingPointCount; + + @Value("${shape-constraints.lengthWeight:0.2}") + private double lengthWeight; @Bean public ShapeFitterConstraints toCalibrationShapeFitterConstraints() { @@ -192,6 +195,7 @@ public ShapeFitterConstraints toCalibrationShapeFitterConstraints() { .setMinGamma(minGamma) .setMaxGamma(maxGamma) .setIterations(iterations) - .setFittingPointCount(fittingPointCount); + .setFittingPointCount(fittingPointCount) + .setLengthWeight(lengthWeight); } } \ No newline at end of file diff --git a/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/calibration/model/domain/PeakVelocityMeasurement.java b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/calibration/model/domain/PeakVelocityMeasurement.java index c43439be..c3e58f5e 100644 --- a/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/calibration/model/domain/PeakVelocityMeasurement.java +++ b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/calibration/model/domain/PeakVelocityMeasurement.java @@ -107,8 +107,8 @@ public double getTime() { return timeSecFromOrigin; } - public PeakVelocityMeasurement setTime(double timeMsFromOrigin) { - this.timeSecFromOrigin = timeMsFromOrigin; + public PeakVelocityMeasurement setTime(double timeSecFromOrigin) { + this.timeSecFromOrigin = timeSecFromOrigin; return this; } diff --git a/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/calibration/model/domain/ShapeFitterConstraints.java b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/calibration/model/domain/ShapeFitterConstraints.java index 771488c8..3b5d330b 100644 --- a/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/calibration/model/domain/ShapeFitterConstraints.java +++ b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/calibration/model/domain/ShapeFitterConstraints.java @@ -128,6 +128,8 @@ public class ShapeFitterConstraints implements Serializable { private int iterations; @NumberFormat private int fittingPointCount; + @NumberFormat + private double lengthWeight; public Long getId() { return id; @@ -525,6 +527,15 @@ public ShapeFitterConstraints setFittingPointCount(int fittingPointCount) { return this; } + public double getLengthWeight() { + return lengthWeight; + } + + public ShapeFitterConstraints setLengthWeight(double lengthWeight) { + this.lengthWeight = lengthWeight; + return this; + } + public ShapeFitterConstraints merge(ShapeFitterConstraints other) { if (other.getId() != null) { id = other.getId(); @@ -573,7 +584,12 @@ public ShapeFitterConstraints merge(ShapeFitterConstraints other) { iterations = other.getIterations(); gDistMin = other.getgDistMin(); gDistMax = other.getgDistMax(); - fittingPointCount = other.getFittingPointCount(); + if (other.getFittingPointCount() != 0.0) { + fittingPointCount = other.getFittingPointCount(); + } + if (other.getLengthWeight() != 0.0) { + lengthWeight = other.getLengthWeight(); + } return this; } @@ -623,7 +639,8 @@ public int hashCode() { yggMax, yggMin, yvvMax, - yvvMin); + yvvMin, + lengthWeight); } @Override @@ -678,102 +695,102 @@ public boolean equals(Object obj) { && Double.doubleToLongBits(yggMax) == Double.doubleToLongBits(other.yggMax) && Double.doubleToLongBits(yggMin) == Double.doubleToLongBits(other.yggMin) && Double.doubleToLongBits(yvvMax) == Double.doubleToLongBits(other.yvvMax) - && Double.doubleToLongBits(yvvMin) == Double.doubleToLongBits(other.yvvMin); + && Double.doubleToLongBits(yvvMin) == Double.doubleToLongBits(other.yvvMin) + && Double.doubleToLongBits(lengthWeight) == Double.doubleToLongBits(other.lengthWeight); } @Override public String toString() { - StringBuilder builder = new StringBuilder(); - builder.append("ShapeFitterConstraints [id=") - .append(id) - .append(", version=") - .append(version) - .append(", maxVP1=") - .append(maxVP1) - .append(", minVP1=") - .append(minVP1) - .append(", v0reg=") - .append(v0reg) - .append(", maxVP2=") - .append(maxVP2) - .append(", minVP2=") - .append(minVP2) - .append(", maxVP3=") - .append(maxVP3) - .append(", minVP3=") - .append(minVP3) - .append(", maxBP1=") - .append(maxBP1) - .append(", minBP1=") - .append(minBP1) - .append(", b0reg=") - .append(b0reg) - .append(", maxBP2=") - .append(maxBP2) - .append(", minBP2=") - .append(minBP2) - .append(", maxBP3=") - .append(maxBP3) - .append(", minBP3=") - .append(minBP3) - .append(", maxGP1=") - .append(maxGP1) - .append(", minGP1=") - .append(minGP1) - .append(", g0reg=") - .append(g0reg) - .append(", maxGP2=") - .append(maxGP2) - .append(", minGP2=") - .append(minGP2) - .append(", g1reg=") - .append(g1reg) - .append(", maxGP3=") - .append(maxGP3) - .append(", minGP3=") - .append(minGP3) - .append(", yvvMin=") - .append(yvvMin) - .append(", yvvMax=") - .append(yvvMax) - .append(", vDistMax=") - .append(vDistMax) - .append(", vDistMin=") - .append(vDistMin) - .append(", ybbMin=") - .append(ybbMin) - .append(", ybbMax=") - .append(ybbMax) - .append(", bDistMax=") - .append(bDistMax) - .append(", bDistMin=") - .append(bDistMin) - .append(", yggMin=") - .append(yggMin) - .append(", yggMax=") - .append(yggMax) - .append(", gDistMin=") - .append(gDistMin) - .append(", gDistMax=") - .append(gDistMax) - .append(", minIntercept=") - .append(minIntercept) - .append(", maxIntercept=") - .append(maxIntercept) - .append(", minBeta=") - .append(minBeta) - .append(", maxBeta=") - .append(maxBeta) - .append(", minGamma=") - .append(minGamma) - .append(", maxGamma=") - .append(maxGamma) - .append(", iterations=") - .append(iterations) - .append(", fittingPointCount=") - .append(fittingPointCount) - .append("]"); - return builder.toString(); + return "ShapeFitterConstraints [id=" + + id + + ", version=" + + version + + ", maxVP1=" + + maxVP1 + + ", minVP1=" + + minVP1 + + ", v0reg=" + + v0reg + + ", maxVP2=" + + maxVP2 + + ", minVP2=" + + minVP2 + + ", maxVP3=" + + maxVP3 + + ", minVP3=" + + minVP3 + + ", maxBP1=" + + maxBP1 + + ", minBP1=" + + minBP1 + + ", b0reg=" + + b0reg + + ", maxBP2=" + + maxBP2 + + ", minBP2=" + + minBP2 + + ", maxBP3=" + + maxBP3 + + ", minBP3=" + + minBP3 + + ", maxGP1=" + + maxGP1 + + ", minGP1=" + + minGP1 + + ", g0reg=" + + g0reg + + ", maxGP2=" + + maxGP2 + + ", minGP2=" + + minGP2 + + ", g1reg=" + + g1reg + + ", maxGP3=" + + maxGP3 + + ", minGP3=" + + minGP3 + + ", yvvMin=" + + yvvMin + + ", yvvMax=" + + yvvMax + + ", vDistMax=" + + vDistMax + + ", vDistMin=" + + vDistMin + + ", ybbMin=" + + ybbMin + + ", ybbMax=" + + ybbMax + + ", bDistMax=" + + bDistMax + + ", bDistMin=" + + bDistMin + + ", yggMin=" + + yggMin + + ", yggMax=" + + yggMax + + ", gDistMin=" + + gDistMin + + ", gDistMax=" + + gDistMax + + ", minIntercept=" + + minIntercept + + ", maxIntercept=" + + maxIntercept + + ", minBeta=" + + minBeta + + ", maxBeta=" + + maxBeta + + ", minGamma=" + + minGamma + + ", maxGamma=" + + maxGamma + + ", iterations=" + + iterations + + ", fittingPointCount=" + + fittingPointCount + + ", lengthWeight=" + + lengthWeight + + "]"; } - } \ No newline at end of file diff --git a/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/calibration/model/domain/WaveformMetadataImpl.java b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/calibration/model/domain/WaveformMetadataImpl.java index 3587b0e4..f7232c40 100644 --- a/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/calibration/model/domain/WaveformMetadataImpl.java +++ b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/calibration/model/domain/WaveformMetadataImpl.java @@ -32,6 +32,7 @@ public class WaveformMetadataImpl implements WaveformMetadata { private Stream stream; private Date beginTime; private Date endTime; + private Date maxVelTime; private String segmentType; private String segmentUnits; private Double lowFrequency; @@ -51,6 +52,7 @@ public WaveformMetadataImpl(Waveform waveform) { this.stream = waveform.getStream(); this.beginTime = waveform.getBeginTime(); this.endTime = waveform.getEndTime(); + this.maxVelTime = waveform.getMaxVelTime(); this.segmentType = waveform.getSegmentType(); this.segmentUnits = waveform.getSegmentUnits(); this.lowFrequency = waveform.getLowFrequency(); @@ -91,6 +93,11 @@ public Date getEndTime() { return endTime; } + @Override + public Date getMaxVelTime() { + return maxVelTime; + } + @Override public String getSegmentType() { return segmentType; diff --git a/common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/Event.java b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/Event.java similarity index 98% rename from common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/Event.java rename to calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/Event.java index a21d86a7..0c130382 100644 --- a/common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/Event.java +++ b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/Event.java @@ -75,7 +75,7 @@ public Date getOriginTime() { public Event setOriginTime(Date originTime) { this.originTime = originTime; - if (StringUtils.isEmpty(this.eventId)) { + if (!StringUtils.hasText(this.eventId)) { this.eventId = Long.toString(originTime.getTime()); } return this; diff --git a/common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/FrequencyBand.java b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/FrequencyBand.java similarity index 100% rename from common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/FrequencyBand.java rename to calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/FrequencyBand.java diff --git a/common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/Pair.java b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/Pair.java similarity index 100% rename from common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/Pair.java rename to calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/Pair.java diff --git a/common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/Project.java b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/Project.java similarity index 100% rename from common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/Project.java rename to calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/Project.java diff --git a/common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/SharedFrequencyBandParameters.java b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/SharedFrequencyBandParameters.java similarity index 100% rename from common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/SharedFrequencyBandParameters.java rename to calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/SharedFrequencyBandParameters.java diff --git a/common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/Station.java b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/Station.java similarity index 100% rename from common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/Station.java rename to calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/Station.java diff --git a/common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/Stream.java b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/Stream.java similarity index 100% rename from common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/Stream.java rename to calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/Stream.java diff --git a/common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/SyntheticCoda.java b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/SyntheticCoda.java similarity index 100% rename from common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/SyntheticCoda.java rename to calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/SyntheticCoda.java diff --git a/common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/Waveform.java b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/Waveform.java similarity index 77% rename from common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/Waveform.java rename to calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/Waveform.java index fca8a662..d815f07d 100644 --- a/common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/Waveform.java +++ b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/Waveform.java @@ -17,6 +17,7 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.Objects; import java.util.stream.Collectors; import javax.persistence.Basic; @@ -77,6 +78,11 @@ public class Waveform { @DateTimeFormat(style = "M-") private Date endTime; + @Column(name = "maxVelTime") + @Temporal(TemporalType.TIMESTAMP) + @DateTimeFormat(style = "M-") + private Date maxVelTime; + @Column(name = "segmentType") private String segmentType; @@ -119,6 +125,7 @@ public Waveform(WaveformMetadata waveform) { this.setStream(waveform.getStream()); this.setBeginTime(waveform.getBeginTime()); this.setEndTime(waveform.getEndTime()); + this.setMaxVelTime(waveform.getMaxVelTime()); this.setSegmentType(waveform.getSegmentType()); this.setSegmentUnits(waveform.getSegmentUnits()); this.setSampleRate(waveform.getSampleRate()); @@ -128,8 +135,8 @@ public Waveform(WaveformMetadata waveform) { this.setActive(waveform.getActive()); } - public Waveform(Long id, Integer version, Event event, Stream stream, Date beginTime, Date endTime, String segmentType, String segmentUnits, Double lowFrequency, Double highFrequency, - Double sampleRate, Boolean active) { + public Waveform(Long id, Integer version, Event event, Stream stream, Date beginTime, Date endTime, Date maxVelTime, String segmentType, String segmentUnits, Double lowFrequency, + Double highFrequency, Double sampleRate, Boolean active) { super(); this.id = id; this.version = version; @@ -137,6 +144,7 @@ public Waveform(Long id, Integer version, Event event, Stream stream, Date begin this.stream = stream; this.beginTime = beginTime; this.endTime = endTime; + this.maxVelTime = maxVelTime; this.segmentType = segmentType; this.segmentUnits = segmentUnits; this.lowFrequency = lowFrequency; @@ -185,6 +193,15 @@ public Waveform setEndTime(Date endTime) { return this; } + public Date getMaxVelTime() { + return maxVelTime; + } + + public Waveform setMaxVelTime(Date maxVelTime) { + this.maxVelTime = maxVelTime; + return this; + } + public String getSegmentType() { return segmentType; } @@ -332,10 +349,10 @@ public Waveform mergeNonNullOrEmptyFields(Waveform waveformOverlay) { if (waveformOverlay.hasData()) { this.setData(waveformOverlay.getData()); } - if (!StringUtils.isEmpty(waveformOverlay.getSegmentType())) { + if (StringUtils.hasText(waveformOverlay.getSegmentType())) { this.setSegmentType(waveformOverlay.getSegmentType()); } - if (!StringUtils.isEmpty(waveformOverlay.getSegmentUnits())) { + if (StringUtils.hasText(waveformOverlay.getSegmentUnits())) { this.setSegmentUnits(waveformOverlay.getSegmentUnits()); } if (waveformOverlay.getSampleRate() != null) { @@ -347,6 +364,9 @@ public Waveform mergeNonNullOrEmptyFields(Waveform waveformOverlay) { if (waveformOverlay.getEndTime() != null) { this.setEndTime(waveformOverlay.getEndTime()); } + if (waveformOverlay.getMaxVelTime() != null) { + this.setMaxVelTime(waveformOverlay.getMaxVelTime()); + } if (waveformOverlay.getAssociatedPicks() != null && !waveformOverlay.getAssociatedPicks().isEmpty()) { this.setAssociatedPicks(waveformOverlay.getAssociatedPicks()); } @@ -358,19 +378,7 @@ public Waveform mergeNonNullOrEmptyFields(Waveform waveformOverlay) { @Override public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((beginTime == null) ? 0 : beginTime.hashCode()); - result = prime * result + ((endTime == null) ? 0 : endTime.hashCode()); - result = prime * result + ((event == null) ? 0 : event.hashCode()); - result = prime * result + ((highFrequency == null) ? 0 : highFrequency.hashCode()); - result = prime * result + ((lowFrequency == null) ? 0 : lowFrequency.hashCode()); - result = prime * result + ((sampleRate == null) ? 0 : sampleRate.hashCode()); - result = prime * result + ((segment == null) ? 0 : segment.hashCode()); - result = prime * result + ((segmentType == null) ? 0 : segmentType.hashCode()); - result = prime * result + ((segmentUnits == null) ? 0 : segmentUnits.hashCode()); - result = prime * result + ((stream == null) ? 0 : stream.hashCode()); - return result; + return Objects.hash(beginTime, endTime, event, highFrequency, lowFrequency, maxVelTime, sampleRate, segment, segmentType, segmentUnits, stream); } @Override @@ -378,84 +386,21 @@ public boolean equals(Object obj) { if (this == obj) { return true; } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { + if (!(obj instanceof Waveform)) { return false; } Waveform other = (Waveform) obj; - if (beginTime == null) { - if (other.beginTime != null) { - return false; - } - } else if (!beginTime.equals(other.beginTime)) { - return false; - } - if (endTime == null) { - if (other.endTime != null) { - return false; - } - } else if (!endTime.equals(other.endTime)) { - return false; - } - if (event == null) { - if (other.event != null) { - return false; - } - } else if (!event.equals(other.event)) { - return false; - } - if (highFrequency == null) { - if (other.highFrequency != null) { - return false; - } - } else if (!highFrequency.equals(other.highFrequency)) { - return false; - } - if (lowFrequency == null) { - if (other.lowFrequency != null) { - return false; - } - } else if (!lowFrequency.equals(other.lowFrequency)) { - return false; - } - if (sampleRate == null) { - if (other.sampleRate != null) { - return false; - } - } else if (!sampleRate.equals(other.sampleRate)) { - return false; - } - if (segment == null) { - if (other.segment != null) { - return false; - } - } else if (!segment.equals(other.segment)) { - return false; - } - if (segmentType == null) { - if (other.segmentType != null) { - return false; - } - } else if (!segmentType.equals(other.segmentType)) { - return false; - } - if (segmentUnits == null) { - if (other.segmentUnits != null) { - return false; - } - } else if (!segmentUnits.equals(other.segmentUnits)) { - return false; - } - if (stream == null) { - if (other.stream != null) { - return false; - } - } else if (!stream.equals(other.stream)) { - return false; - } - return true; + return Objects.equals(beginTime, other.beginTime) + && Objects.equals(endTime, other.endTime) + && Objects.equals(event, other.event) + && Objects.equals(highFrequency, other.highFrequency) + && Objects.equals(lowFrequency, other.lowFrequency) + && Objects.equals(maxVelTime, other.maxVelTime) + && Objects.equals(sampleRate, other.sampleRate) + && Objects.equals(segment, other.segment) + && Objects.equals(segmentType, other.segmentType) + && Objects.equals(segmentUnits, other.segmentUnits) + && Objects.equals(stream, other.stream); } @Override @@ -473,6 +418,8 @@ public String toString() { .append(beginTime) .append(", endTime=") .append(endTime) + .append(", maxVelTime=") + .append(maxVelTime) .append(", segmentType=") .append(segmentType) .append(", segmentUnits=") diff --git a/common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/WaveformMetadata.java b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/WaveformMetadata.java similarity index 97% rename from common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/WaveformMetadata.java rename to calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/WaveformMetadata.java index 95c1bfeb..dbd364a2 100644 --- a/common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/WaveformMetadata.java +++ b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/WaveformMetadata.java @@ -24,6 +24,8 @@ public interface WaveformMetadata { public Date getBeginTime(); public Date getEndTime(); + + public Date getMaxVelTime(); public Event getEvent(); diff --git a/common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/WaveformPick.java b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/WaveformPick.java similarity index 99% rename from common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/WaveformPick.java rename to calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/WaveformPick.java index 45524b10..c93c5a82 100644 --- a/common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/WaveformPick.java +++ b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/domain/WaveformPick.java @@ -94,7 +94,7 @@ public String getPickType() { public WaveformPick setPickType(String pickType) { this.pickType = pickType; if (pickType != null) { - this.pickType = this.pickType.toUpperCase(Locale.ENGLISH); + this.pickType = this.pickType.toUpperCase(Locale.ENGLISH).trim(); } return this; } diff --git a/common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/messaging/PassFailEvent.java b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/messaging/PassFailEvent.java similarity index 100% rename from common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/messaging/PassFailEvent.java rename to calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/messaging/PassFailEvent.java diff --git a/common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/messaging/Progress.java b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/messaging/Progress.java similarity index 100% rename from common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/messaging/Progress.java rename to calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/messaging/Progress.java diff --git a/common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/messaging/ProgressEvent.java b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/messaging/ProgressEvent.java similarity index 100% rename from common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/messaging/ProgressEvent.java rename to calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/messaging/ProgressEvent.java diff --git a/common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/messaging/Result.java b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/messaging/Result.java similarity index 100% rename from common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/messaging/Result.java rename to calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/messaging/Result.java diff --git a/common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/messaging/WaveformChangeEvent.java b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/messaging/WaveformChangeEvent.java similarity index 100% rename from common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/messaging/WaveformChangeEvent.java rename to calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/messaging/WaveformChangeEvent.java diff --git a/common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/test/annotations/GuiTest.java b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/test/annotations/GuiTest.java similarity index 100% rename from common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/test/annotations/GuiTest.java rename to calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/test/annotations/GuiTest.java diff --git a/common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/test/annotations/IntTest.java b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/test/annotations/IntTest.java similarity index 100% rename from common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/test/annotations/IntTest.java rename to calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/test/annotations/IntTest.java diff --git a/common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/util/Durable.java b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/util/Durable.java similarity index 100% rename from common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/util/Durable.java rename to calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/util/Durable.java diff --git a/common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/util/LightweightIllegalStateException.java b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/util/LightweightIllegalStateException.java similarity index 100% rename from common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/util/LightweightIllegalStateException.java rename to calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/util/LightweightIllegalStateException.java diff --git a/common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/util/MESSAGE_HEADERS.java b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/util/MESSAGE_HEADERS.java similarity index 100% rename from common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/util/MESSAGE_HEADERS.java rename to calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/util/MESSAGE_HEADERS.java diff --git a/common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/util/PICK_TYPES.java b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/util/PICK_TYPES.java similarity index 100% rename from common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/util/PICK_TYPES.java rename to calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/util/PICK_TYPES.java diff --git a/common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/util/SPECTRA_TYPES.java b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/util/SPECTRA_TYPES.java similarity index 100% rename from common-service/common-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/util/SPECTRA_TYPES.java rename to calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/common/model/util/SPECTRA_TYPES.java diff --git a/envelope-service/envelope-model/src/main/java/gov/llnl/gnem/apps/coda/envelope/model/domain/Default14BandEnvelopeJobConfiguration.java b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/envelope/model/domain/Default14BandEnvelopeJobConfiguration.java similarity index 100% rename from envelope-service/envelope-model/src/main/java/gov/llnl/gnem/apps/coda/envelope/model/domain/Default14BandEnvelopeJobConfiguration.java rename to calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/envelope/model/domain/Default14BandEnvelopeJobConfiguration.java diff --git a/envelope-service/envelope-model/src/main/java/gov/llnl/gnem/apps/coda/envelope/model/domain/EnvelopeBandParameters.java b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/envelope/model/domain/EnvelopeBandParameters.java similarity index 100% rename from envelope-service/envelope-model/src/main/java/gov/llnl/gnem/apps/coda/envelope/model/domain/EnvelopeBandParameters.java rename to calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/envelope/model/domain/EnvelopeBandParameters.java diff --git a/envelope-service/envelope-model/src/main/java/gov/llnl/gnem/apps/coda/envelope/model/domain/EnvelopeJob.java b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/envelope/model/domain/EnvelopeJob.java similarity index 100% rename from envelope-service/envelope-model/src/main/java/gov/llnl/gnem/apps/coda/envelope/model/domain/EnvelopeJob.java rename to calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/envelope/model/domain/EnvelopeJob.java diff --git a/envelope-service/envelope-model/src/main/java/gov/llnl/gnem/apps/coda/envelope/model/domain/EnvelopeJobConfiguration.java b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/envelope/model/domain/EnvelopeJobConfiguration.java similarity index 100% rename from envelope-service/envelope-model/src/main/java/gov/llnl/gnem/apps/coda/envelope/model/domain/EnvelopeJobConfiguration.java rename to calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/envelope/model/domain/EnvelopeJobConfiguration.java diff --git a/envelope-service/envelope-model/src/main/java/gov/llnl/gnem/apps/coda/envelope/model/domain/SpacingType.java b/calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/envelope/model/domain/SpacingType.java similarity index 100% rename from envelope-service/envelope-model/src/main/java/gov/llnl/gnem/apps/coda/envelope/model/domain/SpacingType.java rename to calibration-service/calibration-model/src/main/java/gov/llnl/gnem/apps/coda/envelope/model/domain/SpacingType.java diff --git a/calibration-service/calibration-repository/pom.xml b/calibration-service/calibration-repository/pom.xml index a2660b2c..149ccf7d 100644 --- a/calibration-service/calibration-repository/pom.xml +++ b/calibration-service/calibration-repository/pom.xml @@ -5,7 +5,7 @@ gov.llnl.gnem.apps.coda.calibration calibration-service - 1.0.10 + 1.0.11 4.0.0 @@ -14,10 +14,6 @@ calibration-repository - - gov.llnl.gnem.apps.coda.common - common-repository - com.h2database h2 diff --git a/common-service/common-repository/src/main/java/gov/llnl/gnem/apps/coda/common/repository/DetachableJpaRepoImpl.java b/calibration-service/calibration-repository/src/main/java/gov/llnl/gnem/apps/coda/common/repository/DetachableJpaRepoImpl.java similarity index 100% rename from common-service/common-repository/src/main/java/gov/llnl/gnem/apps/coda/common/repository/DetachableJpaRepoImpl.java rename to calibration-service/calibration-repository/src/main/java/gov/llnl/gnem/apps/coda/common/repository/DetachableJpaRepoImpl.java diff --git a/common-service/common-repository/src/main/java/gov/llnl/gnem/apps/coda/common/repository/DetachableJpaRepository.java b/calibration-service/calibration-repository/src/main/java/gov/llnl/gnem/apps/coda/common/repository/DetachableJpaRepository.java similarity index 100% rename from common-service/common-repository/src/main/java/gov/llnl/gnem/apps/coda/common/repository/DetachableJpaRepository.java rename to calibration-service/calibration-repository/src/main/java/gov/llnl/gnem/apps/coda/common/repository/DetachableJpaRepository.java diff --git a/common-service/common-repository/src/main/java/gov/llnl/gnem/apps/coda/common/repository/WaveformPickRepository.java b/calibration-service/calibration-repository/src/main/java/gov/llnl/gnem/apps/coda/common/repository/WaveformPickRepository.java similarity index 100% rename from common-service/common-repository/src/main/java/gov/llnl/gnem/apps/coda/common/repository/WaveformPickRepository.java rename to calibration-service/calibration-repository/src/main/java/gov/llnl/gnem/apps/coda/common/repository/WaveformPickRepository.java diff --git a/common-service/common-repository/src/main/java/gov/llnl/gnem/apps/coda/common/repository/WaveformRepository.java b/calibration-service/calibration-repository/src/main/java/gov/llnl/gnem/apps/coda/common/repository/WaveformRepository.java similarity index 87% rename from common-service/common-repository/src/main/java/gov/llnl/gnem/apps/coda/common/repository/WaveformRepository.java rename to calibration-service/calibration-repository/src/main/java/gov/llnl/gnem/apps/coda/common/repository/WaveformRepository.java index a5050665..ba4907fd 100644 --- a/common-service/common-repository/src/main/java/gov/llnl/gnem/apps/coda/common/repository/WaveformRepository.java +++ b/calibration-service/calibration-repository/src/main/java/gov/llnl/gnem/apps/coda/common/repository/WaveformRepository.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2020, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory +* Copyright (c) 2021, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory * CODE-743439. * All rights reserved. * This file is part of CCT. For details, see https://github.com/LLNL/coda-calibration-tool. @@ -40,16 +40,16 @@ public Waveform findByUniqueFields(@Param("eventId") String eventId, @Param("net public Waveform findOneByAllFields(@Param("beginTime") Date beginTime, @Param("endTime") Date endTime, @Param("event") Event event, @Param("stream") Stream stream, @Param("segmentType") String segmentType, @Param("segmentUnits") String segmentUnits, @Param("lowFrequency") Double lowFrequency, @Param("highFrequency") Double highFrequency); - @Query("select new Waveform(w.id, w.version, w.event, w.stream, w.beginTime, w.endTime, w.segmentType, w.segmentUnits, w.lowFrequency, w.highFrequency, w.sampleRate, w.active) from Waveform w order by w.id desc") + @Query("select new Waveform(w.id, w.version, w.event, w.stream, w.beginTime, w.endTime, w.maxVelTime, w.segmentType, w.segmentUnits, w.lowFrequency, w.highFrequency, w.sampleRate, w.active) from Waveform w order by w.id desc") public Set getWaveformMetadata(); - @Query("select new Waveform(w.id, w.version, w.event, w.stream, w.beginTime, w.endTime, w.segmentType, w.segmentUnits, w.lowFrequency, w.highFrequency, w.sampleRate, w.active) from Waveform w where w.active = :active order by w.id desc") + @Query("select new Waveform(w.id, w.version, w.event, w.stream, w.beginTime, w.endTime, w.maxVelTime, w.segmentType, w.segmentUnits, w.lowFrequency, w.highFrequency, w.sampleRate, w.active) from Waveform w where w.active = :active order by w.id desc") public List getWaveformMetadataByActive(@Param("active") boolean active); - @Query("select new Waveform(w.id, w.version, w.event, w.stream, w.beginTime, w.endTime, w.segmentType, w.segmentUnits, w.lowFrequency, w.highFrequency, w.sampleRate, w.active) from Waveform w where w.id in :ids order by w.id desc") + @Query("select new Waveform(w.id, w.version, w.event, w.stream, w.beginTime, w.endTime, w.maxVelTime, w.segmentType, w.segmentUnits, w.lowFrequency, w.highFrequency, w.sampleRate, w.active) from Waveform w where w.id in :ids order by w.id desc") public List findAllMetadataByIds(@Param("ids") List ids); - @Query("select new Waveform(w.id, w.version, w.event, w.stream, w.beginTime, w.endTime, w.segmentType, w.segmentUnits, w.lowFrequency, w.highFrequency, w.sampleRate, w.active) from Waveform w where w.id = :id order by w.id desc") + @Query("select new Waveform(w.id, w.version, w.event, w.stream, w.beginTime, w.endTime, w.maxVelTime, w.segmentType, w.segmentUnits, w.lowFrequency, w.highFrequency, w.sampleRate, w.active) from Waveform w where w.id = :id order by w.id desc") public Waveform findWaveformMetadataById(@Param("id") Long id); @Query("select p from WaveformPick p where p.waveform.id = :id") @@ -78,7 +78,7 @@ public Waveform findOneByAllFields(@Param("beginTime") Date beginTime, @Param("e @Query("update Waveform w SET w.active = :active where w.id not in (:ids)") public int setActiveNotIn(@Param("active") boolean active, @Param("ids") List waveformIds); - @Query("select new Waveform(w.id, w.version, w.event, w.stream, w.beginTime, w.endTime, w.segmentType, w.segmentUnits, w.lowFrequency, w.highFrequency, w.sampleRate, w.active) from Waveform w " + @Query("select new Waveform(w.id, w.version, w.event, w.stream, w.beginTime, w.endTime, w.maxVelTime, w.segmentType, w.segmentUnits, w.lowFrequency, w.highFrequency, w.sampleRate, w.active) from Waveform w " + "where w.active = :active and" + "(w.stream.station.latitude between :minX and :maxX " + "and w.stream.station.longitude between :minY and :maxY) " diff --git a/calibration-service/calibration-service-api/pom.xml b/calibration-service/calibration-service-api/pom.xml index 519598bb..21c5c6ee 100644 --- a/calibration-service/calibration-service-api/pom.xml +++ b/calibration-service/calibration-service-api/pom.xml @@ -4,7 +4,7 @@ gov.llnl.gnem.apps.coda.calibration calibration-service - 1.0.10 + 1.0.11 4.0.0 @@ -17,10 +17,6 @@ gov.llnl.gnem.apps.coda.calibration calibration-model - - gov.llnl.gnem.apps.coda.common - common-service-api - diff --git a/calibration-service/calibration-service-api/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/api/AutopickingService.java b/calibration-service/calibration-service-api/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/api/AutopickingService.java index 28335536..3abdae33 100644 --- a/calibration-service/calibration-service-api/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/api/AutopickingService.java +++ b/calibration-service/calibration-service-api/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/api/AutopickingService.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2019, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory +* Copyright (c) 2021, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory * CODE-743439. * All rights reserved. * This file is part of CCT. For details, see https://github.com/LLNL/coda-calibration-tool. @@ -14,7 +14,7 @@ */ package gov.llnl.gnem.apps.coda.calibration.service.api; -import java.util.Collection; +import java.util.List; import java.util.Map; import gov.llnl.gnem.apps.coda.calibration.model.domain.PeakVelocityMeasurement; @@ -22,6 +22,6 @@ import gov.llnl.gnem.apps.coda.common.model.domain.SharedFrequencyBandParameters; public interface AutopickingService { - public Collection autoPickVelocityMeasuredWaveforms(final Collection velocityMeasurements, + public List autoPickVelocityMeasuredWaveforms(final List velocityMeasurements, final Map frequencyBandParameters); } diff --git a/calibration-service/calibration-service-api/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/api/CalibrationService.java b/calibration-service/calibration-service-api/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/api/CalibrationService.java index dfac5804..0e06f65e 100644 --- a/calibration-service/calibration-service-api/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/api/CalibrationService.java +++ b/calibration-service/calibration-service-api/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/api/CalibrationService.java @@ -24,17 +24,17 @@ public interface CalibrationService { - public boolean startCalibration(Boolean autoPickingEnabled); + public boolean startCalibration(boolean autoPickingEnabled); public boolean cancelCalibration(Long id); public boolean clearData(); - public Future> makeMwMeasurements(Boolean autoPickingEnabled, Boolean persistResults); + public Future> makeMwMeasurements(boolean autoPickingEnabled, boolean persistResults); - public Future> makeMwMeasurements(Boolean autoPickingEnabled, Boolean persistResults, Set eventIds); + public Future> makeMwMeasurements(boolean autoPickingEnabled, boolean persistResults, Set eventIds); - public Future> makeMwMeasurements(Boolean autoPickingEnabled, Boolean persistResults, List stacks); + public Future> makeMwMeasurements(boolean autoPickingEnabled, boolean persistResults, List stacks); public List toggleAllByEventIds(List eventIds); } diff --git a/calibration-service/calibration-service-api/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/api/ShapeCalibrationService.java b/calibration-service/calibration-service-api/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/api/ShapeCalibrationService.java index 4d78b48e..293102c1 100644 --- a/calibration-service/calibration-service-api/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/api/ShapeCalibrationService.java +++ b/calibration-service/calibration-service-api/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/api/ShapeCalibrationService.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2018, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory +* Copyright (c) 2021, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory * CODE-743439. * All rights reserved. * This file is part of CCT. For details, see https://github.com/LLNL/coda-calibration-tool. @@ -14,16 +14,22 @@ */ package gov.llnl.gnem.apps.coda.calibration.service.api; -import java.util.Collection; +import java.util.List; import java.util.Map; -import gov.llnl.gnem.apps.coda.calibration.model.domain.ShapeFitterConstraints; import gov.llnl.gnem.apps.coda.calibration.model.domain.PeakVelocityMeasurement; +import gov.llnl.gnem.apps.coda.calibration.model.domain.ShapeFitterConstraints; import gov.llnl.gnem.apps.coda.common.model.domain.FrequencyBand; import gov.llnl.gnem.apps.coda.common.model.domain.SharedFrequencyBandParameters; +import gov.llnl.gnem.apps.coda.common.model.domain.SyntheticCoda; public interface ShapeCalibrationService { - public Map measureShapes(Collection velocityMeasurements, - Map frequencyBandParameters, ShapeFitterConstraints constraints, boolean autoPickingEnabled) throws InterruptedException; + public Map measureShapes(List snrFilteredVelocity, + Map frequencyBandParameterMap, ShapeFitterConstraints constraints, boolean autoPickingEnabled, boolean shouldPersistResults) throws InterruptedException; + + public Map measureShapes(List snrFilteredVelocity, + Map frequencyBandParameterMap, ShapeFitterConstraints constraints) throws InterruptedException; + + public List adjustEndPicksBasedOnSynthetics(List velocityMeasurements, List synthetics, ShapeFitterConstraints constraints); } diff --git a/common-service/common-service-api/src/main/java/gov/llnl/gnem/apps/coda/common/service/api/BaseService.java b/calibration-service/calibration-service-api/src/main/java/gov/llnl/gnem/apps/coda/common/service/api/BaseService.java similarity index 100% rename from common-service/common-service-api/src/main/java/gov/llnl/gnem/apps/coda/common/service/api/BaseService.java rename to calibration-service/calibration-service-api/src/main/java/gov/llnl/gnem/apps/coda/common/service/api/BaseService.java diff --git a/common-service/common-service-api/src/main/java/gov/llnl/gnem/apps/coda/common/service/api/Listener.java b/calibration-service/calibration-service-api/src/main/java/gov/llnl/gnem/apps/coda/common/service/api/Listener.java similarity index 100% rename from common-service/common-service-api/src/main/java/gov/llnl/gnem/apps/coda/common/service/api/Listener.java rename to calibration-service/calibration-service-api/src/main/java/gov/llnl/gnem/apps/coda/common/service/api/Listener.java diff --git a/common-service/common-service-api/src/main/java/gov/llnl/gnem/apps/coda/common/service/api/NotificationService.java b/calibration-service/calibration-service-api/src/main/java/gov/llnl/gnem/apps/coda/common/service/api/NotificationService.java similarity index 100% rename from common-service/common-service-api/src/main/java/gov/llnl/gnem/apps/coda/common/service/api/NotificationService.java rename to calibration-service/calibration-service-api/src/main/java/gov/llnl/gnem/apps/coda/common/service/api/NotificationService.java diff --git a/common-service/common-service-api/src/main/java/gov/llnl/gnem/apps/coda/common/service/api/WaveformPickService.java b/calibration-service/calibration-service-api/src/main/java/gov/llnl/gnem/apps/coda/common/service/api/WaveformPickService.java similarity index 100% rename from common-service/common-service-api/src/main/java/gov/llnl/gnem/apps/coda/common/service/api/WaveformPickService.java rename to calibration-service/calibration-service-api/src/main/java/gov/llnl/gnem/apps/coda/common/service/api/WaveformPickService.java diff --git a/common-service/common-service-api/src/main/java/gov/llnl/gnem/apps/coda/common/service/api/WaveformService.java b/calibration-service/calibration-service-api/src/main/java/gov/llnl/gnem/apps/coda/common/service/api/WaveformService.java similarity index 100% rename from common-service/common-service-api/src/main/java/gov/llnl/gnem/apps/coda/common/service/api/WaveformService.java rename to calibration-service/calibration-service-api/src/main/java/gov/llnl/gnem/apps/coda/common/service/api/WaveformService.java diff --git a/envelope-service/envelope-service-api/src/main/java/gov/llnl/gnem/apps/coda/envelope/service/api/EnvelopeCreationService.java b/calibration-service/calibration-service-api/src/main/java/gov/llnl/gnem/apps/coda/envelope/service/api/EnvelopeCreationService.java similarity index 100% rename from envelope-service/envelope-service-api/src/main/java/gov/llnl/gnem/apps/coda/envelope/service/api/EnvelopeCreationService.java rename to calibration-service/calibration-service-api/src/main/java/gov/llnl/gnem/apps/coda/envelope/service/api/EnvelopeCreationService.java diff --git a/envelope-service/envelope-service-api/src/main/java/gov/llnl/gnem/apps/coda/envelope/service/api/EnvelopeParamsService.java b/calibration-service/calibration-service-api/src/main/java/gov/llnl/gnem/apps/coda/envelope/service/api/EnvelopeParamsService.java similarity index 100% rename from envelope-service/envelope-service-api/src/main/java/gov/llnl/gnem/apps/coda/envelope/service/api/EnvelopeParamsService.java rename to calibration-service/calibration-service-api/src/main/java/gov/llnl/gnem/apps/coda/envelope/service/api/EnvelopeParamsService.java diff --git a/envelope-service/envelope-service-api/src/main/java/gov/llnl/gnem/apps/coda/envelope/service/api/WaveformStacker.java b/calibration-service/calibration-service-api/src/main/java/gov/llnl/gnem/apps/coda/envelope/service/api/WaveformStacker.java similarity index 100% rename from envelope-service/envelope-service-api/src/main/java/gov/llnl/gnem/apps/coda/envelope/service/api/WaveformStacker.java rename to calibration-service/calibration-service-api/src/main/java/gov/llnl/gnem/apps/coda/envelope/service/api/WaveformStacker.java diff --git a/calibration-service/calibration-service-impl/pom.xml b/calibration-service/calibration-service-impl/pom.xml index b2f719e1..6a2f958a 100644 --- a/calibration-service/calibration-service-impl/pom.xml +++ b/calibration-service/calibration-service-impl/pom.xml @@ -4,7 +4,7 @@ gov.llnl.gnem.apps.coda.calibration calibration-service - 1.0.10 + 1.0.11 4.0.0 @@ -51,26 +51,6 @@ ch.qos.logback logback-classic - - org.apache.commons - commons-math3 - - - gov.llnl.gnem.apps.coda.common - common-model - - - gov.llnl.gnem.apps.coda.common - common-repository - - - gov.llnl.gnem.apps.coda.common - common-service-api - - - gov.llnl.gnem.apps.coda.common - common-service-impl - javax.annotation javax.annotation-api diff --git a/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/AutopickingServiceImpl.java b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/AutopickingServiceImpl.java index 407ffd2a..0efb8f9a 100644 --- a/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/AutopickingServiceImpl.java +++ b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/AutopickingServiceImpl.java @@ -15,7 +15,7 @@ package gov.llnl.gnem.apps.coda.calibration.service.impl; import java.util.ArrayList; -import java.util.Collection; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -48,7 +48,7 @@ public AutopickingServiceImpl(EndTimePicker endTimePicker) { } @Override - public Collection autoPickVelocityMeasuredWaveforms(final Collection velocityMeasurements, + public List autoPickVelocityMeasuredWaveforms(final List velocityMeasurements, final Map frequencyBandParameters) { return velocityMeasurements.parallelStream().filter(vel -> vel.getWaveform() != null).map(vel -> { SharedFrequencyBandParameters params = frequencyBandParameters.get(new FrequencyBand(vel.getWaveform().getLowFrequency(), vel.getWaveform().getHighFrequency())); @@ -71,23 +71,9 @@ public Collection autoPickVelocityMeasuredWaveforms(fin double minlength = params.getMinLength(); double maxlength = params.getMaxLength(); - double vr = params.getVelocity0() - params.getVelocity1() / (params.getVelocity2() + vel.getDistance()); - if (vr == 0.0) { - vr = 1.0; - } TimeT originTime = new TimeT(vel.getWaveform().getEvent().getOriginTime()); - TimeT startTime; - TimeT trimTime = originTime.add(vel.getDistance() / vr); + TimeT startTime = originTime.add(vel.getTimeSecFromOrigin()); TimeT beginTime = new TimeT(vel.getWaveform().getBeginTime()); - TimeSeries trimmedWaveform = converter.convert(vel.getWaveform()); - try { - trimmedWaveform.cutBefore(trimTime); - trimmedWaveform.cutAfter(trimTime.add(30.0)); - - startTime = new TimeT(trimTime.getEpochTime() + trimmedWaveform.getMaxTime()[0]); - } catch (IllegalArgumentException e) { - startTime = trimTime; - } TimeSeries segment = converter.convert(vel.getWaveform()); if (segment.getSamprate() > 1.0) { diff --git a/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/CalibrationServiceImpl.java b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/CalibrationServiceImpl.java index 5498ca6e..cc5ced5d 100644 --- a/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/CalibrationServiceImpl.java +++ b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/CalibrationServiceImpl.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2018, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory +* Copyright (c) 2021, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory * CODE-743439. * All rights reserved. * This file is part of CCT. For details, see https://github.com/LLNL/coda-calibration-tool. @@ -167,7 +167,7 @@ public CalibrationServiceImpl(WaveformService waveformService, PeakVelocityMeasu } @Override - public Future> makeMwMeasurements(Boolean autoPickingEnabled, Boolean persistResults) { + public Future> makeMwMeasurements(boolean autoPickingEnabled, boolean persistResults) { final Long id = atomicLong.getAndIncrement(); Future> future = CompletableFuture.completedFuture(new Result<>(false, new MeasuredMwReportByEvent())); Supplier measurementFunc = () -> { @@ -181,7 +181,7 @@ public Future> makeMwMeasurements(Boolean autoPi } @Override - public Future> makeMwMeasurements(Boolean autoPickingEnabled, Boolean persistResults, Set eventIds) { + public Future> makeMwMeasurements(boolean autoPickingEnabled, boolean persistResults, Set eventIds) { final Long id = atomicLong.getAndIncrement(); Supplier measurementFunc = () -> { MeasuredMwReportByEvent measuredMws = new MeasuredMwReportByEvent(); @@ -190,12 +190,13 @@ public Future> makeMwMeasurements(Boolean autoPi if (stacks != null && !stacks.isEmpty()) { measuredMws = makeMwMeasurements(id, autoPickingEnabled, persistResults, stacks); } else { - notificationService.post(new MeasurementStatusEvent(id, - MeasurementStatusEvent.Status.ERROR, - new Result(false, - new LightweightIllegalStateException("No matching waveforms found for event ids: " + eventIds != null - ? eventIds.toString() - : "{null}")))); + notificationService.post( + new MeasurementStatusEvent(id, + MeasurementStatusEvent.Status.ERROR, + new Result(false, + new LightweightIllegalStateException("No matching waveforms found for event ids: " + eventIds != null + ? eventIds.toString() + : "{null}")))); } return measuredMws; @@ -204,7 +205,7 @@ public Future> makeMwMeasurements(Boolean autoPi } @Override - public Future> makeMwMeasurements(Boolean autoPickingEnabled, Boolean persistResults, List waveforms) { + public Future> makeMwMeasurements(boolean autoPickingEnabled, boolean persistResults, List waveforms) { final Long id = atomicLong.getAndIncrement(); Supplier measurementFunc = () -> { MeasuredMwReportByEvent measuredMws = new MeasuredMwReportByEvent(); @@ -249,7 +250,7 @@ private Future> getMeasurementFuture(final Long return future; } - private MeasuredMwReportByEvent makeMwMeasurements(Long id, Boolean autoPickingEnabled, Boolean persistResults, List stacks) { + private MeasuredMwReportByEvent makeMwMeasurements(Long id, boolean autoPickingEnabled, boolean persistResults, List stacks) { log.info("Starting measurement at {}", LocalDateTime.now()); MeasuredMwReportByEvent details = new MeasuredMwReportByEvent(); if (stacks != null) { @@ -259,31 +260,49 @@ private MeasuredMwReportByEvent makeMwMeasurements(Long id, Boolean autoPickingE Map frequencyBandParameterMap = mapParamsToFrequencyBands(sharedParametersService.findAll()); List measStacks = stacks; - Collection velocityMeasured = Optional.ofNullable(peakVelocityMeasurementsService.measureVelocities(measStacks, velocityConfig)) - .orElseGet(() -> Stream.empty()) - .collect(Collectors.toList()); + List velocityMeasured = Optional.ofNullable(peakVelocityMeasurementsService.measureVelocities(measStacks, velocityConfig)) + .orElseGet(() -> Stream.empty()) + .collect(Collectors.toList()); if (autoPickingEnabled) { velocityMeasured = picker.autoPickVelocityMeasuredWaveforms(velocityMeasured, frequencyBandParameterMap); - if (persistResults) { - velocityMeasured = velocityMeasured.parallelStream().map(v -> v.setWaveform(waveformService.save(v.getWaveform()))).collect(Collectors.toList()); - } } final Map snrFilterMap = new HashMap<>(frequencyBandParameterMap); velocityMeasured = filterVelocityBySnr(snrFilterMap, velocityMeasured.stream()); - measStacks = velocityMeasured.stream().map(vel -> vel.getWaveform()).collect(Collectors.toList()); + + measStacks = velocityMeasured.stream().map(PeakVelocityMeasurement::getWaveform).filter(Objects::nonNull).collect(Collectors.toList()); measStacks = filterToEndPicked(measStacks); List synthetics = syntheticGenerationService.generateSynthetics(measStacks, frequencyBandParameterMap); + if (autoPickingEnabled) { + ShapeFitterConstraints constraints = configService.getCalibrationShapeFitterConstraints(); + velocityMeasured = shapeCalibrationService.adjustEndPicksBasedOnSynthetics(velocityMeasured, synthetics, constraints); + try { + shapeCalibrationService.measureShapes(velocityMeasured, frequencyBandParameterMap, constraints, autoPickingEnabled, false); + } catch (InterruptedException e) { + return details; + } + if (persistResults) { + List picks = velocityMeasured.stream().map(PeakVelocityMeasurement::getWaveform).filter(Objects::nonNull).collect(Collectors.toList()); + waveformService.save(picks); + } + + measStacks = velocityMeasured.stream().map(vel -> vel.getWaveform()).collect(Collectors.toList()); + measStacks = filterToEndPicked(measStacks); + + synthetics = syntheticGenerationService.generateSynthetics(measStacks, frequencyBandParameterMap); + } + List spectra = spectraCalc.measureAmplitudes(synthetics, frequencyBandParameterMap, velocityConfig, stationFrequencyBandMap); - List measuredMwsParams = siteCalibrationService.fitMws(spectraByFrequencyBand(spectra), - mdacFiService.findFirst(), - collectByFrequencyBand(mdacPsService.findAll()), - collectByEvid(referenceMwService.findAll()), - stationFrequencyBandMap, - PICK_TYPES.LG); + List measuredMwsParams = siteCalibrationService.fitMws( + spectraByFrequencyBand(spectra), + mdacFiService.findFirst(), + collectByFrequencyBand(mdacPsService.findAll()), + collectByEvid(referenceMwService.findAll()), + stationFrequencyBandMap, + PICK_TYPES.LG); Map measuredMwsMap = Optional.ofNullable(measuredMwsParams).orElseGet(ArrayList::new).stream().map(mwp -> { Event event = getEventForId(mwp.getEventId(), eventsInStacks); @@ -294,10 +313,12 @@ private MeasuredMwReportByEvent makeMwMeasurements(Long id, Boolean autoPickingE } }).collect(Collectors.toMap(kv -> kv.getKey(), kv -> kv.getValue())); + final Map freqParamMap = frequencyBandParameterMap; Map> fitSpectra = measuredMwsMap.entrySet() .parallelStream() - .map(mw -> new AbstractMap.SimpleEntry<>(mw.getKey().getEventId(), - computeFitSpectra(mw.getValue(), frequencyBandParameterMap.keySet(), PICK_TYPES.LG))) + .map( + mw -> new AbstractMap.SimpleEntry<>(mw.getKey().getEventId(), + computeFitSpectra(mw.getValue(), freqParamMap.keySet(), PICK_TYPES.LG))) .collect(Collectors.toConcurrentMap(kv -> kv.getKey(), kv -> kv.getValue())); if (persistResults) { @@ -309,14 +330,15 @@ private MeasuredMwReportByEvent makeMwMeasurements(Long id, Boolean autoPickingE details.setFitSpectra(fitSpectra); - details.setMeasuredMwDetails(measuredMwsMap.entrySet() - .parallelStream() - .collect(Collectors.toConcurrentMap(kv -> kv.getKey().getEventId(), kv -> new MeasuredMwDetails(kv.getValue(), null, null, kv.getKey())))); + details.setMeasuredMwDetails( + measuredMwsMap.entrySet() + .parallelStream() + .collect(Collectors.toConcurrentMap(kv -> kv.getKey().getEventId(), kv -> new MeasuredMwDetails(kv.getValue(), null, null, kv.getKey())))); - details.setSpectraMeasurements(spectra.parallelStream() - .map(s -> new AbstractMap.SimpleEntry(s.getWaveform().getEvent().getEventId(), - new SpectraMeasurementMetadataImpl(s))) - .collect(Collectors.groupingByConcurrent(kv -> kv.getKey(), Collectors.mapping(kv -> kv.getValue(), Collectors.toList())))); + details.setSpectraMeasurements( + spectra.parallelStream() + .map(s -> new AbstractMap.SimpleEntry(s.getWaveform().getEvent().getEventId(), new SpectraMeasurementMetadataImpl(s))) + .collect(Collectors.groupingByConcurrent(kv -> kv.getKey(), Collectors.mapping(kv -> kv.getValue(), Collectors.toList())))); } else { log.info("Unable to measure Mws, no waveforms were provided."); } @@ -346,7 +368,7 @@ private Event getEventForId(String eventId, List eventsInStacks) { } @Override - public boolean startCalibration(Boolean autoPickingEnabled) { + public boolean startCalibration(boolean autoPickingEnabled) { // FIXME: These *All methods should be *AllByProjectID instead! final Long id = atomicLong.getAndIncrement(); try { @@ -355,8 +377,6 @@ public boolean startCalibration(Boolean autoPickingEnabled) { notificationService.post(new CalibrationStatusEvent(id, CalibrationStatusEvent.Status.STARTING)); log.info("Starting calibration at {}", LocalDateTime.now()); - // TODO: Look at removing auto picking code from the methods - // below and centralizing it to here instead. Map frequencyBandParameterMap = mapParamsToFrequencyBands(sharedParametersService.findAll()); final Map snrFilterMap = new HashMap<>(frequencyBandParameterMap); @@ -389,13 +409,20 @@ public boolean startCalibration(Boolean autoPickingEnabled) { ConcurrencyUtils.checkInterrupt(); notificationService.post(new CalibrationStatusEvent(id, CalibrationStatusEvent.Status.SHAPE_STARTING)); + // If auto-picking is enabled attempt to pick any envelopes that + // don't already have F-picks in this set + if (autoPickingEnabled) { + snrFilteredVelocity = picker.autoPickVelocityMeasuredWaveforms(snrFilteredVelocity, frequencyBandParameterMap); + snrFilteredVelocity = snrFilteredVelocity.parallelStream().map(v -> v.setWaveform(waveformService.save(v.getWaveform()))).collect(Collectors.toList()); + ConcurrencyUtils.checkInterrupt(); + } + // 2) Compute the shape parameters describing each stack // (Velocity V0-2, Beta B0-2, Gamma G0-2) and then fit // models to each of those parameters for each frequency band that can be used // to generate synthetic coda at any given distance and frequency band // combination - frequencyBandParameterMap = shapeCalibrationService.measureShapes(snrFilteredVelocity, frequencyBandParameterMap, constraints, autoPickingEnabled); - + frequencyBandParameterMap = shapeCalibrationService.measureShapes(snrFilteredVelocity, frequencyBandParameterMap, constraints); frequencyBandParameterMap = mapParamsToFrequencyBands(sharedParametersService.save(frequencyBandParameterMap.values())); // 3) Now we need to generate some basic synthetics for the @@ -403,11 +430,28 @@ public boolean startCalibration(Boolean autoPickingEnabled) { // raw amplitudes. Then feed the synthetics to the measurement // service and get raw at start and raw at measurement time // values back + stacks = snrFilteredVelocity.stream().map(PeakVelocityMeasurement::getWaveform).filter(Objects::nonNull).collect(Collectors.toList()); stacks = filterToEndPicked(stacks); - List spectra = spectraMeasurementService.measureSpectra(syntheticGenerationService.generateSynthetics(stacks, frequencyBandParameterMap), - frequencyBandParameterMap, - velocityConfig); + List synthetics = syntheticGenerationService.generateSynthetics(stacks, frequencyBandParameterMap); + List spectra = spectraMeasurementService.measureSpectra(synthetics, frequencyBandParameterMap, velocityConfig); + + if (autoPickingEnabled) { + //1. Re-pick based on divergence from model + snrFilteredVelocity = shapeCalibrationService.adjustEndPicksBasedOnSynthetics(snrFilteredVelocity, synthetics, constraints); + + //Now that we have re-picked based on the average model divergence we want to regenerate the synthetics and re-measure + //2. Re-fit shapes to new pick + frequencyBandParameterMap = shapeCalibrationService.measureShapes(snrFilteredVelocity, frequencyBandParameterMap, constraints, autoPickingEnabled, true); + + //Save any updated picks + List picks = snrFilteredVelocity.stream().map(v -> v.getWaveform()).collect(Collectors.toList()); + waveformService.save(picks); + + //3. Now that we have re-picked based on the average model divergence we want to regenerate the synthetics based on the new shape measurements + spectra = spectraMeasurementService.measureSpectra(syntheticGenerationService.generateSynthetics(stacks, frequencyBandParameterMap), frequencyBandParameterMap, velocityConfig); + } + synthetics = null; ConcurrencyUtils.checkInterrupt(); notificationService.post(new CalibrationStatusEvent(id, CalibrationStatusEvent.Status.PATH_STARTING)); @@ -433,20 +477,22 @@ public boolean startCalibration(Boolean autoPickingEnabled) { // from the expected source spectra for that MW value. This value is // recorded as the site specific offset for measured values at each // frequency band - Map> frequencyBandSiteParameterMap = siteCalibrationService.measureSiteCorrections(spectraByFrequencyBand(spectra), - mdacFiService.findFirst(), - collectByFrequencyBand(mdacPsService.findAll()), - collectByEvid(referenceMwService.findAll()), - frequencyBandParameterMap, - PICK_TYPES.LG); + Map> frequencyBandSiteParameterMap = siteCalibrationService.measureSiteCorrections( + spectraByFrequencyBand(spectra), + mdacFiService.findFirst(), + collectByFrequencyBand(mdacPsService.findAll()), + collectByEvid(referenceMwService.findAll()), + frequencyBandParameterMap, + PICK_TYPES.LG); ConcurrencyUtils.checkInterrupt(); // 7) Measure the amplitudes one last time to fill out the // Path+Site corrected amplitude values - spectra = spectraMeasurementService.measureSpectra(syntheticService.save(syntheticGenerationService.generateSynthetics(stacks, frequencyBandParameterMap)), - frequencyBandParameterMap, - velocityConfig, - frequencyBandSiteParameterMap); + spectra = spectraMeasurementService.measureSpectra( + syntheticService.save(syntheticGenerationService.generateSynthetics(stacks, frequencyBandParameterMap)), + frequencyBandParameterMap, + velocityConfig, + frequencyBandSiteParameterMap); log.info("Calibration complete at {}", LocalDateTime.now()); notificationService.post(new CalibrationStatusEvent(id, CalibrationStatusEvent.Status.COMPLETE)); @@ -549,7 +595,7 @@ public List toggleAllByEventIds(List eventIds) { ReferenceMwParameters ref = referenceMwService.findByEventId(evid); ValidationMwParameters val = validationMwService.findByEventId(evid); - //Has ref but no validation (move Ref to Val) + // Has ref but no validation (move Ref to Val) if (ref != null && ref.getRefMw() != 0.0 && (val == null || val.getMw() == 0.0)) { if (val == null) { val = new ValidationMwParameters(); @@ -561,7 +607,7 @@ public List toggleAllByEventIds(List eventIds) { validationMwService.save(val); infoMesssages.add("Evid " + evid + " converted from reference event to validation."); } - //Has val but no reference (move Val to Ref) + // Has val but no reference (move Val to Ref) else if (val != null && val.getMw() != 0.0 && (ref == null || ref.getRefMw() == 0.0)) { if (ref == null) { ref = new ReferenceMwParameters(); @@ -573,7 +619,7 @@ else if (val != null && val.getMw() != 0.0 && (ref == null || ref.getRefMw() == referenceMwService.save(ref); infoMesssages.add("Evid " + evid + " converted from validation event to reference."); } - //Has both/neither (info message?) + // Has both/neither (info message?) else { infoMesssages.add("Ignoring request to convert evid " + evid + ", either the event has both or both are blank. Ref " + ref + "; Val " + val); } diff --git a/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/ConfigurationServiceImpl.java b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/ConfigurationServiceImpl.java index 58c5f4c1..149bb882 100644 --- a/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/ConfigurationServiceImpl.java +++ b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/ConfigurationServiceImpl.java @@ -65,7 +65,7 @@ private void setup() { public VelocityConfiguration update(VelocityConfiguration entry) { VelocityConfiguration mergedEntry; if (entry.getId() != null) { - mergedEntry = velConfRepository.findById(entry.getId()).get(); + mergedEntry = velConfRepository.findById(entry.getId()).orElse(null); } else { mergedEntry = velConfRepository.findFirstByOrderById(); } @@ -89,7 +89,7 @@ public VelocityConfiguration getVelocityConfiguration() { public ShapeFitterConstraints update(ShapeFitterConstraints entry) { ShapeFitterConstraints mergedEntry; if (entry.getId() != null) { - mergedEntry = shapeConstraintsRepository.findById(entry.getId()).get(); + mergedEntry = shapeConstraintsRepository.findById(entry.getId()).orElse(null); } else { mergedEntry = shapeConstraintsRepository.findFirstByOrderById(); } diff --git a/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/Joint1DPathCorrection.java b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/Joint1DPathCorrection.java index 22e3bf74..bda2800b 100644 --- a/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/Joint1DPathCorrection.java +++ b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/Joint1DPathCorrection.java @@ -75,9 +75,9 @@ public class Joint1DPathCorrection implements PathCalibrationService { private static final double XTRANS_MAX = 0.04; private static final double XTRANS_MIN = -10.0; - private static final double XCROSS_MAX = 3.0; + private static final double XCROSS_MAX = 5.0; private static final double XCROSS_MIN = 0.0; - private static final double Q_MAX = 3.0; + private static final double Q_MAX = 5.0; private static final double Q_MIN = 0.0; private static final double P1_MIN = -10.0; private static final double P1_MAX = -0.001; @@ -128,9 +128,9 @@ public Map measurePathCorrections( Map pathCorrectedFrequencyBandParameters = new HashMap<>(); Map>> dataMappedToEventAndStation = removeSingleStationOrFewerEntries(mapToEventAndStation(dataByFreqBand)); - + ConcurrencyUtils.checkInterrupt(); - frequencyBandParameters.entrySet().parallelStream().forEach(frequencyBandParams -> { + frequencyBandParameters.entrySet().parallelStream().forEach(frequencyBandParams -> { if (Thread.currentThread().isInterrupted()) { return; } diff --git a/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/MdacParametersFiServiceImpl.java b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/MdacParametersFiServiceImpl.java index 603cfc54..2379469e 100644 --- a/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/MdacParametersFiServiceImpl.java +++ b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/MdacParametersFiServiceImpl.java @@ -124,7 +124,7 @@ public MdacParametersFI findFirst() { public MdacParametersFI update(MdacParametersFI entry) { MdacParametersFI mergedEntry; if (entry.getId() != null) { - mergedEntry = mdacParametersRepository.findById(entry.getId()).get(); + mergedEntry = mdacParametersRepository.findById(entry.getId()).orElse(null); } else { mergedEntry = mdacParametersRepository.findFirstByOrderById(); } diff --git a/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/MdacParametersPsServiceImpl.java b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/MdacParametersPsServiceImpl.java index 03aae4cb..f6cc6940 100644 --- a/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/MdacParametersPsServiceImpl.java +++ b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/MdacParametersPsServiceImpl.java @@ -124,7 +124,7 @@ public MdacParametersPS findMatchingPhase(String phase) { public MdacParametersPS update(MdacParametersPS entry) { MdacParametersPS mergedEntry; if (entry.getId() != null) { - mergedEntry = mdacParametersRepository.findById(entry.getId()).get(); + mergedEntry = mdacParametersRepository.findById(entry.getId()).orElse(null); } else { mergedEntry = mdacParametersRepository.findByPhase(entry.getPhase()); } diff --git a/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/ShapeCalibrationServiceImpl.java b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/ShapeCalibrationServiceImpl.java index 78ccd0ea..987710f4 100644 --- a/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/ShapeCalibrationServiceImpl.java +++ b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/ShapeCalibrationServiceImpl.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2018, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory +* Copyright (c) 2021, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory * CODE-743439. * All rights reserved. * This file is part of CCT. For details, see https://github.com/LLNL/coda-calibration-tool. @@ -29,8 +29,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import gov.llnl.gnem.apps.coda.calibration.model.domain.ShapeFitterConstraints; +import gov.llnl.gnem.apps.coda.calibration.model.domain.EnvelopeFit; import gov.llnl.gnem.apps.coda.calibration.model.domain.PeakVelocityMeasurement; +import gov.llnl.gnem.apps.coda.calibration.model.domain.ShapeFitterConstraints; import gov.llnl.gnem.apps.coda.calibration.model.domain.ShapeMeasurement; import gov.llnl.gnem.apps.coda.calibration.service.api.ShapeCalibrationService; import gov.llnl.gnem.apps.coda.calibration.service.api.ShapeMeasurementService; @@ -38,9 +39,9 @@ import gov.llnl.gnem.apps.coda.calibration.service.impl.processing.ShapeCalculator; import gov.llnl.gnem.apps.coda.common.model.domain.FrequencyBand; import gov.llnl.gnem.apps.coda.common.model.domain.SharedFrequencyBandParameters; +import gov.llnl.gnem.apps.coda.common.model.domain.SyntheticCoda; import gov.llnl.gnem.apps.coda.common.model.domain.WaveformPick; import gov.llnl.gnem.apps.coda.common.model.util.PICK_TYPES; -import gov.llnl.gnem.apps.coda.common.service.api.WaveformService; @Service public class ShapeCalibrationServiceImpl implements ShapeCalibrationService { @@ -48,24 +49,30 @@ public class ShapeCalibrationServiceImpl implements ShapeCalibrationService { private static final Logger log = LoggerFactory.getLogger(ShapeCalibrationServiceImpl.class); private ShapeMeasurementService shapeMeasurementService; private ShapeCalculator shapeCalc; - private WaveformService waveService; - private AutopickingServiceImpl picker; @Autowired - public ShapeCalibrationServiceImpl(ShapeMeasurementService shapeMeasurementService, ShapeCalculator shapeCalc, WaveformService waveService, AutopickingServiceImpl picker) { + public ShapeCalibrationServiceImpl(ShapeMeasurementService shapeMeasurementService, ShapeCalculator shapeCalc) { this.shapeMeasurementService = shapeMeasurementService; this.shapeCalc = shapeCalc; - this.waveService = waveService; - this.picker = picker; } @Override - public Map measureShapes(Collection velocityMeasurements, - Map frequencyBandParameters, ShapeFitterConstraints constraints, boolean autoPickingEnabled) throws InterruptedException { - if (frequencyBandParameters.isEmpty()) { + public Map measureShapes(List velocityMeasurements, + Map frequencyBandParameters, ShapeFitterConstraints constraints) throws InterruptedException { + return measureShapes(velocityMeasurements, frequencyBandParameters, constraints, false, true); + } + + @Override + public Map measureShapes(List velocityMeasurements, + Map frequencyBandParamInputs, ShapeFitterConstraints constraints, boolean autoPickingEnabled, boolean shouldPersistResults) + throws InterruptedException { + Map frequencyBandParameters = new HashMap<>(); + if (frequencyBandParamInputs.isEmpty()) { // TODO: Propagate warning to the status API log.warn("No frequency band parameters available, unable to compute shape parameters without them!"); - return new HashMap<>(); + return frequencyBandParameters; + } else { + frequencyBandParamInputs.entrySet().forEach(entry -> frequencyBandParameters.put(entry.getKey(), new SharedFrequencyBandParameters().mergeNonNullOrEmptyFields(entry.getValue()))); } final CalibrationCurveFitter fitter = new CalibrationCurveFitter(); @@ -78,37 +85,32 @@ public Map measureShapes(Collectio constraints); ConcurrencyUtils.checkInterrupt(); - // 1) If auto-picking is enabled attempt to pick any envelopes that - // don't already have F-picks in this set - if (autoPickingEnabled) { - velocityMeasurements = picker.autoPickVelocityMeasuredWaveforms(velocityMeasurements, frequencyBandParameters); - velocityMeasurements = velocityMeasurements.parallelStream().map(v -> v.setWaveform(waveService.save(v.getWaveform()))).collect(Collectors.toList()); - } - ConcurrencyUtils.checkInterrupt(); - // 2) Filter to only measurements with an end pick + // 1) Filter to only measurements with an end pick Collection> filteredVelocityMeasurements = filterMeasurementsToEndPickedOnly(velocityMeasurements); ConcurrencyUtils.checkInterrupt(); - // 3) For every Waveform remaining, measure picks based on start + // 2) For every Waveform remaining, measure picks based on start // (computed from velocity) and end (from 'End'/'F' picks) - List betaAndGammaMeasurements = shapeCalc.fitShapelineToMeasuredEnvelopes(filteredVelocityMeasurements, frequencyBandCurveFits, constraints); + List betaAndGammaMeasurements = shapeCalc.fitShapelineToMeasuredEnvelopes(filteredVelocityMeasurements, frequencyBandCurveFits, constraints, autoPickingEnabled); ConcurrencyUtils.checkInterrupt(); - - // Shape measurements are intermediary results so rather than trying to - // merge them we want to just drop them wholesale if they exist and - // replace them with the new data set. - // TODO: Need to only delete these for the current project - shapeMeasurementService.deleteAll(); - - Map> frequencyBandShapeMeasurementMap = shapeMeasurementService.save(betaAndGammaMeasurements) - .parallelStream() - .filter(meas -> meas.getWaveform() != null) - .collect( - Collectors.groupingBy( - meas -> new FrequencyBand(meas.getWaveform().getLowFrequency(), - meas.getWaveform().getHighFrequency()))); + + if (shouldPersistResults) { + // Shape measurements are intermediary results so rather than trying to + // merge them we want to just drop them wholesale if they exist and + // replace them with the new data set. + // TODO: Need to only delete these for the current project + shapeMeasurementService.deleteAll(); + betaAndGammaMeasurements = shapeMeasurementService.save(betaAndGammaMeasurements); + } + + Map> frequencyBandShapeMeasurementMap = betaAndGammaMeasurements.parallelStream() + .filter(meas -> meas.getWaveform() != null) + .collect( + Collectors.groupingBy( + meas -> new FrequencyBand(meas.getWaveform().getLowFrequency(), + meas.getWaveform().getHighFrequency()))); ConcurrencyUtils.checkInterrupt(); frequencyBandCurveFits = fitter.fitAllBeta(frequencyBandShapeMeasurementMap, frequencyBandCurveFits, constraints); ConcurrencyUtils.checkInterrupt(); @@ -116,6 +118,48 @@ public Map measureShapes(Collectio return frequencyBandCurveFits; } + @Override + public List adjustEndPicksBasedOnSynthetics(List velocityMeasurements, List synthetics, ShapeFitterConstraints constraints) { + final CalibrationCurveFitter fitter = new CalibrationCurveFitter(); + + velocityMeasurements.parallelStream().forEach(velocityMeasurement -> { + boolean isAutoPicked = velocityMeasurement.getWaveform().getAssociatedPicks().stream().anyMatch(wp -> wp.getPickName().equalsIgnoreCase(PICK_TYPES.AP.name())); + if (isAutoPicked) { + SyntheticCoda synthetic = null; + if (synthetics != null && !synthetics.isEmpty()) { + synthetic = synthetics.parallelStream().filter(syn -> { + boolean matching; + if (syn.getSourceWaveform().getId() != null) { + matching = syn.getSourceWaveform().getId().equals(velocityMeasurement.getWaveform().getId()); + } else { + matching = syn.getSourceWaveform().equals(velocityMeasurement.getWaveform()); + } + return matching; + }).findAny().orElse(null); + } + + ShapeMeasurement measurement = shapeMeasurementService.findOneByWaveformId(velocityMeasurement.getWaveform().getId()); + WaveformPick endPick = velocityMeasurement.getWaveform().getAssociatedPicks().stream().filter(p -> PICK_TYPES.F.name().equalsIgnoreCase(p.getPickType())).findAny().orElse(null); + + if (synthetic != null && measurement != null && measurement.getId() != null && endPick != null) { + EnvelopeFit curve = fitter.fitCurveLengthByDivergenceFromSynthetic( + measurement, + synthetic, + endPick.getPickTimeSecFromOrigin(), + constraints, + synthetic.getSourceModel().getMinLength()); + //Ensure pick is propagated back to waveform + double end = curve.getEndTime(); + if (end >= 0d) { + endPick.setPickTimeSecFromOrigin((float) end); + } + } + } + }); + return velocityMeasurements; + + } + /** * Down-select the given {@link PeakVelocityMeasurement} collection to only * ones with 'End' picks defined and associate them into an Entry @@ -130,4 +174,5 @@ private Collection> filterMeasureme } }).filter(Objects::nonNull).collect(Collectors.toList()); } + } diff --git a/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/SharedFrequencyBandParametersServiceImpl.java b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/SharedFrequencyBandParametersServiceImpl.java index 9e28e2a8..02dea515 100644 --- a/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/SharedFrequencyBandParametersServiceImpl.java +++ b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/SharedFrequencyBandParametersServiceImpl.java @@ -14,6 +14,7 @@ */ package gov.llnl.gnem.apps.coda.calibration.service.impl; +import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; @@ -64,26 +65,14 @@ public void delete(SharedFrequencyBandParameters sharedFrequencyBandParameters) notificationService.post(new BandParametersDataChangeEvent()); } - @Override - public List save(Iterable entities) { - notificationService.post(new BandParametersDataChangeEvent()); - return getSharedFrequencyBandParametersRepository().saveAll(entities); - } - @Override public void delete(Iterable ids) { List toDelete = getSharedFrequencyBandParametersRepository().findAllById(ids); syntheticsRepository.deleteInBatchBySharedFrequencyBandParametersIds(toDelete.stream().map(sfb -> sfb.getId()).collect(Collectors.toList())); - getSharedFrequencyBandParametersRepository().deleteInBatch(toDelete); + getSharedFrequencyBandParametersRepository().deleteAllInBatch(toDelete); notificationService.post(new BandParametersDataChangeEvent()); } - @Override - public SharedFrequencyBandParameters save(SharedFrequencyBandParameters entity) { - notificationService.post(new BandParametersDataChangeEvent()); - return getSharedFrequencyBandParametersRepository().save(entity); - } - @Override public SharedFrequencyBandParameters findOne(Long id) { return getSharedFrequencyBandParametersRepository().findOneDetached(id); @@ -124,9 +113,28 @@ public List getFrequencyBands() { @Override public SharedFrequencyBandParameters update(SharedFrequencyBandParameters entry) { + SharedFrequencyBandParameters mergedEntry = findAndMergeIfExists(entry); + notificationService.post(new BandParametersDataChangeEvent()); + return sharedFrequencyBandParametersRepository.saveAndFlush(mergedEntry); + } + + @Override + public List save(Iterable entities) { + List merged = new ArrayList<>(); + entities.forEach(entity -> merged.add(findAndMergeIfExists(entity))); + notificationService.post(new BandParametersDataChangeEvent()); + return sharedFrequencyBandParametersRepository.saveAll(merged); + } + + @Override + public SharedFrequencyBandParameters save(SharedFrequencyBandParameters entity) { + return update(entity); + } + + private SharedFrequencyBandParameters findAndMergeIfExists(SharedFrequencyBandParameters entry) { SharedFrequencyBandParameters mergedEntry; if (entry.getId() != null) { - mergedEntry = sharedFrequencyBandParametersRepository.findById(entry.getId()).get(); + mergedEntry = sharedFrequencyBandParametersRepository.findById(entry.getId()).orElse(null); } else { mergedEntry = sharedFrequencyBandParametersRepository.findByLowFrequencyAndHighFrequency(entry.getLowFrequency(), entry.getHighFrequency()); } @@ -136,8 +144,7 @@ public SharedFrequencyBandParameters update(SharedFrequencyBandParameters entry) } else { mergedEntry = entry; } - notificationService.post(new BandParametersDataChangeEvent()); - return sharedFrequencyBandParametersRepository.saveAndFlush(mergedEntry); + return mergedEntry; } @Override diff --git a/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/SiteCalibrationServiceImpl.java b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/SiteCalibrationServiceImpl.java index d6317a68..58b4f37a 100644 --- a/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/SiteCalibrationServiceImpl.java +++ b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/SiteCalibrationServiceImpl.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2018, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory +* Copyright (c) 2021, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory * CODE-743439. * All rights reserved. * This file is part of CCT. For details, see https://github.com/LLNL/coda-calibration-tool. @@ -55,7 +55,6 @@ public class SiteCalibrationServiceImpl implements SiteCalibrationService { private static final double DYNE_LOG10_ADJUSTMENT = 7d; - private static final double ARBITRARY_LOW_STRESS_SIGMA = 0.01; private MdacCalculatorService mdac; private SiteFrequencyBandParametersService siteParamsService; private MeasuredMwsService measuredMwsService; @@ -84,7 +83,6 @@ public List fitMws(Map> freqStaMap : evidFreqMap.getValue().entrySet()) { FrequencyBand freqBand = freqStaMap.getKey(); - weightFunctionMapByEvent.put(evid, this::lowerFreqHigherWeights); for (Entry staMwEntry : freqStaMap.getValue().entrySet()) { double amp = staMwEntry.getValue().getPathAndSiteCorrected(); if (amp != 0.0) { @@ -98,6 +96,7 @@ public List fitMws(Map fitMws(Map> measureSiteCorrections(Map> dataByFreqBand, MdacParametersFI mdacFI, Map mdacPS, Map> refMws, Map frequencyBandParameters, PICK_TYPES selectedPhase) { - // TODO: Validate all the input exists and is sufficient to compute a - // useful site correction. - MdacParametersPS psRows = mdacPS.get(selectedPhase); //Input @@ -129,8 +125,8 @@ public Map> measureSite boolean hasGtSpectra = refMws.values().stream().flatMap(refs -> refs.stream()).filter(ref -> ref.getRefApparentStressInMpa() != null).anyMatch(ref -> ref.getRefApparentStressInMpa() > 0.0); //0-1A) If yes then omit everything above the corner frequency for MDAC model only events //0-1B) Add it to the GT spectra event map - //0-1C) Weight the Mw fit for that event 1.0 at all bands - //0-2A) If no then weight the corner frequency highly, the low middle, and the high low + //0-1C) Weight the Mw fit for that event 1.0 at all bands for that event + //0-2A) If no then weight based on the standard error of the bands + 1 //1) Generate spectra for reference events and get the site correction for each station that saw it. for (Entry>> evidFreqMap : evidFreqBandStaMeasurementsMap.entrySet()) { @@ -148,7 +144,6 @@ public Map> measureSite weightFunctionMapByEvent.put(evid, this::evenWeights); evidHasSpectra = true; } else if (serviceConfig.isSpectraTruncationEnabled() && hasGtSpectra) { - mdacFiEntry.setSigma(ARBITRARY_LOW_STRESS_SIGMA); weightFunctionMapByEvent.put(evid, this::evenWeights); } @@ -166,7 +161,7 @@ public Map> measureSite if (serviceConfig.isSpectraTruncationEnabled() && cornerFreq > 0.0 && highFreq > cornerFreq) { continue; } - double centerFreq = (highFreq + lowFreq) / 2; + double centerFreq = (highFreq + lowFreq) / 2.0; double[] refSpectra = mdacFunc.apply(centerFreq); @@ -189,7 +184,6 @@ public Map> measureSite } } } - weightFunctionMapByEvent.putIfAbsent(evid, this::lowerFreqHigherWeights); } //2) For every station with a site correction measured apply it to every other event and get average site term for every frequency band @@ -256,9 +250,9 @@ public Map> measureSite } } } + weightFunctionMapByEvent.putIfAbsent(evid, createDataWeightMapFunction(averageMapByEvent.get(evid))); } - //TODO: Weight bands by number of points and std-dev instead // 5) Convert average map into a set of Site correction objects for (Entry> freqBandCorrectionMap : staFreqBandSiteCorrectionMapAverage.entrySet()) { Station station = freqBandCorrectionMap.getKey(); @@ -298,19 +292,35 @@ private void overwriteSiteParams(Map evenWeights(Map frequencies) { SortedMap weightMap = new TreeMap<>(); for (Double frequency : frequencies.keySet()) { - weightMap.put(frequency, 1d); + weightMap.put(frequency, Double.valueOf(1d)); } return weightMap; } - private SortedMap lowerFreqHigherWeights(Map frequencies) { - SortedMap weightMap = new TreeMap<>(frequencies); - int count = 0; - for (Entry entry : weightMap.entrySet()) { - entry.setValue(count == 0 || count == 2 ? 0.5 : count == 1 ? 1.0 : count == 3 ? 0.25 : 0.1); - count++; - } - return weightMap; + private Function, SortedMap> createDataWeightMapFunction(Map data) { + return (Map frequencies) -> { + SortedMap weightMap = new TreeMap<>(); + Map rawData = new HashMap<>(); + if (data != null) { + data.entrySet().forEach(entry -> rawData.put((entry.getKey().getHighFrequency() + entry.getKey().getLowFrequency()) / 2.0, entry.getValue())); + } + for (Double frequency : frequencies.keySet()) { + SummaryStatistics stats = rawData.getOrDefault(frequency, new SummaryStatistics()); + + Double weight; + if (stats.getN() > 1 && Double.isFinite(stats.getStandardDeviation())) { + weight = 1d + 1.0/(stats.getStandardDeviation()/Math.sqrt(stats.getN())); + } + else { + weight = Double.valueOf(1d); + } + if (!Double.isFinite(weight)) { + weight = Double.valueOf(1d); + } + weightMap.put(frequency, weight); + } + return weightMap; + }; } public static Map>> mapToEventAndStation(Map> dataByFreqBand) { diff --git a/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/SyntheticCodaGenerationServiceImpl.java b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/SyntheticCodaGenerationServiceImpl.java index bd155d05..cc1ea4bb 100644 --- a/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/SyntheticCodaGenerationServiceImpl.java +++ b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/SyntheticCodaGenerationServiceImpl.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2018, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory +* Copyright (c) 2021, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory * CODE-743439. * All rights reserved. * This file is part of CCT. For details, see https://github.com/LLNL/coda-calibration-tool. @@ -74,16 +74,15 @@ private SyntheticCoda createSyntheticFromWaveform(Waveform sourceWaveform, Share double vr = syntheticCodaModel.getDistanceFunction(model.getVelocity0(), model.getVelocity1(), model.getVelocity2(), distance); double gr = syntheticCodaModel.getDistanceFunction(model.getGamma0(), model.getGamma1(), model.getGamma2(), distance); - // note distance/vr is a singularity point - start at t = dt TimeT eventTime = new TimeT(event.getOriginTime()); - TimeT codastart = eventTime; - if (vr != 0.0) { - codastart = codastart.add(distance / vr); - } - double maxTime = seis.getMaxTime()[0]; - double timediff = maxTime - codastart.subtractD(eventTime); - if (Math.abs(timediff) < 5.0) { - codastart.add(timediff); + TimeT codastart; + if (sourceWaveform.getMaxVelTime() != null) { + codastart = new TimeT(sourceWaveform.getMaxVelTime()); + } else { + codastart = eventTime; + if (vr != 0.0) { + codastart = codastart.add(distance / vr); + } } TimeT endTime = new TimeT(sourceWaveform.getEndTime()); diff --git a/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/SyntheticServiceImpl.java b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/SyntheticServiceImpl.java index 260824e8..f590180f 100644 --- a/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/SyntheticServiceImpl.java +++ b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/SyntheticServiceImpl.java @@ -17,6 +17,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; +import java.util.Optional; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -96,8 +97,9 @@ public long count() { @Override public SyntheticCoda update(SyntheticCoda payload) { SyntheticCoda merged; - if (payload.getId() != null) { - merged = repository.findById(payload.getId()).get(); + Optional existing = repository.findById(payload.getId()); + if (payload.getId() != null && existing.isPresent()) { + merged = existing.get(); merged = merged.mergeNonNullOrEmptyFields(payload); } else { merged = payload; @@ -110,8 +112,9 @@ public Collection update(Collection values) { List vals = new ArrayList<>(values.size()); for (SyntheticCoda payload : values) { SyntheticCoda merged; - if (payload.getId() != null) { - merged = repository.findById(payload.getId()).get(); + Optional existing = repository.findById(payload.getId()); + if (payload.getId() != null && existing.isPresent()) { + merged = existing.get(); merged = merged.mergeNonNullOrEmptyFields(payload); } else { merged = payload; diff --git a/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/processing/CalibrationCurveFitter.java b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/processing/CalibrationCurveFitter.java index c8c3c892..05fb29f9 100755 --- a/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/processing/CalibrationCurveFitter.java +++ b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/processing/CalibrationCurveFitter.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2018, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory +* Copyright (c) 2021, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory * CODE-743439. * All rights reserved. * This file is part of CCT. For details, see https://github.com/LLNL/coda-calibration-tool. @@ -47,6 +47,11 @@ import gov.llnl.gnem.apps.coda.calibration.model.domain.ShapeMeasurement; import gov.llnl.gnem.apps.coda.common.model.domain.FrequencyBand; import gov.llnl.gnem.apps.coda.common.model.domain.SharedFrequencyBandParameters; +import gov.llnl.gnem.apps.coda.common.model.domain.SyntheticCoda; +import gov.llnl.gnem.apps.coda.common.service.util.WaveformUtils; +import llnl.gnem.core.util.SeriesMath; +import llnl.gnem.core.util.TimeT; +import llnl.gnem.core.waveform.seismogram.TimeSeries; /** * Calculate the coda decay parameters (Mayeda, 2003) @@ -55,13 +60,110 @@ public class CalibrationCurveFitter { private Logger log = LoggerFactory.getLogger(CalibrationCurveFitter.class); - public EnvelopeFit fitCodaCMAES(final float[] segment, final double sampleRate, ShapeFitterConstraints constraints) { + public EnvelopeFit fitCurveLengthByDivergenceFromSynthetic(final ShapeMeasurement measurement, final SyntheticCoda synthetic, final double endPickTime, final ShapeFitterConstraints constraints, + final double minLengthTime) { + + EnvelopeFit fit = new EnvelopeFit(); + + final double originTimeOffset = new TimeT(synthetic.getBeginTime()).subtractD(new TimeT(synthetic.getSourceWaveform().getEvent().getOriginTime())); + double maxTime = endPickTime - originTimeOffset; + final double sampleRate = synthetic.getSampleRate(); + + TimeSeries envSeis = new TimeSeries(WaveformUtils.doublesToFloats(synthetic.getSourceWaveform().getSegment()), + synthetic.getSourceWaveform().getSampleRate(), + new TimeT(synthetic.getSourceWaveform().getBeginTime())); + envSeis.interpolate(sampleRate); + + TimeSeries synthSeis = new TimeSeries(WaveformUtils.doublesToFloats(synthetic.getSegment()), synthetic.getSampleRate(), new TimeT(synthetic.getBeginTime())); + + TimeT startTime = new TimeT(synthetic.getBeginTime()); + TimeT endTime = new TimeT(synthetic.getBeginTime()).add(maxTime); + + boolean cutSucceeded = false; + try { + // Note this mutates envSeis and synthSeis! + cutSucceeded = WaveformUtils.cutSeismograms(envSeis, synthSeis, startTime, endTime); + } catch (IllegalArgumentException e) { + log.warn("Error attempting to cut seismograms during amplitude measurement; {}", e.getMessage()); + } + + if (cutSucceeded) { + float[] envData = envSeis.getData(); + float[] synthData = synthSeis.getData(); + + TimeSeries diff = new TimeSeries(SeriesMath.subtract(envData, synthData), synthSeis.getSamprate(), synthSeis.getTime()); + final double median = diff.getMedian(); + double[] scaledSynthetic = WaveformUtils.floatsToDoubles(SeriesMath.add(synthData, median)); + + if (scaledSynthetic.length < maxTime) { + maxTime = scaledSynthetic.length; + } + double minTime = minLengthTime + 2.0; + if (minTime < maxTime / 4.0) { + minTime = maxTime / 4.0; + } + if (maxTime < minTime) { + minTime = maxTime; + } + + int minLength = (int) (minTime * sampleRate); + int maxLength = (int) (maxTime * sampleRate); + + double val; + double minVal = Double.MAX_VALUE; + int minIdx = -1; + for (int j = minLength; j < maxLength; j++) { + //t = 0 is singular so we cheat and shift it right one. + double t = ((j) / sampleRate) + 1.0; + double model = scaledSynthetic[j]; + double individual = measurement.getMeasuredIntercept() - measurement.getMeasuredGamma() * Math.log10(t) + (measurement.getMeasuredBeta() * t); + val = Math.abs(model - individual); + if (val <= minVal || val <= .1) { + minIdx = j; + minVal = val; + } + } + + if (minIdx > 0) { + fit.setEndTime((minIdx / sampleRate) + originTimeOffset); + fit.setError(minVal); + } + } + + return fit; + } + + public EnvelopeFit fitCodaCMAES(final float[] segment, final double sampleRate, ShapeFitterConstraints constraints, double startTime) { + return fitCodaCMAES(segment, sampleRate, constraints, startTime, false); + } + + public EnvelopeFit fitCodaCMAES(final float[] segment, final double sampleRate, ShapeFitterConstraints constraints, double startTime, boolean autoPickingEnabled) { double minInt = constraints.getMinIntercept(); double maxInt = constraints.getMaxIntercept(); double minGamma = constraints.getMinGamma(); double maxGamma = constraints.getMaxGamma(); double minBeta = constraints.getMinBeta(); double maxBeta = constraints.getMaxBeta(); + double lengthWeight = constraints.getLengthWeight(); + + double maxTime; + double minTime = startTime; + if (minTime < 2d) { + minTime = 2d; + } + + if (autoPickingEnabled) { + maxTime = segment.length / sampleRate; + } else { + maxTime = minTime; + } + + if (maxTime < minTime) { + minTime = segment.length / sampleRate; + maxTime = minTime; + } + + boolean shouldAutoPick = autoPickingEnabled && maxTime > minTime; EnvelopeFit fit = new EnvelopeFit(); @@ -77,13 +179,21 @@ public EnvelopeFit fitCodaCMAES(final float[] segment, final double sampleRate, double gamma = point[1]; double beta = point[2]; double sum = 0.0; - for (int j = 0; j < segment.length; j++) { + int length; + if (shouldAutoPick) { + length = (int) (point[3] / sampleRate); + } else { + length = segment.length; + } + + for (int j = 0; j < length; j++) { double t = (j / sampleRate) + 1.0; double actual = segment[j]; double predicted = intercept - (gamma * Math.log10(t)) + (beta * t); sum = lossFunction(sum, predicted, actual); } - return sum; + sum = sum / length; + return sum - ((sum * lengthWeight) * ((double) length / segment.length)); }; ConvergenceChecker convergenceChecker = new SimplePointChecker<>(0.0005, -1.0, 100000); @@ -99,17 +209,22 @@ public EnvelopeFit fitCodaCMAES(final float[] segment, final double sampleRate, PointValuePair bestResult = optimizeCMAES( prediction, - new InitialGuess(new double[] { startIntercept, minGamma, startBeta }), - new CMAESOptimizer.Sigma(new double[] { (maxInt - minInt) / 2.0, (maxGamma - minGamma) / 2.0, (maxBeta - minBeta) / 2.0 }), + new InitialGuess(new double[] { startIntercept, minGamma, startBeta, maxTime }), + new CMAESOptimizer.Sigma(new double[] { (maxInt - minInt) / 2.0, (maxGamma - minGamma) / 2.0, (maxBeta - minBeta) / 2.0, (maxTime - minTime) / 2.0 }), convergenceChecker, 50, - new SimpleBounds(new double[] { -Double.MAX_VALUE, minGamma, minBeta }, new double[] { Double.MAX_VALUE, maxGamma, maxBeta })); + new SimpleBounds(new double[] { -Double.MAX_VALUE, minGamma, minBeta, minTime }, new double[] { Double.MAX_VALUE, maxGamma, maxBeta, maxTime })); double[] curve = bestResult.getKey(); fit.setIntercept(curve[0]); fit.setGamma(curve[1]); fit.setBeta(curve[2]); - fit.setError(bestResult.getValue() / segment.length); + if (shouldAutoPick) { + fit.setEndTime(curve[3]); + fit.setError(bestResult.getValue() / curve[3]); + } else { + fit.setError(bestResult.getValue() / segment.length); + } return fit; } diff --git a/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/processing/CodaSNREndTimePicker.java b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/processing/CodaSNREndTimePicker.java index fbbede94..f9b50b30 100644 --- a/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/processing/CodaSNREndTimePicker.java +++ b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/processing/CodaSNREndTimePicker.java @@ -46,8 +46,8 @@ public double getEndTime(float[] waveform, double sampleRate, double startTimeEp private Double getSnrEndPick(final float[] waveform, final double sampleRate, int startOffset, final double minLengthSec, final double maxLengthSec, final double minimumSnr, final double noise, final int windowSize) { - int obsWindow = (int) (windowSize / sampleRate); - int spikeSamples = (int) ((windowSize / 4) / sampleRate); + int obsWindow = (int) (windowSize * sampleRate); + int spikeSamples = (int) ((windowSize / 4.0) * sampleRate); DescriptiveStatistics obs = new DescriptiveStatistics(obsWindow); DescriptiveStatistics spike = new DescriptiveStatistics(spikeSamples); SimpleRegression spikeReg = new SimpleRegression(); @@ -92,13 +92,16 @@ private Double getSnrEndPick(final float[] waveform, final double sampleRate, in } double spikeSlope = spikeReg.getSlope(); - if (!Double.isNaN(spikeSlope)) { - if (spikeSlope > 0.1) { - snrTimePick = (i - spike.getN() - 1) / sampleRate; - break; - } + if (!Double.isNaN(spikeSlope) && spikeSlope > 0.1) { + snrTimePick = (i - spike.getN() - 1) / sampleRate; + break; } } + + if (waveform[i] < noiseThreshold) { + snrTimePick = i / sampleRate; + break; + } } } } diff --git a/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/processing/MaxVelocityCalculator.java b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/processing/MaxVelocityCalculator.java index 1a8dd354..102b24fd 100644 --- a/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/processing/MaxVelocityCalculator.java +++ b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/processing/MaxVelocityCalculator.java @@ -113,6 +113,10 @@ private Stream computeMaximumVelocity(List wa // the envelope noise is in log10 units. double snrPeak = peakS[1] - noise; + + //Attach the measurement to the waveform for later + rawWaveform.setMaxVelTime(origintime.add(peakS[0]).getDate()); + return new PeakVelocityMeasurement().setWaveform(rawWaveform) .setNoiseStartSecondsFromOrigin(0d) .setNoiseEndSecondsFromOrigin(20d) diff --git a/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/processing/ShapeCalculator.java b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/processing/ShapeCalculator.java index b6cc470f..ddb305a8 100644 --- a/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/processing/ShapeCalculator.java +++ b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/processing/ShapeCalculator.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2018, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory +* Copyright (c) 2021, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory * CODE-743439. * All rights reserved. * This file is part of CCT. For details, see https://github.com/LLNL/coda-calibration-tool. @@ -34,6 +34,7 @@ import gov.llnl.gnem.apps.coda.common.model.domain.FrequencyBand; import gov.llnl.gnem.apps.coda.common.model.domain.SharedFrequencyBandParameters; import gov.llnl.gnem.apps.coda.common.model.domain.WaveformPick; +import gov.llnl.gnem.apps.coda.common.model.util.PICK_TYPES; import gov.llnl.gnem.apps.coda.common.service.util.WaveformToTimeSeriesConverter; import llnl.gnem.core.util.TimeT; import llnl.gnem.core.waveform.seismogram.TimeSeries; @@ -51,22 +52,24 @@ public ShapeCalculator(WaveformToTimeSeriesConverter converter) { } public List fitShapelineToMeasuredEnvelopes(Collection> filteredVelocityMeasurements, - Map frequencyBandParameters, ShapeFitterConstraints constraints) { - + Map frequencyBandParameters, ShapeFitterConstraints constraints, boolean autoPickingEnabled) { List measuredShapes = new ArrayList<>(); if (filteredVelocityMeasurements == null || filteredVelocityMeasurements.isEmpty()) { // TODO: Feedback about this to the user return measuredShapes; } - CalibrationCurveFitter curveFitter = new CalibrationCurveFitter(); - // Loop through each entry and try to fit a line using the max // amplitude prediction for that frequency band from the velocity model measuredShapes = filteredVelocityMeasurements.parallelStream().map(filteredVelocityMeasurement -> { + + CalibrationCurveFitter curveFitter = new CalibrationCurveFitter(); PeakVelocityMeasurement velocityMeasurement = filteredVelocityMeasurement.getKey(); WaveformPick endPick = filteredVelocityMeasurement.getValue(); + + boolean isAutoPicked = velocityMeasurement.getWaveform().getAssociatedPicks().stream().anyMatch(wp -> wp.getPickName().equalsIgnoreCase(PICK_TYPES.AP.name())); + boolean shouldAutoPick = autoPickingEnabled && isAutoPicked; FrequencyBand freqBand = new FrequencyBand(velocityMeasurement.getWaveform().getLowFrequency(), velocityMeasurement.getWaveform().getHighFrequency()); SharedFrequencyBandParameters frequencyBandParameter = frequencyBandParameters.get(freqBand); @@ -100,32 +103,45 @@ public List fitShapelineToMeasuredEnvelopes(Collection 1.0) { - synthSeis.interpolate(1.0); + seis.cut(travelTime, endTime); + if (seis.getSamprate() > 1.0) { + seis.interpolate(1.0); } - if (constraints != null && constraints.getFittingPointCount() > 0 && synthSeis.getNsamp() > constraints.getFittingPointCount()) { - double samprate = (constraints.getFittingPointCount() / (double) synthSeis.getNsamp()) * synthSeis.getSamprate(); - synthSeis.interpolate(samprate); + if (constraints != null && constraints.getFittingPointCount() > 0 && seis.getNsamp() > constraints.getFittingPointCount()) { + double samprate = (constraints.getFittingPointCount() / (double) seis.getNsamp()) * seis.getSamprate(); + seis.interpolate(samprate); + } + + if (frequencyBandParameter.getMinLength() > 0 && seis.getLengthInSeconds() < frequencyBandParameter.getMinLength()) { + log.trace( + "Encountered a too small window length while processing {} with length {} and minimum window of {}; processing will skip this file", + velocityMeasurement, + seis.getLengthInSeconds(), + frequencyBandParameter.getMinLength()); + return null; + } else if (frequencyBandParameter.getMaxLength() > 0 && seis.getLengthInSeconds() > frequencyBandParameter.getMaxLength()) { + log.trace( + "Encountered a too large window length while processing {} with length {} and maximum window of {}; processing will continue on a truncated envelope", + velocityMeasurement, + seis.getLengthInSeconds(), + frequencyBandParameter.getMaxLength()); + seis.cutAfter(travelTime.add(frequencyBandParameter.getMaxLength())); } - if (frequencyBandParameter.getMinLength() > 0 && synthSeis.getLengthInSeconds() < frequencyBandParameter.getMinLength()) { - log.trace("Encountered a too small window length while processing {} with length {} and minimum window of {}; processing will skip this file", - velocityMeasurement, - synthSeis.getLengthInSeconds(), - frequencyBandParameter.getMinLength()); - return null; - } else if (frequencyBandParameter.getMaxLength() > 0 && synthSeis.getLengthInSeconds() > frequencyBandParameter.getMaxLength()) { - log.trace("Encountered a too large window length while processing {} with length {} and maxium window of {}; processing will continue on a truncated envelope", - velocityMeasurement, - synthSeis.getLengthInSeconds(), - frequencyBandParameter.getMaxLength()); - synthSeis.cutAfter(travelTime.add(frequencyBandParameter.getMaxLength())); + EnvelopeFit curve = curveFitter.fitCodaCMAES(seis.getData(), seis.getSamprate(), constraints, frequencyBandParameter.getMinLength(), shouldAutoPick); + + if (shouldAutoPick) { + //Ensure pick is persisted back to waveform + double end = curve.getEndTime(); + if (end >= 0d) { + endPick.setPickTimeSecFromOrigin((float) (end + seis.getTime().subtractD(originTime))); + } } - EnvelopeFit curve = curveFitter.fitCodaCMAES(synthSeis.getData(), synthSeis.getSamprate(), constraints); return new ShapeMeasurement().setDistance(distance) .setWaveform(velocityMeasurement.getWaveform()) .setV0(frequencyBandParameter.getVelocity0()) diff --git a/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/processing/SpectraCalculator.java b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/processing/SpectraCalculator.java index 977e0898..2f4db7c8 100644 --- a/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/processing/SpectraCalculator.java +++ b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/calibration/service/impl/processing/SpectraCalculator.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2018, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory +* Copyright (c) 2021, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory * CODE-743439. * All rights reserved. * This file is part of CCT. For details, see https://github.com/LLNL/coda-calibration-tool. @@ -101,8 +101,8 @@ public class SpectraCalculator { private double maxMW = 10.0; @Value("${spectra-calc.min-apparent-stress-mpa:0.01}") private double minApparentStress = 0.01; - @Value("${spectra-calc.max-apparent-stress-mpa:10.00}") - private double maxApparentStress = 10.00; + @Value("${spectra-calc.max-apparent-stress-mpa:100.00}") + private double maxApparentStress = 100.00; @Value("${report-stress-bounds-in-uq:false}") private boolean reportStressBoundsInUQ = false; @@ -189,20 +189,17 @@ private SpectraMeasurement measureAmplitudeForSynthetic(SyntheticCoda synth, Map if (vr == 0.0) { vr = 1.0; } + TimeT originTime = new TimeT(event.getOriginTime()); - final TimeT startTime; - TimeT tempTime; - TimeT trimTime = originTime.add(distance / vr); - TimeSeries trimmedWaveform = new TimeSeries(envSeis); - try { - trimmedWaveform.cutBefore(trimTime); - trimmedWaveform.cutAfter(trimTime.add(30.0)); - tempTime = new TimeT(trimTime.getEpochTime() + trimmedWaveform.getMaxTime()[0]); - } catch (IllegalArgumentException e) { - tempTime = trimTime; + TimeT codaStart; + if (synth.getSourceWaveform().getMaxVelTime() != null) { + codaStart = new TimeT(synth.getSourceWaveform().getMaxVelTime()); + } else { + codaStart = originTime; + codaStart = codaStart.add(distance / vr); } - startTime = tempTime; + final TimeT startTime = codaStart; double siteCorrection = 0.0; @@ -255,19 +252,25 @@ private SpectraMeasurement measureAmplitudeForSynthetic(SyntheticCoda synth, Map return null; } - // Note this mutates envSeis and synthSeis! - boolean cutSucceeded = cutSeismograms(envSeis, synthSeis, startTime, endTime); + + boolean cutSucceeded = false; + try { + // Note this mutates envSeis and synthSeis! + cutSucceeded = WaveformUtils.cutSeismograms(envSeis, synthSeis, startTime, endTime); + } catch (IllegalArgumentException e) { + log.warn("Error attempting to cut seismograms during amplitude measurement; {}", e.getMessage()); + } if (cutSucceeded) { float[] envdata = envSeis.getData(); float[] synthdata = synthSeis.getData(); // envelope minus synthetic - double rawAmp = new TimeSeries(SeriesMath.subtract(envdata, synthdata), synthSeis.getSamprate(), synthSeis.getTime()).getMedian(); + final double rawAmp = new TimeSeries(SeriesMath.subtract(envdata, synthdata), synthSeis.getSamprate(), synthSeis.getTime()).getMedian(); // NOTE - this is what Rengin refers to as the RAW Amplitude; // calculated below - double rawAtMeasurementTime = 0.; + final double rawAtMeasurementTime; float[] synthscaled = SeriesMath.add(synthdata, rawAmp); Double fit = FitnessCriteria.CVRMSD(envdata, synthscaled); @@ -275,7 +278,6 @@ private SpectraMeasurement measureAmplitudeForSynthetic(SyntheticCoda synth, Map // path corrected using Scott's Extended Street and Herrman // method and site correction double pathCorrectedAmp = rawAmp + eshCorrection; - double correctedAmp = pathCorrectedAmp + siteCorrection; // user defined coda measurement time double measurementtime = params.getMeasurementTime(); @@ -286,7 +288,8 @@ private SpectraMeasurement measureAmplitudeForSynthetic(SyntheticCoda synth, Map rawAtMeasurementTime = rawAmp; } pathCorrectedAmp = rawAtMeasurementTime + eshCorrection; - correctedAmp = pathCorrectedAmp + siteCorrection; + + double correctedAmp = pathCorrectedAmp + siteCorrection; if (endTime.subtract(startTime).getEpochTime() < minlength) { log.debug("Coda window length too short for envelope: {}", synth.getSourceWaveform()); @@ -312,59 +315,6 @@ private SpectraMeasurement measureAmplitudeForSynthetic(SyntheticCoda synth, Map } - private boolean cutSeismograms(TimeSeries a, TimeSeries b, TimeT startTime, TimeT endTime) { - boolean completedCut = false; - try { - a.cut(startTime, endTime); - b.cut(startTime, endTime); - - // These might be off by some small number of samples due to - // precision errors during cut and SeriesMath will throw an ArrayBounds if - // they don't match exactly so we need to double check! - if (a.getNsamp() != b.getNsamp()) { - - TimeT start = a.getTime(); - TimeT end = a.getEndtime(); - TimeT startA = a.getTime(); - TimeT startB = b.getTime(); - TimeT endA = a.getEndtime(); - TimeT endB = b.getEndtime(); - - // choose the latest start time and the earliest end time for - // the cut window - if (startA.lt(startB)) { - start = startB; - } - if (endA.gt(endB)) { - end = endB; - } - if (start.ge(end)) { - // don't continue if the seismograms don't overlap - return completedCut; - } - - int begin_index_a = a.getIndexForTime(start.getEpochTime()); - int end_index_a = a.getIndexForTime(end.getEpochTime()); - - int begin_index_b = b.getIndexForTime(start.getEpochTime()); - int end_index_b = b.getIndexForTime(end.getEpochTime()); - - int nptsa = (end_index_a - begin_index_a) + 1; - int nptsb = (end_index_b - begin_index_b) + 1; - - int npts = Math.min(nptsa, nptsb); - // now cut the traces again - a.cut(begin_index_a, (begin_index_a + npts - 1)); - b.cut(begin_index_b, (begin_index_b + npts - 1)); - } - completedCut = true; - } catch (IllegalArgumentException e) { - log.warn("Error attempting to cut seismograms during amplitude measurement; {}", e.getMessage()); - } - - return completedCut; - } - /** * Scott Phillips Extended Street and Hermann path correction including * distance and Q @@ -696,7 +646,8 @@ public double value(double[] point) { result[APP_2_MIN] = result[APP_STRESS]; result[APP_2_MAX] = result[APP_STRESS]; } - result[CORNER_FREQ] = mdacService.getCornerFrequency(mdacService.getCalculateMdacSourceSpectraFunction(mdacPs, new MdacParametersFI(mdacFi).setPsi(0.0).setSigma(result[APP_STRESS]), result[MW_FIT])); + result[CORNER_FREQ] = mdacService.getCornerFrequency( + mdacService.getCalculateMdacSourceSpectraFunction(mdacPs, new MdacParametersFI(mdacFi).setPsi(0.0).setSigma(result[APP_STRESS]), result[MW_FIT])); result[ITR_COUNT] = iterations; return result; } diff --git a/common-service/common-service-impl/src/main/java/gov/llnl/gnem/apps/coda/common/service/impl/NotificationServiceImpl.java b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/common/service/impl/NotificationServiceImpl.java similarity index 100% rename from common-service/common-service-impl/src/main/java/gov/llnl/gnem/apps/coda/common/service/impl/NotificationServiceImpl.java rename to calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/common/service/impl/NotificationServiceImpl.java diff --git a/common-service/common-service-impl/src/main/java/gov/llnl/gnem/apps/coda/common/service/impl/WaveformPickServiceImpl.java b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/common/service/impl/WaveformPickServiceImpl.java similarity index 100% rename from common-service/common-service-impl/src/main/java/gov/llnl/gnem/apps/coda/common/service/impl/WaveformPickServiceImpl.java rename to calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/common/service/impl/WaveformPickServiceImpl.java diff --git a/common-service/common-service-impl/src/main/java/gov/llnl/gnem/apps/coda/common/service/impl/WaveformServiceImpl.java b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/common/service/impl/WaveformServiceImpl.java similarity index 99% rename from common-service/common-service-impl/src/main/java/gov/llnl/gnem/apps/coda/common/service/impl/WaveformServiceImpl.java rename to calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/common/service/impl/WaveformServiceImpl.java index 129285d8..755c30ff 100644 --- a/common-service/common-service-impl/src/main/java/gov/llnl/gnem/apps/coda/common/service/impl/WaveformServiceImpl.java +++ b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/common/service/impl/WaveformServiceImpl.java @@ -176,7 +176,7 @@ private Waveform attachIfAvailableInRepository(Waveform entry) { Waveform mergedEntry = null; if (entry != null) { if (entry.getId() != null) { - mergedEntry = waveformRepository.findById(entry.getId()).get(); + mergedEntry = waveformRepository.findById(entry.getId()).orElse(null); } else if (entry.getEvent() != null && entry.getStream() != null && entry.getStream().getStation() != null && entry.getLowFrequency() != null && entry.getHighFrequency() != null) { mergedEntry = waveformRepository.findByUniqueFields( entry.getEvent().getEventId(), diff --git a/common-service/common-service-impl/src/main/java/gov/llnl/gnem/apps/coda/common/service/util/WaveformToTimeSeriesConverter.java b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/common/service/util/WaveformToTimeSeriesConverter.java similarity index 100% rename from common-service/common-service-impl/src/main/java/gov/llnl/gnem/apps/coda/common/service/util/WaveformToTimeSeriesConverter.java rename to calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/common/service/util/WaveformToTimeSeriesConverter.java diff --git a/common-service/common-service-impl/src/main/java/gov/llnl/gnem/apps/coda/common/service/util/WaveformUtils.java b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/common/service/util/WaveformUtils.java similarity index 71% rename from common-service/common-service-impl/src/main/java/gov/llnl/gnem/apps/coda/common/service/util/WaveformUtils.java rename to calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/common/service/util/WaveformUtils.java index ae9f2622..df12b556 100644 --- a/common-service/common-service-impl/src/main/java/gov/llnl/gnem/apps/coda/common/service/util/WaveformUtils.java +++ b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/common/service/util/WaveformUtils.java @@ -105,4 +105,53 @@ public static boolean isValidWaveform(Waveform w) { && w.getStream().getStation().getLatitude() != 0.0 && w.getStream().getStation().getLongitude() != 0.0); } + + public static boolean cutSeismograms(TimeSeries a, TimeSeries b, TimeT startTime, TimeT endTime) { + boolean completedCut = false; + a.cut(startTime, endTime); + b.cut(startTime, endTime); + + // These might be off by some small number of samples due to + // precision errors during cut and SeriesMath will throw an ArrayBounds if + // they don't match exactly so we need to double check! + if (a.getNsamp() != b.getNsamp()) { + + TimeT start = a.getTime(); + TimeT end = a.getEndtime(); + TimeT startA = a.getTime(); + TimeT startB = b.getTime(); + TimeT endA = a.getEndtime(); + TimeT endB = b.getEndtime(); + + // choose the latest start time and the earliest end time for + // the cut window + if (startA.lt(startB)) { + start = startB; + } + if (endA.gt(endB)) { + end = endB; + } + if (start.ge(end)) { + // don't continue if the seismograms don't overlap + return completedCut; + } + + int begin_index_a = a.getIndexForTime(start.getEpochTime()); + int end_index_a = a.getIndexForTime(end.getEpochTime()); + + int begin_index_b = b.getIndexForTime(start.getEpochTime()); + int end_index_b = b.getIndexForTime(end.getEpochTime()); + + int nptsa = (end_index_a - begin_index_a) + 1; + int nptsb = (end_index_b - begin_index_b) + 1; + + int npts = Math.min(nptsa, nptsb); + // now cut the traces again + a.cut(begin_index_a, (begin_index_a + npts - 1)); + b.cut(begin_index_b, (begin_index_b + npts - 1)); + } + completedCut = true; + return completedCut; + } + } diff --git a/envelope-service/envelope-service-impl/src/main/java/gov/llnl/gnem/apps/coda/envelope/service/impl/EnvelopeCreationServiceImpl.java b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/envelope/service/impl/EnvelopeCreationServiceImpl.java similarity index 100% rename from envelope-service/envelope-service-impl/src/main/java/gov/llnl/gnem/apps/coda/envelope/service/impl/EnvelopeCreationServiceImpl.java rename to calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/envelope/service/impl/EnvelopeCreationServiceImpl.java diff --git a/envelope-service/envelope-service-impl/src/main/java/gov/llnl/gnem/apps/coda/envelope/service/impl/EnvelopeParamsServiceImpl.java b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/envelope/service/impl/EnvelopeParamsServiceImpl.java similarity index 100% rename from envelope-service/envelope-service-impl/src/main/java/gov/llnl/gnem/apps/coda/envelope/service/impl/EnvelopeParamsServiceImpl.java rename to calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/envelope/service/impl/EnvelopeParamsServiceImpl.java diff --git a/envelope-service/envelope-service-impl/src/main/java/gov/llnl/gnem/apps/coda/envelope/service/impl/EnvelopeStacker.java b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/envelope/service/impl/EnvelopeStacker.java similarity index 98% rename from envelope-service/envelope-service-impl/src/main/java/gov/llnl/gnem/apps/coda/envelope/service/impl/EnvelopeStacker.java rename to calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/envelope/service/impl/EnvelopeStacker.java index 42377395..20f5f3a9 100644 --- a/envelope-service/envelope-service-impl/src/main/java/gov/llnl/gnem/apps/coda/envelope/service/impl/EnvelopeStacker.java +++ b/calibration-service/calibration-service-impl/src/main/java/gov/llnl/gnem/apps/coda/envelope/service/impl/EnvelopeStacker.java @@ -59,7 +59,7 @@ public Waveform stackEnvelopes(List waves) { // 6. Store the envelope for coda amplitude measurement Waveform base = null; - if (waves != null && waves.size() > 1) { + if (waves != null && !waves.isEmpty()) { try { base = waves.get(0); TimeSeries seis = converter.convert(base); diff --git a/calibration-service/calibration-service-impl/src/test/java/gov/llnl/gnem/apps/coda/calibration/service/impl/SiteFrequencyBandParametersServiceImplTest.java b/calibration-service/calibration-service-impl/src/test/java/gov/llnl/gnem/apps/coda/calibration/service/impl/SiteFrequencyBandParametersServiceImplTest.java index 15706b13..f8515f09 100644 --- a/calibration-service/calibration-service-impl/src/test/java/gov/llnl/gnem/apps/coda/calibration/service/impl/SiteFrequencyBandParametersServiceImplTest.java +++ b/calibration-service/calibration-service-impl/src/test/java/gov/llnl/gnem/apps/coda/calibration/service/impl/SiteFrequencyBandParametersServiceImplTest.java @@ -41,7 +41,7 @@ public void testSaveDuplicate() throws Exception { SiteFrequencyBandParameters initial = genSite(); service.save(new SiteFrequencyBandParameters().mergeNonNullOrEmptyFields(initial)); service.save(new SiteFrequencyBandParameters().mergeNonNullOrEmptyFields(initial)); - assertThat(service.findAll()).size().isEqualTo(1).describedAs("Should have saved only one site entry"); + assertThat(service.findAll()).size().describedAs("Should have saved only one site entry").isEqualTo(1); } @Test @@ -50,7 +50,7 @@ public void testSaveDuplicateOneUnknownNetwork() throws Exception { service.save(new SiteFrequencyBandParameters().mergeNonNullOrEmptyFields(initial)); initial.getStation().setNetworkName("UNK"); service.save(new SiteFrequencyBandParameters().mergeNonNullOrEmptyFields(initial)); - assertThat(service.findAll()).size().isEqualTo(1).describedAs("Should have saved only one site entry"); + assertThat(service.findAll()).size().describedAs("Should have saved only one site entry").isEqualTo(1); } @Test @@ -61,7 +61,7 @@ public void testSaveAmbiguousNetwork() throws Exception { service.save(new SiteFrequencyBandParameters().mergeNonNullOrEmptyFields(initial)); initial.getStation().setNetworkName("UNK"); service.save(new SiteFrequencyBandParameters().mergeNonNullOrEmptyFields(initial)); - assertThat(service.findAll()).size().isEqualTo(2).describedAs("Should have saved only one site entry"); + assertThat(service.findAll()).size().describedAs("Should have saved only one site entry").isEqualTo(2); } @Test @@ -70,8 +70,8 @@ public void testSaveExistingIdNoManualVersionBump() throws Exception { initial = service.save(new SiteFrequencyBandParameters().mergeNonNullOrEmptyFields(initial)); initial.getStation().setNetworkName("B"); service.save(new SiteFrequencyBandParameters().mergeNonNullOrEmptyFields(initial)); - assertThat(service.findAll()).size().isEqualTo(1).describedAs("Should have saved only one site entry"); - assertThat(service.findAll().get(0).getStation().getNetworkName()).isEqualTo("B").describedAs("Should have the modified network name"); + assertThat(service.findAll()).size().describedAs("Should have saved only one site entry").isEqualTo(1); + assertThat(service.findAll().get(0).getStation().getNetworkName()).describedAs("Should have the modified network name").isEqualTo("B"); } private SiteFrequencyBandParameters genSite() { diff --git a/common-service/common-service-impl/src/test/java/gov/llnl/gnem/apps/coda/common/service/WaveformServiceImplTest.java b/calibration-service/calibration-service-impl/src/test/java/gov/llnl/gnem/apps/coda/common/service/WaveformServiceImplTest.java similarity index 70% rename from common-service/common-service-impl/src/test/java/gov/llnl/gnem/apps/coda/common/service/WaveformServiceImplTest.java rename to calibration-service/calibration-service-impl/src/test/java/gov/llnl/gnem/apps/coda/common/service/WaveformServiceImplTest.java index fe8b1409..e8709bee 100644 --- a/common-service/common-service-impl/src/test/java/gov/llnl/gnem/apps/coda/common/service/WaveformServiceImplTest.java +++ b/calibration-service/calibration-service-impl/src/test/java/gov/llnl/gnem/apps/coda/common/service/WaveformServiceImplTest.java @@ -1,3 +1,17 @@ +/* +* Copyright (c) 2021, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory +* CODE-743439. +* All rights reserved. +* This file is part of CCT. For details, see https://github.com/LLNL/coda-calibration-tool. +* +* 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.common.service; import static org.assertj.core.api.Assertions.assertThat; @@ -8,11 +22,14 @@ import java.util.stream.Collectors; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; import org.springframework.test.context.ContextConfiguration; +import gov.llnl.gnem.apps.coda.calibration.service.impl.CalibrationServiceTestContext; import gov.llnl.gnem.apps.coda.common.model.domain.Event; import gov.llnl.gnem.apps.coda.common.model.domain.Station; import gov.llnl.gnem.apps.coda.common.model.domain.Stream; @@ -25,7 +42,8 @@ @IntTest @DataJpaTest(showSql = false) -@ContextConfiguration(classes = CommonServiceTestContext.class) +@ContextConfiguration(classes = CalibrationServiceTestContext.class) +@ExtendWith(MockitoExtension.class) public class WaveformServiceImplTest { @Autowired @@ -34,7 +52,6 @@ public class WaveformServiceImplTest { @Autowired private WaveformServiceImpl waveformService; - @Autowired @Mock private NotificationService notificationService; @@ -45,7 +62,7 @@ public void testSaveDuplicateWaveform() throws Exception { Waveform initialWaveform = genWaveform(); waveformService.save(new Waveform().mergeNonNullOrEmptyFields(initialWaveform)); waveformService.save(new Waveform().mergeNonNullOrEmptyFields(initialWaveform)); - assertThat(waveformService.findAll()).size().isEqualTo(1).describedAs("Should have saved only one waveform entry"); + assertThat(waveformService.findAll()).size().describedAs("Should have saved only one waveform entry").isEqualTo(1); } @Test @@ -58,8 +75,8 @@ public void testSaveWaveformWithChangedPicks() throws Exception { secondWaveform.getAssociatedPicks().stream().map(p -> new WaveformPick().mergeNonNullOrEmptyFields(p).setPickTimeSecFromOrigin(-100f)).collect(Collectors.toList())); secondWaveform = waveformService.save(secondWaveform); - assertThat(secondWaveform.getAssociatedPicks()).size().isEqualTo(1).describedAs("Should still only have one pick on the waveform itself"); - assertThat(secondWaveform.getAssociatedPicks()).anyMatch(pick -> pick.getPickTimeSecFromOrigin() == -100f).describedAs("Pick should be a -100 offset now"); + assertThat(secondWaveform.getAssociatedPicks()).size().describedAs("Should still only have one pick on the waveform itself").isEqualTo(1); + assertThat(secondWaveform.getAssociatedPicks()).describedAs("Pick should be a -100 offset now").anyMatch(pick -> pick.getPickTimeSecFromOrigin() == -100f); } @Test @@ -81,7 +98,7 @@ public void testSaveSameStationBandDifferentEvent() throws Exception { Waveform initialWaveform = genWaveform(); waveformService.save(new Waveform().mergeNonNullOrEmptyFields(initialWaveform)); waveformService.save(new Waveform().mergeNonNullOrEmptyFields(initialWaveform).setEvent(initialWaveform.getEvent().setEventId("111"))); - assertThat(waveformService.findAll()).size().isEqualTo(2).describedAs("Should have saved two waveform entries"); + assertThat(waveformService.findAll()).size().describedAs("Should have saved two waveform entries").isEqualTo(2); } private Waveform genWaveform() { @@ -91,6 +108,7 @@ private Waveform genWaveform() { new Stream().setStation(new Station().setLatitude(0).setLongitude(0).setNetworkName("XX").setStationName("STA1")), zeroDate, zeroDate, + zeroDate, "vel", "nm/s", 1.0, diff --git a/envelope-service/envelope-service-impl/src/test/java/gov/llnl/gnem/apps/coda/envelope/service/impl/EnvelopeCreationServiceImplTest.java b/calibration-service/calibration-service-impl/src/test/java/gov/llnl/gnem/apps/coda/envelope/service/impl/EnvelopeCreationServiceImplTest.java similarity index 100% rename from envelope-service/envelope-service-impl/src/test/java/gov/llnl/gnem/apps/coda/envelope/service/impl/EnvelopeCreationServiceImplTest.java rename to calibration-service/calibration-service-impl/src/test/java/gov/llnl/gnem/apps/coda/envelope/service/impl/EnvelopeCreationServiceImplTest.java diff --git a/common-service/common-service-impl/src/test/resources/logback-test.xml b/calibration-service/calibration-service-impl/src/test/resources/logback-test.xml similarity index 100% rename from common-service/common-service-impl/src/test/resources/logback-test.xml rename to calibration-service/calibration-service-impl/src/test/resources/logback-test.xml diff --git a/calibration-service/pom.xml b/calibration-service/pom.xml index afe55f4f..81ce0ec8 100644 --- a/calibration-service/pom.xml +++ b/calibration-service/pom.xml @@ -5,7 +5,7 @@ gov.llnl.gnem.apps.coda.calibration coda-calibration - 1.0.10 + 1.0.11 4.0.0 @@ -16,7 +16,6 @@ calibration-model calibration-repository - calibration-integration calibration-service-api calibration-service-impl calibration-application diff --git a/calibration-standalone/pom.xml b/calibration-standalone/pom.xml index 3d5512d0..1c73d12a 100644 --- a/calibration-standalone/pom.xml +++ b/calibration-standalone/pom.xml @@ -6,7 +6,7 @@ gov.llnl.gnem.apps.coda.calibration coda-calibration - 1.0.10 + 1.0.11 4.0.0 diff --git a/calibration-standalone/src/main/java/gov/llnl/gnem/apps/coda/calibration/standalone/CodaCalibrationStandalone.java b/calibration-standalone/src/main/java/gov/llnl/gnem/apps/coda/calibration/standalone/CodaCalibrationStandalone.java index 04201a4d..47c6aef2 100644 --- a/calibration-standalone/src/main/java/gov/llnl/gnem/apps/coda/calibration/standalone/CodaCalibrationStandalone.java +++ b/calibration-standalone/src/main/java/gov/llnl/gnem/apps/coda/calibration/standalone/CodaCalibrationStandalone.java @@ -14,6 +14,7 @@ */ package gov.llnl.gnem.apps.coda.calibration.standalone; +import java.util.Locale; import java.util.TimeZone; import java.util.concurrent.CancellationException; import java.util.concurrent.CompletableFuture; @@ -48,18 +49,18 @@ public class CodaCalibrationStandalone extends Application { private static final Logger log = LoggerFactory.getLogger(CodaCalibrationStandalone.class); - private static volatile ConfigurableApplicationContext springContext; + private ConfigurableApplicationContext springContext; private static String[] initialArgs; private EventBus bus; @PostConstruct void started() { + Locale.setDefault(Locale.ENGLISH); TimeZone.setDefault(TimeZone.getTimeZone("UTC")); } public static synchronized void main(String[] args) { try { - initialArgs = args; String preloaderName = System.getProperty("javafx.preloader"); if (preloaderName == null) { @@ -88,13 +89,14 @@ public void init() throws Exception { } private ConfigurableApplicationContext setContext(ConfigurableApplicationContext context) { - if (springContext != null) { + synchronized (initialArgs) { + if (springContext != null) { + return springContext; + } + springContext = context; + bus = springContext.getBean(EventBus.class); return springContext; } - - springContext = context; - bus = springContext.getBean(EventBus.class); - return springContext; } @Override diff --git a/calibration-standalone/src/main/java/gov/llnl/gnem/apps/coda/calibration/standalone/data/client/CalibrationLocalClient.java b/calibration-standalone/src/main/java/gov/llnl/gnem/apps/coda/calibration/standalone/data/client/CalibrationLocalClient.java index a14798e8..2bb00358 100644 --- a/calibration-standalone/src/main/java/gov/llnl/gnem/apps/coda/calibration/standalone/data/client/CalibrationLocalClient.java +++ b/calibration-standalone/src/main/java/gov/llnl/gnem/apps/coda/calibration/standalone/data/client/CalibrationLocalClient.java @@ -56,7 +56,7 @@ public Mono cancelCalibration(Long id) { @Override public Mono makeMwMeasurements(Boolean autoPickingEnabled) { try { - return Mono.just(service.makeMwMeasurements(autoPickingEnabled, Boolean.TRUE).get(1l, TimeUnit.DAYS).getResultPayload().get()); + return Mono.just(service.makeMwMeasurements(autoPickingEnabled, Boolean.TRUE).get(1l, TimeUnit.DAYS).getResultPayload().orElseGet(MeasuredMwReportByEvent::new)); } catch (InterruptedException | ExecutionException | TimeoutException e) { log.error(e.getMessage(), e); return Mono.empty(); @@ -66,7 +66,7 @@ public Mono makeMwMeasurements(Boolean autoPickingEnabl @Override public Mono makeMwMeasurements(Boolean autoPickingEnabled, List eventIds) { try { - return Mono.just(service.makeMwMeasurements(autoPickingEnabled, Boolean.TRUE, new HashSet<>(eventIds)).get(1l, TimeUnit.DAYS).getResultPayload().get()); + return Mono.just(service.makeMwMeasurements(autoPickingEnabled, Boolean.TRUE, new HashSet<>(eventIds)).get(1l, TimeUnit.DAYS).getResultPayload().orElseGet(MeasuredMwReportByEvent::new)); } catch (InterruptedException | ExecutionException | TimeoutException e) { log.error(e.getMessage(), e); return Mono.empty(); diff --git a/envelope-standalone/src/main/java/gov/llnl/gnem/apps/coda/envelope/standalone/data/client/EnvelopeLocalClient.java b/calibration-standalone/src/main/java/gov/llnl/gnem/apps/coda/envelope/standalone/data/client/EnvelopeLocalClient.java similarity index 100% rename from envelope-standalone/src/main/java/gov/llnl/gnem/apps/coda/envelope/standalone/data/client/EnvelopeLocalClient.java rename to calibration-standalone/src/main/java/gov/llnl/gnem/apps/coda/envelope/standalone/data/client/EnvelopeLocalClient.java diff --git a/envelope-standalone/src/main/java/gov/llnl/gnem/apps/coda/envelope/standalone/data/client/EnvelopeParamsLocalClient.java b/calibration-standalone/src/main/java/gov/llnl/gnem/apps/coda/envelope/standalone/data/client/EnvelopeParamsLocalClient.java similarity index 100% rename from envelope-standalone/src/main/java/gov/llnl/gnem/apps/coda/envelope/standalone/data/client/EnvelopeParamsLocalClient.java rename to calibration-standalone/src/main/java/gov/llnl/gnem/apps/coda/envelope/standalone/data/client/EnvelopeParamsLocalClient.java diff --git a/calibration-standalone/src/main/resources/application.properties b/calibration-standalone/src/main/resources/application.properties index 55026e39..91f50d5f 100644 --- a/calibration-standalone/src/main/resources/application.properties +++ b/calibration-standalone/src/main/resources/application.properties @@ -4,6 +4,8 @@ spring.jpa.open-in-view=false logging.level.root=ERROR logging.level.gov.llnl.gnem.apps.coda.*=INFO spring.datasource.driver-class-name=org.h2.Driver +spring.datasource.username=sa + spring.datasource.url=jdbc:h2:mem:./coda;DB_CLOSE_DELAY=-1;COMPRESS=TRUE server.port=53921 server.address=127.0.0.1 diff --git a/calibration-standalone/src/test/java/gov/llnl/gnem/apps/coda/calibration/AssessAutopicker.java b/calibration-standalone/src/test/java/gov/llnl/gnem/apps/coda/calibration/AssessAutopicker.java deleted file mode 100644 index ba2e2b1a..00000000 --- a/calibration-standalone/src/test/java/gov/llnl/gnem/apps/coda/calibration/AssessAutopicker.java +++ /dev/null @@ -1,107 +0,0 @@ -/* -* Copyright (c) 2020, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory -* CODE-743439. -* All rights reserved. -* This file is part of CCT. For details, see https://github.com/LLNL/coda-calibration-tool. -* -* 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; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.time.Duration; -import java.util.List; -import java.util.Locale; -import java.util.Objects; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics; -import org.junit.jupiter.api.Assertions; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import gov.llnl.gnem.apps.coda.calibration.gui.converters.sac.CodaStackedSacFileLoader; -import gov.llnl.gnem.apps.coda.calibration.service.impl.processing.CodaSNREndTimePicker; -import gov.llnl.gnem.apps.coda.common.gui.converters.sac.CodaFilenameParserImpl; -import gov.llnl.gnem.apps.coda.common.gui.converters.sac.SacLoader; -import gov.llnl.gnem.apps.coda.common.model.domain.Waveform; -import gov.llnl.gnem.apps.coda.common.model.util.PICK_TYPES; -import gov.llnl.gnem.apps.coda.common.service.util.WaveformToTimeSeriesConverter; -import gov.llnl.gnem.apps.coda.common.service.util.WaveformUtils; -import llnl.gnem.core.util.TimeT; -import llnl.gnem.core.waveform.seismogram.TimeSeries; - -public class AssessAutopicker { - private final static Logger log = LoggerFactory.getLogger(AssessAutopicker.class); - private static CodaSNREndTimePicker picker = new CodaSNREndTimePicker(); - private static CodaStackedSacFileLoader loader = new CodaStackedSacFileLoader(new SacLoader(), new CodaFilenameParserImpl()); - private static WaveformToTimeSeriesConverter converter = new WaveformToTimeSeriesConverter(); - - public static void main(String[] args) { - List files = null; - try (Stream stream = Files.walk(Paths.get(args[0]))) { - files = stream.filter(path -> path.getFileName().toString().toLowerCase(Locale.ENGLISH).endsWith(".env")).map(path -> path.toFile()).filter(o -> o != null).collect(Collectors.toList()); - } catch (IOException e) { - e.printStackTrace(); - } - - if (files == null) { - return; - } - - List waveforms = loader.convertFiles(files) - .doOnError(error -> Assertions.fail(error.getMessage())) - .filter(Objects::nonNull) - .filter(r -> r.getResultPayload() != null && r.getResultPayload().isPresent()) - .map(r -> r.getResultPayload().get()) - .filter(w -> w.getAssociatedPicks() != null - && w.getAssociatedPicks().stream().filter(pick -> PICK_TYPES.F.getPhase().equalsIgnoreCase(pick.getPickType())).findAny().isPresent()) - .collectList() - .block(Duration.ofSeconds(10l)); - - DescriptiveStatistics stats = new DescriptiveStatistics(); - waveforms.forEach(w -> { - TimeSeries series = converter.convert(w); - TimeSeries halfSeries = converter.convert(w); - halfSeries.cut(0, (halfSeries.getNsamp() - 1) / 2); - Double maxTime = halfSeries.getMaxTime()[0]; - - double startTime = series.getTime().getEpochTime() + maxTime; - double stopTime = picker.getEndTime(series.getData(), - series.getSamprate(), - startTime, - series.getIndexForTime(startTime), - 0, - 1200, - 0.0, - WaveformUtils.getNoiseFloor(WaveformUtils.floatsToDoubles(series.getData()))); - if (new TimeT(stopTime).gt(new TimeT(startTime))) { - stopTime = stopTime + series.getTime().subtractD(new TimeT(w.getEvent().getOriginTime())); - } - double autoPickedTime = new TimeT(stopTime).subtractD(new TimeT(startTime)); - - double humanPickedTime = w.getAssociatedPicks() - .stream() - .filter(pick -> PICK_TYPES.F.getPhase().equalsIgnoreCase(pick.getPickType())) - .findAny() - .map(pick -> (double) pick.getPickTimeSecFromOrigin()) - .orElseGet(() -> Double.valueOf(-100)); - - if (autoPickedTime > 0) { - stats.addValue(humanPickedTime - autoPickedTime); - } - }); - log.info(stats.toString()); - } -} diff --git a/common-gui/LICENSE.txt b/common-gui/LICENSE.txt deleted file mode 100644 index c463fc26..00000000 --- a/common-gui/LICENSE.txt +++ /dev/null @@ -1,206 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2017 Lawrence Livermore National Laboratory - - Licensed under the Apache License, Version 2.0 (the "License"); - 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. - - LLNL DISCLAIMER - - This work was performed under the auspices of the U.S. Department of Energy -by Lawrence Livermore National Laboratory under Contract DE-AC52-07NA27344. diff --git a/common-gui/codepoints.txt b/common-gui/codepoints.txt deleted file mode 100644 index 3c8b0750..00000000 --- a/common-gui/codepoints.txt +++ /dev/null @@ -1,932 +0,0 @@ -3d_rotation e84d -ac_unit eb3b -access_alarm e190 -access_alarms e191 -access_time e192 -accessibility e84e -accessible e914 -account_balance e84f -account_balance_wallet e850 -account_box e851 -account_circle e853 -adb e60e -add e145 -add_a_photo e439 -add_alarm e193 -add_alert e003 -add_box e146 -add_circle e147 -add_circle_outline e148 -add_location e567 -add_shopping_cart e854 -add_to_photos e39d -add_to_queue e05c -adjust e39e -airline_seat_flat e630 -airline_seat_flat_angled e631 -airline_seat_individual_suite e632 -airline_seat_legroom_extra e633 -airline_seat_legroom_normal e634 -airline_seat_legroom_reduced e635 -airline_seat_recline_extra e636 -airline_seat_recline_normal e637 -airplanemode_active e195 -airplanemode_inactive e194 -airplay e055 -airport_shuttle eb3c -alarm e855 -alarm_add e856 -alarm_off e857 -alarm_on e858 -album e019 -all_inclusive eb3d -all_out e90b -android e859 -announcement e85a -apps e5c3 -archive e149 -arrow_back e5c4 -arrow_downward e5db -arrow_drop_down e5c5 -arrow_drop_down_circle e5c6 -arrow_drop_up e5c7 -arrow_forward e5c8 -arrow_upward e5d8 -art_track e060 -aspect_ratio e85b -assessment e85c -assignment e85d -assignment_ind e85e -assignment_late e85f -assignment_return e860 -assignment_returned e861 -assignment_turned_in e862 -assistant e39f -assistant_photo e3a0 -attach_file e226 -attach_money e227 -attachment e2bc -audiotrack e3a1 -autorenew e863 -av_timer e01b -backspace e14a -backup e864 -battery_alert e19c -battery_charging_full e1a3 -battery_full e1a4 -battery_std e1a5 -battery_unknown e1a6 -beach_access eb3e -beenhere e52d -block e14b -bluetooth e1a7 -bluetooth_audio e60f -bluetooth_connected e1a8 -bluetooth_disabled e1a9 -bluetooth_searching e1aa -blur_circular e3a2 -blur_linear e3a3 -blur_off e3a4 -blur_on e3a5 -book e865 -bookmark e866 -bookmark_border e867 -border_all e228 -border_bottom e229 -border_clear e22a -border_color e22b -border_horizontal e22c -border_inner e22d -border_left e22e -border_outer e22f -border_right e230 -border_style e231 -border_top e232 -border_vertical e233 -branding_watermark e06b -brightness_1 e3a6 -brightness_2 e3a7 -brightness_3 e3a8 -brightness_4 e3a9 -brightness_5 e3aa -brightness_6 e3ab -brightness_7 e3ac -brightness_auto e1ab -brightness_high e1ac -brightness_low e1ad -brightness_medium e1ae -broken_image e3ad -brush e3ae -bubble_chart e6dd -bug_report e868 -build e869 -burst_mode e43c -business e0af -business_center eb3f -cached e86a -cake e7e9 -call e0b0 -call_end e0b1 -call_made e0b2 -call_merge e0b3 -call_missed e0b4 -call_missed_outgoing e0e4 -call_received e0b5 -call_split e0b6 -call_to_action e06c -camera e3af -camera_alt e3b0 -camera_enhance e8fc -camera_front e3b1 -camera_rear e3b2 -camera_roll e3b3 -cancel e5c9 -card_giftcard e8f6 -card_membership e8f7 -card_travel e8f8 -casino eb40 -cast e307 -cast_connected e308 -center_focus_strong e3b4 -center_focus_weak e3b5 -change_history e86b -chat e0b7 -chat_bubble e0ca -chat_bubble_outline e0cb -check e5ca -check_box e834 -check_box_outline_blank e835 -check_circle e86c -chevron_left e5cb -chevron_right e5cc -child_care eb41 -child_friendly eb42 -chrome_reader_mode e86d -class e86e -clear e14c -clear_all e0b8 -close e5cd -closed_caption e01c -cloud e2bd -cloud_circle e2be -cloud_done e2bf -cloud_download e2c0 -cloud_off e2c1 -cloud_queue e2c2 -cloud_upload e2c3 -code e86f -collections e3b6 -collections_bookmark e431 -color_lens e3b7 -colorize e3b8 -comment e0b9 -compare e3b9 -compare_arrows e915 -computer e30a -confirmation_number e638 -contact_mail e0d0 -contact_phone e0cf -contacts e0ba -content_copy e14d -content_cut e14e -content_paste e14f -control_point e3ba -control_point_duplicate e3bb -copyright e90c -create e150 -create_new_folder e2cc -credit_card e870 -crop e3be -crop_16_9 e3bc -crop_3_2 e3bd -crop_5_4 e3bf -crop_7_5 e3c0 -crop_din e3c1 -crop_free e3c2 -crop_landscape e3c3 -crop_original e3c4 -crop_portrait e3c5 -crop_rotate e437 -crop_square e3c6 -dashboard e871 -data_usage e1af -date_range e916 -dehaze e3c7 -delete e872 -delete_forever e92b -delete_sweep e16c -description e873 -desktop_mac e30b -desktop_windows e30c -details e3c8 -developer_board e30d -developer_mode e1b0 -device_hub e335 -devices e1b1 -devices_other e337 -dialer_sip e0bb -dialpad e0bc -directions e52e -directions_bike e52f -directions_boat e532 -directions_bus e530 -directions_car e531 -directions_railway e534 -directions_run e566 -directions_subway e533 -directions_transit e535 -directions_walk e536 -disc_full e610 -dns e875 -do_not_disturb e612 -do_not_disturb_alt e611 -do_not_disturb_off e643 -do_not_disturb_on e644 -dock e30e -domain e7ee -done e876 -done_all e877 -donut_large e917 -donut_small e918 -drafts e151 -drag_handle e25d -drive_eta e613 -dvr e1b2 -edit e3c9 -edit_location e568 -eject e8fb -email e0be -enhanced_encryption e63f -equalizer e01d -error e000 -error_outline e001 -euro_symbol e926 -ev_station e56d -event e878 -event_available e614 -event_busy e615 -event_note e616 -event_seat e903 -exit_to_app e879 -expand_less e5ce -expand_more e5cf -explicit e01e -explore e87a -exposure e3ca -exposure_neg_1 e3cb -exposure_neg_2 e3cc -exposure_plus_1 e3cd -exposure_plus_2 e3ce -exposure_zero e3cf -extension e87b -face e87c -fast_forward e01f -fast_rewind e020 -favorite e87d -favorite_border e87e -featured_play_list e06d -featured_video e06e -feedback e87f -fiber_dvr e05d -fiber_manual_record e061 -fiber_new e05e -fiber_pin e06a -fiber_smart_record e062 -file_download e2c4 -file_upload e2c6 -filter e3d3 -filter_1 e3d0 -filter_2 e3d1 -filter_3 e3d2 -filter_4 e3d4 -filter_5 e3d5 -filter_6 e3d6 -filter_7 e3d7 -filter_8 e3d8 -filter_9 e3d9 -filter_9_plus e3da -filter_b_and_w e3db -filter_center_focus e3dc -filter_drama e3dd -filter_frames e3de -filter_hdr e3df -filter_list e152 -filter_none e3e0 -filter_tilt_shift e3e2 -filter_vintage e3e3 -find_in_page e880 -find_replace e881 -fingerprint e90d -first_page e5dc -fitness_center eb43 -flag e153 -flare e3e4 -flash_auto e3e5 -flash_off e3e6 -flash_on e3e7 -flight e539 -flight_land e904 -flight_takeoff e905 -flip e3e8 -flip_to_back e882 -flip_to_front e883 -folder e2c7 -folder_open e2c8 -folder_shared e2c9 -folder_special e617 -font_download e167 -format_align_center e234 -format_align_justify e235 -format_align_left e236 -format_align_right e237 -format_bold e238 -format_clear e239 -format_color_fill e23a -format_color_reset e23b -format_color_text e23c -format_indent_decrease e23d -format_indent_increase e23e -format_italic e23f -format_line_spacing e240 -format_list_bulleted e241 -format_list_numbered e242 -format_paint e243 -format_quote e244 -format_shapes e25e -format_size e245 -format_strikethrough e246 -format_textdirection_l_to_r e247 -format_textdirection_r_to_l e248 -format_underlined e249 -forum e0bf -forward e154 -forward_10 e056 -forward_30 e057 -forward_5 e058 -free_breakfast eb44 -fullscreen e5d0 -fullscreen_exit e5d1 -functions e24a -g_translate e927 -gamepad e30f -games e021 -gavel e90e -gesture e155 -get_app e884 -gif e908 -golf_course eb45 -gps_fixed e1b3 -gps_not_fixed e1b4 -gps_off e1b5 -grade e885 -gradient e3e9 -grain e3ea -graphic_eq e1b8 -grid_off e3eb -grid_on e3ec -group e7ef -group_add e7f0 -group_work e886 -hd e052 -hdr_off e3ed -hdr_on e3ee -hdr_strong e3f1 -hdr_weak e3f2 -headset e310 -headset_mic e311 -healing e3f3 -hearing e023 -help e887 -help_outline e8fd -high_quality e024 -highlight e25f -highlight_off e888 -history e889 -home e88a -hot_tub eb46 -hotel e53a -hourglass_empty e88b -hourglass_full e88c -http e902 -https e88d -image e3f4 -image_aspect_ratio e3f5 -import_contacts e0e0 -import_export e0c3 -important_devices e912 -inbox e156 -indeterminate_check_box e909 -info e88e -info_outline e88f -input e890 -insert_chart e24b -insert_comment e24c -insert_drive_file e24d -insert_emoticon e24e -insert_invitation e24f -insert_link e250 -insert_photo e251 -invert_colors e891 -invert_colors_off e0c4 -iso e3f6 -keyboard e312 -keyboard_arrow_down e313 -keyboard_arrow_left e314 -keyboard_arrow_right e315 -keyboard_arrow_up e316 -keyboard_backspace e317 -keyboard_capslock e318 -keyboard_hide e31a -keyboard_return e31b -keyboard_tab e31c -keyboard_voice e31d -kitchen eb47 -label e892 -label_outline e893 -landscape e3f7 -language e894 -laptop e31e -laptop_chromebook e31f -laptop_mac e320 -laptop_windows e321 -last_page e5dd -launch e895 -layers e53b -layers_clear e53c -leak_add e3f8 -leak_remove e3f9 -lens e3fa -library_add e02e -library_books e02f -library_music e030 -lightbulb_outline e90f -line_style e919 -line_weight e91a -linear_scale e260 -link e157 -linked_camera e438 -list e896 -live_help e0c6 -live_tv e639 -local_activity e53f -local_airport e53d -local_atm e53e -local_bar e540 -local_cafe e541 -local_car_wash e542 -local_convenience_store e543 -local_dining e556 -local_drink e544 -local_florist e545 -local_gas_station e546 -local_grocery_store e547 -local_hospital e548 -local_hotel e549 -local_laundry_service e54a -local_library e54b -local_mall e54c -local_movies e54d -local_offer e54e -local_parking e54f -local_pharmacy e550 -local_phone e551 -local_pizza e552 -local_play e553 -local_post_office e554 -local_printshop e555 -local_see e557 -local_shipping e558 -local_taxi e559 -location_city e7f1 -location_disabled e1b6 -location_off e0c7 -location_on e0c8 -location_searching e1b7 -lock e897 -lock_open e898 -lock_outline e899 -looks e3fc -looks_3 e3fb -looks_4 e3fd -looks_5 e3fe -looks_6 e3ff -looks_one e400 -looks_two e401 -loop e028 -loupe e402 -low_priority e16d -loyalty e89a -mail e158 -mail_outline e0e1 -map e55b -markunread e159 -markunread_mailbox e89b -memory e322 -menu e5d2 -merge_type e252 -message e0c9 -mic e029 -mic_none e02a -mic_off e02b -mms e618 -mode_comment e253 -mode_edit e254 -monetization_on e263 -money_off e25c -monochrome_photos e403 -mood e7f2 -mood_bad e7f3 -more e619 -more_horiz e5d3 -more_vert e5d4 -motorcycle e91b -mouse e323 -move_to_inbox e168 -movie e02c -movie_creation e404 -movie_filter e43a -multiline_chart e6df -music_note e405 -music_video e063 -my_location e55c -nature e406 -nature_people e407 -navigate_before e408 -navigate_next e409 -navigation e55d -near_me e569 -network_cell e1b9 -network_check e640 -network_locked e61a -network_wifi e1ba -new_releases e031 -next_week e16a -nfc e1bb -no_encryption e641 -no_sim e0cc -not_interested e033 -note e06f -note_add e89c -notifications e7f4 -notifications_active e7f7 -notifications_none e7f5 -notifications_off e7f6 -notifications_paused e7f8 -offline_pin e90a -ondemand_video e63a -opacity e91c -open_in_browser e89d -open_in_new e89e -open_with e89f -pages e7f9 -pageview e8a0 -palette e40a -pan_tool e925 -panorama e40b -panorama_fish_eye e40c -panorama_horizontal e40d -panorama_vertical e40e -panorama_wide_angle e40f -party_mode e7fa -pause e034 -pause_circle_filled e035 -pause_circle_outline e036 -payment e8a1 -people e7fb -people_outline e7fc -perm_camera_mic e8a2 -perm_contact_calendar e8a3 -perm_data_setting e8a4 -perm_device_information e8a5 -perm_identity e8a6 -perm_media e8a7 -perm_phone_msg e8a8 -perm_scan_wifi e8a9 -person e7fd -person_add e7fe -person_outline e7ff -person_pin e55a -person_pin_circle e56a -personal_video e63b -pets e91d -phone e0cd -phone_android e324 -phone_bluetooth_speaker e61b -phone_forwarded e61c -phone_in_talk e61d -phone_iphone e325 -phone_locked e61e -phone_missed e61f -phone_paused e620 -phonelink e326 -phonelink_erase e0db -phonelink_lock e0dc -phonelink_off e327 -phonelink_ring e0dd -phonelink_setup e0de -photo e410 -photo_album e411 -photo_camera e412 -photo_filter e43b -photo_library e413 -photo_size_select_actual e432 -photo_size_select_large e433 -photo_size_select_small e434 -picture_as_pdf e415 -picture_in_picture e8aa -picture_in_picture_alt e911 -pie_chart e6c4 -pie_chart_outlined e6c5 -pin_drop e55e -place e55f -play_arrow e037 -play_circle_filled e038 -play_circle_outline e039 -play_for_work e906 -playlist_add e03b -playlist_add_check e065 -playlist_play e05f -plus_one e800 -poll e801 -polymer e8ab -pool eb48 -portable_wifi_off e0ce -portrait e416 -power e63c -power_input e336 -power_settings_new e8ac -pregnant_woman e91e -present_to_all e0df -print e8ad -priority_high e645 -public e80b -publish e255 -query_builder e8ae -question_answer e8af -queue e03c -queue_music e03d -queue_play_next e066 -radio e03e -radio_button_checked e837 -radio_button_unchecked e836 -rate_review e560 -receipt e8b0 -recent_actors e03f -record_voice_over e91f -redeem e8b1 -redo e15a -refresh e5d5 -remove e15b -remove_circle e15c -remove_circle_outline e15d -remove_from_queue e067 -remove_red_eye e417 -remove_shopping_cart e928 -reorder e8fe -repeat e040 -repeat_one e041 -replay e042 -replay_10 e059 -replay_30 e05a -replay_5 e05b -reply e15e -reply_all e15f -report e160 -report_problem e8b2 -restaurant e56c -restaurant_menu e561 -restore e8b3 -restore_page e929 -ring_volume e0d1 -room e8b4 -room_service eb49 -rotate_90_degrees_ccw e418 -rotate_left e419 -rotate_right e41a -rounded_corner e920 -router e328 -rowing e921 -rss_feed e0e5 -rv_hookup e642 -satellite e562 -save e161 -scanner e329 -schedule e8b5 -school e80c -screen_lock_landscape e1be -screen_lock_portrait e1bf -screen_lock_rotation e1c0 -screen_rotation e1c1 -screen_share e0e2 -sd_card e623 -sd_storage e1c2 -search e8b6 -security e32a -select_all e162 -send e163 -sentiment_dissatisfied e811 -sentiment_neutral e812 -sentiment_satisfied e813 -sentiment_very_dissatisfied e814 -sentiment_very_satisfied e815 -settings e8b8 -settings_applications e8b9 -settings_backup_restore e8ba -settings_bluetooth e8bb -settings_brightness e8bd -settings_cell e8bc -settings_ethernet e8be -settings_input_antenna e8bf -settings_input_component e8c0 -settings_input_composite e8c1 -settings_input_hdmi e8c2 -settings_input_svideo e8c3 -settings_overscan e8c4 -settings_phone e8c5 -settings_power e8c6 -settings_remote e8c7 -settings_system_daydream e1c3 -settings_voice e8c8 -share e80d -shop e8c9 -shop_two e8ca -shopping_basket e8cb -shopping_cart e8cc -short_text e261 -show_chart e6e1 -shuffle e043 -signal_cellular_4_bar e1c8 -signal_cellular_connected_no_internet_4_bar e1cd -signal_cellular_no_sim e1ce -signal_cellular_null e1cf -signal_cellular_off e1d0 -signal_wifi_4_bar e1d8 -signal_wifi_4_bar_lock e1d9 -signal_wifi_off e1da -sim_card e32b -sim_card_alert e624 -skip_next e044 -skip_previous e045 -slideshow e41b -slow_motion_video e068 -smartphone e32c -smoke_free eb4a -smoking_rooms eb4b -sms e625 -sms_failed e626 -snooze e046 -sort e164 -sort_by_alpha e053 -spa eb4c -space_bar e256 -speaker e32d -speaker_group e32e -speaker_notes e8cd -speaker_notes_off e92a -speaker_phone e0d2 -spellcheck e8ce -star e838 -star_border e83a -star_half e839 -stars e8d0 -stay_current_landscape e0d3 -stay_current_portrait e0d4 -stay_primary_landscape e0d5 -stay_primary_portrait e0d6 -stop e047 -stop_screen_share e0e3 -storage e1db -store e8d1 -store_mall_directory e563 -straighten e41c -streetview e56e -strikethrough_s e257 -style e41d -subdirectory_arrow_left e5d9 -subdirectory_arrow_right e5da -subject e8d2 -subscriptions e064 -subtitles e048 -subway e56f -supervisor_account e8d3 -surround_sound e049 -swap_calls e0d7 -swap_horiz e8d4 -swap_vert e8d5 -swap_vertical_circle e8d6 -switch_camera e41e -switch_video e41f -sync e627 -sync_disabled e628 -sync_problem e629 -system_update e62a -system_update_alt e8d7 -tab e8d8 -tab_unselected e8d9 -tablet e32f -tablet_android e330 -tablet_mac e331 -tag_faces e420 -tap_and_play e62b -terrain e564 -text_fields e262 -text_format e165 -textsms e0d8 -texture e421 -theaters e8da -thumb_down e8db -thumb_up e8dc -thumbs_up_down e8dd -time_to_leave e62c -timelapse e422 -timeline e922 -timer e425 -timer_10 e423 -timer_3 e424 -timer_off e426 -title e264 -toc e8de -today e8df -toll e8e0 -tonality e427 -touch_app e913 -toys e332 -track_changes e8e1 -traffic e565 -train e570 -tram e571 -transfer_within_a_station e572 -transform e428 -translate e8e2 -trending_down e8e3 -trending_flat e8e4 -trending_up e8e5 -tune e429 -turned_in e8e6 -turned_in_not e8e7 -tv e333 -unarchive e169 -undo e166 -unfold_less e5d6 -unfold_more e5d7 -update e923 -usb e1e0 -verified_user e8e8 -vertical_align_bottom e258 -vertical_align_center e259 -vertical_align_top e25a -vibration e62d -video_call e070 -video_label e071 -video_library e04a -videocam e04b -videocam_off e04c -videogame_asset e338 -view_agenda e8e9 -view_array e8ea -view_carousel e8eb -view_column e8ec -view_comfy e42a -view_compact e42b -view_day e8ed -view_headline e8ee -view_list e8ef -view_module e8f0 -view_quilt e8f1 -view_stream e8f2 -view_week e8f3 -vignette e435 -visibility e8f4 -visibility_off e8f5 -voice_chat e62e -voicemail e0d9 -volume_down e04d -volume_mute e04e -volume_off e04f -volume_up e050 -vpn_key e0da -vpn_lock e62f -wallpaper e1bc -warning e002 -watch e334 -watch_later e924 -wb_auto e42c -wb_cloudy e42d -wb_incandescent e42e -wb_iridescent e436 -wb_sunny e430 -wc e63d -web e051 -web_asset e069 -weekend e16b -whatshot e80e -widgets e1bd -wifi e63e -wifi_lock e1e1 -wifi_tethering e1e2 -work e8f9 -wrap_text e25b -youtube_searched_for e8fa -zoom_in e8ff -zoom_out e900 -zoom_out_map e56b diff --git a/common-gui/pom.xml b/common-gui/pom.xml deleted file mode 100644 index f082abe4..00000000 --- a/common-gui/pom.xml +++ /dev/null @@ -1,179 +0,0 @@ - - - 4.0.0 - - - gov.llnl.gnem.apps.coda.calibration - coda-calibration - 1.0.10 - - - gov.llnl.gnem.apps.coda.common - common-gui - jar - common-gui - https://www.llnl.gov - - - Lawrence Livermore National Laboratory (LLNL) - https://www.llnl.gov - - - - - gov.llnl.gnem.apps.coda.common - common-model - - - org.openjfx - javafx-base - - - org.openjfx - javafx-fxml - - - org.openjfx - javafx-swing - - - org.openjfx - javafx-web - win - - - org.openjfx - javafx-web - mac - - - org.openjfx - javafx-web - linux - - - org.openjfx - javafx-graphics - win - - - org.openjfx - javafx-graphics - mac - - - org.openjfx - javafx-graphics - linux - - - org.openjfx - javafx-controls - - - - gov.llnl.gnem.apps.coda.calibration - externals - - - - org.springframework.boot - spring-boot-starter-webflux - - - - ch.qos.logback - logback-classic - - - org.springframework - spring-test - test - - - org.junit.jupiter - junit-jupiter - test - - - org.springframework.boot - spring-boot-starter-test - test - - - - org.springframework.boot - spring-boot-configuration-processor - true - - - org.springframework.boot - spring-boot-devtools - true - - - org.springframework - spring-messaging - - - org.springframework - spring-websocket - - - org.glassfish.tyrus.bundles - tyrus-standalone-client - - - org.apache.commons - commons-compress - - - org.apache.commons - commons-math3 - - - org.apache.commons - commons-lang3 - - - com.google.guava - guava - - - net.jodah - failsafe - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - ${maven.compile.source} - ${maven.compile.target} - - - - org.apache.maven.plugins - maven-jar-plugin - - - - true - - - ${project.version} - ${buildNumber} - ${scmBranch} - ${maven.build.timestamp} - - - - - - - diff --git a/common-gui/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/common-gui/src/main/resources/META-INF/additional-spring-configuration-metadata.json deleted file mode 100644 index 602e6558..00000000 --- a/common-gui/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "properties": [ - { - "name": "webclient.basePath", - "type": "java.lang.String", - "description": "The base URL to attempt to connect to for REST services if the REST clients are enabled. Should be of the form [host](:[port])." - }, - { - "name": "app.height", - "type": "java.lang.String", - "description": "Default height (in pixels) the main window will use." - }, - { - "name": "app.width", - "type": "java.lang.String", - "description": "Default width (in pixels) the main window will use." - }, - { - "name": "app.baseTitle", - "type": "java.lang.String", - "description": "Default Title Bar entry for the application (i.e. Coda Calibration)" - }, - { - "name": "app.debug", - "type": "java.lang.String", - "description": "Flag for enabling additional Application level debugging functionality. This is not intended to affect logging levels or globally enable/disable debugging but rather to turn on additional hooks, stack tracing, etc that cross-cut the application. In general this should be left at the default value of false." - } - ] -} \ No newline at end of file diff --git a/common-gui/src/main/resources/coda-truststore.jks b/common-gui/src/main/resources/coda-truststore.jks deleted file mode 100644 index 32ba5e08..00000000 Binary files a/common-gui/src/main/resources/coda-truststore.jks and /dev/null differ diff --git a/common-gui/src/main/resources/fxml/CommonGui.css b/common-gui/src/main/resources/fxml/CommonGui.css deleted file mode 100644 index f4eb53ec..00000000 --- a/common-gui/src/main/resources/fxml/CommonGui.css +++ /dev/null @@ -1,55 +0,0 @@ -.material-icons { - -fx-font-family: 'Material Icons'; - -fx-font-weight: normal; - -fx-font-style: normal; - -fx-font-size: 18px; - /* Preferred icon size */ - -fx-display: inline-block; - -fx-line-height: 1; - -fx-text-transform: none; - -fx-letter-spacing: normal; - -fx-word-wrap: normal; - -fx-white-space: nowrap; - -fx-direction: ltr; -} - -.material-icons-medium { - -fx-font-family: 'Material Icons'; - -fx-font-weight: normal; - -fx-font-style: normal; - -fx-font-size: 14px; - /* Preferred icon size */ - -fx-display: inline-block; - -fx-line-height: 1; - -fx-text-transform: none; - -fx-letter-spacing: normal; - -fx-word-wrap: normal; - -fx-white-space: nowrap; - -fx-direction: ltr; -} - -.material-icons-small { - -fx-font-family: 'Material Icons'; - -fx-font-weight: normal; - -fx-font-style: normal; - -fx-font-size: 10px; - /* Preferred icon size */ - -fx-display: inline-block; - -fx-line-height: 1; - -fx-text-transform: none; - -fx-letter-spacing: normal; - -fx-word-wrap: normal; - -fx-white-space: nowrap; - -fx-direction: ltr; -} - -.red-bar { - -fx-accent: red; -} - -.text-input:readonly { - -fx-background-color: transparent; -} -.text-input:readonly { - -fx-background-color: transparent; -} \ No newline at end of file diff --git a/common-service/LICENSE.txt b/common-service/LICENSE.txt deleted file mode 100644 index c463fc26..00000000 --- a/common-service/LICENSE.txt +++ /dev/null @@ -1,206 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2017 Lawrence Livermore National Laboratory - - Licensed under the Apache License, Version 2.0 (the "License"); - 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. - - LLNL DISCLAIMER - - This work was performed under the auspices of the U.S. Department of Energy -by Lawrence Livermore National Laboratory under Contract DE-AC52-07NA27344. diff --git a/common-service/common-application/LICENSE.txt b/common-service/common-application/LICENSE.txt deleted file mode 100644 index c463fc26..00000000 --- a/common-service/common-application/LICENSE.txt +++ /dev/null @@ -1,206 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2017 Lawrence Livermore National Laboratory - - Licensed under the Apache License, Version 2.0 (the "License"); - 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. - - LLNL DISCLAIMER - - This work was performed under the auspices of the U.S. Department of Energy -by Lawrence Livermore National Laboratory under Contract DE-AC52-07NA27344. diff --git a/common-service/common-application/pom.xml b/common-service/common-application/pom.xml deleted file mode 100644 index 71a7b649..00000000 --- a/common-service/common-application/pom.xml +++ /dev/null @@ -1,122 +0,0 @@ - - - - gov.llnl.gnem.apps.coda.common - common-service - 1.0.10 - - - 4.0.0 - common-application - jar - common-application - - - - javax.xml.bind - jaxb-api - - - org.apache.commons - commons-lang3 - - - org.springframework.boot - spring-boot-starter - - - org.springframework.boot - spring-boot-starter-test - test - - - org.springframework.boot - spring-boot-devtools - true - - - gov.llnl.gnem.apps.coda.common - common-service-impl - - - gov.llnl.gnem.apps.coda.common - common-service-api - - - gov.llnl.gnem.apps.coda.common - common-repository - - - gov.llnl.gnem.apps.coda.common - common-model - - - org.springframework.boot - spring-boot-starter-data-jpa - - - org.springframework.boot - spring-boot-starter-jdbc - provided - - - com.h2database - h2 - provided - - - org.springframework - spring-websocket - - - org.springframework - spring-messaging - - - org.springframework.boot - spring-boot-autoconfigure - - - com.fasterxml.jackson.core - jackson-databind - - - org.springframework - spring-webmvc - - - org.springframework.boot - spring-boot-starter-actuator - - - org.springframework.boot - spring-boot-starter-web - - - org.junit.jupiter - junit-jupiter - test - - - org.springframework.boot - spring-boot-configuration-processor - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - - diff --git a/common-service/common-model/LICENSE.txt b/common-service/common-model/LICENSE.txt deleted file mode 100644 index c463fc26..00000000 --- a/common-service/common-model/LICENSE.txt +++ /dev/null @@ -1,206 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2017 Lawrence Livermore National Laboratory - - Licensed under the Apache License, Version 2.0 (the "License"); - 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. - - LLNL DISCLAIMER - - This work was performed under the auspices of the U.S. Department of Energy -by Lawrence Livermore National Laboratory under Contract DE-AC52-07NA27344. diff --git a/common-service/common-model/pom.xml b/common-service/common-model/pom.xml deleted file mode 100644 index 62032946..00000000 --- a/common-service/common-model/pom.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - gov.llnl.gnem.apps.coda.common - common-service - 1.0.10 - - - 4.0.0 - common-model - jar - common-model - - - - org.eclipse.collections - eclipse-collections-api - - - org.eclipse.collections - eclipse-collections - - - org.springframework - spring-context - - - org.springframework.data - spring-data-jpa - - - org.springframework.data - spring-data-commons - - - javax.validation - validation-api - - - com.fasterxml.jackson.core - jackson-annotations - - - org.eclipse.persistence - javax.persistence - - - org.junit.jupiter - junit-jupiter-api - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - - diff --git a/common-service/common-repository/LICENSE.txt b/common-service/common-repository/LICENSE.txt deleted file mode 100644 index c463fc26..00000000 --- a/common-service/common-repository/LICENSE.txt +++ /dev/null @@ -1,206 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2017 Lawrence Livermore National Laboratory - - Licensed under the Apache License, Version 2.0 (the "License"); - 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. - - LLNL DISCLAIMER - - This work was performed under the auspices of the U.S. Department of Energy -by Lawrence Livermore National Laboratory under Contract DE-AC52-07NA27344. diff --git a/common-service/common-repository/pom.xml b/common-service/common-repository/pom.xml deleted file mode 100644 index 79d76f44..00000000 --- a/common-service/common-repository/pom.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - gov.llnl.gnem.apps.coda.common - common-service - 1.0.10 - - - 4.0.0 - common-repository - jar - common-repository - - - - com.h2database - h2 - test - - - gov.llnl.gnem.apps.coda.common - common-model - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - - diff --git a/common-service/common-service-api/LICENSE.txt b/common-service/common-service-api/LICENSE.txt deleted file mode 100644 index c463fc26..00000000 --- a/common-service/common-service-api/LICENSE.txt +++ /dev/null @@ -1,206 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2017 Lawrence Livermore National Laboratory - - Licensed under the Apache License, Version 2.0 (the "License"); - 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. - - LLNL DISCLAIMER - - This work was performed under the auspices of the U.S. Department of Energy -by Lawrence Livermore National Laboratory under Contract DE-AC52-07NA27344. diff --git a/common-service/common-service-api/pom.xml b/common-service/common-service-api/pom.xml deleted file mode 100644 index 23a7a55f..00000000 --- a/common-service/common-service-api/pom.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - gov.llnl.gnem.apps.coda.common - common-service - 1.0.10 - - - 4.0.0 - common-service-api - jar - common-service-api - - - - gov.llnl.gnem.apps.coda.common - common-model - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - - diff --git a/common-service/common-service-impl/LICENSE.txt b/common-service/common-service-impl/LICENSE.txt deleted file mode 100644 index c463fc26..00000000 --- a/common-service/common-service-impl/LICENSE.txt +++ /dev/null @@ -1,206 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2017 Lawrence Livermore National Laboratory - - Licensed under the Apache License, Version 2.0 (the "License"); - 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. - - LLNL DISCLAIMER - - This work was performed under the auspices of the U.S. Department of Energy -by Lawrence Livermore National Laboratory under Contract DE-AC52-07NA27344. diff --git a/common-service/common-service-impl/pom.xml b/common-service/common-service-impl/pom.xml deleted file mode 100644 index be38ea52..00000000 --- a/common-service/common-service-impl/pom.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - gov.llnl.gnem.apps.coda.common - common-service - 1.0.10 - - - 4.0.0 - common-service-impl - jar - common-service-impl - - - - gov.llnl.gnem.apps.coda.common - common-repository - - - gov.llnl.gnem.apps.coda.common - common-service-api - - - gov.llnl.gnem.apps.coda.common - common-model - - - com.fasterxml.jackson.core - jackson-annotations - - - org.slf4j - slf4j-api - - - - - gov.llnl.gnem.apps.coda.calibration - externals - - - org.springframework - spring-tx - - - org.apache.commons - commons-lang3 - - - ch.qos.logback - logback-classic - - - org.apache.commons - commons-math3 - - - org.mockito - mockito-core - test - - - org.mockito - mockito-junit-jupiter - test - - - org.junit.jupiter - junit-jupiter - test - - - org.springframework.boot - spring-boot-starter-test - test - - - org.springframework.boot - spring-boot-starter-data-jpa - test - - - com.h2database - h2 - test - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - - diff --git a/common-service/common-service-impl/src/test/java/gov/llnl/gnem/apps/coda/common/service/CommonServiceTestContext.java b/common-service/common-service-impl/src/test/java/gov/llnl/gnem/apps/coda/common/service/CommonServiceTestContext.java deleted file mode 100644 index 06919365..00000000 --- a/common-service/common-service-impl/src/test/java/gov/llnl/gnem/apps/coda/common/service/CommonServiceTestContext.java +++ /dev/null @@ -1,31 +0,0 @@ -/* -* 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.common.service; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.domain.EntityScan; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.data.jpa.repository.config.EnableJpaRepositories; - -import gov.llnl.gnem.apps.coda.common.repository.DetachableJpaRepoImpl; - -@SpringBootApplication -@ComponentScan("gov.llnl.gnem.apps.coda.common.application") -@ComponentScan("gov.llnl.gnem.apps.coda.common.service") -@ComponentScan("gov.llnl.gnem.apps.coda.common.repository") -@ComponentScan("gov.llnl.gnem.apps.coda.common.model") -@EntityScan(basePackages = { "gov.llnl.gnem.apps.coda.common" }) -@EnableJpaRepositories(basePackages = { "gov.llnl.gnem.apps.coda.common" }, repositoryBaseClass = DetachableJpaRepoImpl.class) -public class CommonServiceTestContext { -} diff --git a/common-service/pom.xml b/common-service/pom.xml deleted file mode 100644 index 72f2fe06..00000000 --- a/common-service/pom.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - gov.llnl.gnem.apps.coda.calibration - coda-calibration - 1.0.10 - - - gov.llnl.gnem.apps.coda.common - 4.0.0 - common-service - common-service - pom - - - common-model - common-repository - common-service-api - common-service-impl - common-application - - diff --git a/envelope-gui/LICENSE.txt b/envelope-gui/LICENSE.txt deleted file mode 100644 index c463fc26..00000000 --- a/envelope-gui/LICENSE.txt +++ /dev/null @@ -1,206 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2017 Lawrence Livermore National Laboratory - - Licensed under the Apache License, Version 2.0 (the "License"); - 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. - - LLNL DISCLAIMER - - This work was performed under the auspices of the U.S. Department of Energy -by Lawrence Livermore National Laboratory under Contract DE-AC52-07NA27344. diff --git a/envelope-gui/pom.xml b/envelope-gui/pom.xml deleted file mode 100644 index fbb7cc97..00000000 --- a/envelope-gui/pom.xml +++ /dev/null @@ -1,203 +0,0 @@ - - - 4.0.0 - - - gov.llnl.gnem.apps.coda.calibration - coda-calibration - 1.0.10 - - - envelope-gui - gov.llnl.gnem.apps.coda.envelope - jar - envelope-gui - https://www.llnl.gov - - - Lawrence Livermore National Laboratory (LLNL) - https://www.llnl.gov - - - - gov.llnl.gnem.apps.coda.envelope.gui.GuiApplication - - - - - spring-milestones - Spring Milestones - https://repo.spring.io/libs-milestone - - false - - - - - - spring-milestones - https://repo.spring.io/milestone - - - - - - gov.llnl.gnem.apps.coda.calibration - externals - - - gov.llnl.gnem.apps.coda.common - common-model - - - - org.springframework.boot - spring-boot-starter-webflux - - - - ch.qos.logback - logback-classic - - - org.springframework - spring-test - test - - - org.junit.jupiter - junit-jupiter - test - - - org.springframework.boot - spring-boot-starter-test - test - - - - org.springframework.boot - spring-boot-configuration-processor - true - - - org.springframework.boot - spring-boot-devtools - true - - - org.springframework - spring-messaging - - - org.springframework - spring-websocket - - - org.glassfish.tyrus.bundles - tyrus-standalone-client - - - org.apache.commons - commons-compress - - - org.apache.commons - commons-math3 - - - org.apache.commons - commons-lang3 - - - com.google.guava - guava - - - net.jodah - failsafe - - - gov.llnl.gnem.apps.coda.common - common-gui - - - gov.llnl.gnem.apps.coda.envelope - envelope-model - - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - - unpack - - prepare-package - - - - gov.llnl.gnem.apps.coda.common - common-gui - ${project.version} - ** - gov/** - - - ${project.build.directory}/classes/ - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - ${maven.compile.source} - ${maven.compile.target} - - - - org.springframework.boot - spring-boot-maven-plugin - - true - ${start-class} - runnable - true - - - - - repackage - - - - - - org.apache.maven.plugins - maven-jar-plugin - - - - true - - - ${project.version} - ${buildNumber} - ${scmBranch} - ${maven.build.timestamp} - gov.llnl.gnem.apps.coda.common.gui.SimpleGuiPreloader - - - - - - - diff --git a/envelope-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/AppProperties.java b/envelope-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/AppProperties.java deleted file mode 100644 index a41f28b0..00000000 --- a/envelope-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/AppProperties.java +++ /dev/null @@ -1,60 +0,0 @@ -/* -* Copyright (c) 2018, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory -* CODE-743439. -* All rights reserved. -* This file is part of CCT. For details, see https://github.com/LLNL/coda-calibration-tool. -* -* 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.envelope.gui; - -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.stereotype.Component; - -@Component -@ConfigurationProperties("envelope-app") -public class AppProperties { - - private String baseTitle = "Envelope Creator"; - private Integer height = 900; - private Integer width = 800; - private Boolean debugEnabled = Boolean.FALSE; - - public Boolean getDebugEnabled() { - return debugEnabled; - } - - public void setDebugEnabled(Boolean debugEnabled) { - this.debugEnabled = debugEnabled; - } - - public String getBaseTitle() { - return baseTitle; - } - - public void setBaseTitle(String baseTitle) { - this.baseTitle = baseTitle; - } - - public Integer getHeight() { - return height; - } - - public void setHeight(Integer height) { - this.height = height; - } - - public Integer getWidth() { - return width; - } - - public void setWidth(Integer width) { - this.width = width; - } -} diff --git a/envelope-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/GuiApplication.java b/envelope-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/GuiApplication.java deleted file mode 100644 index bf647b0b..00000000 --- a/envelope-gui/src/main/java/gov/llnl/gnem/apps/coda/envelope/gui/GuiApplication.java +++ /dev/null @@ -1,173 +0,0 @@ -/* -* Copyright (c) 2018, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory -* CODE-743439. -* All rights reserved. -* This file is part of CCT. For details, see https://github.com/LLNL/coda-calibration-tool. -* -* 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.envelope.gui; - -import java.io.IOException; -import java.net.URL; -import java.util.TimeZone; -import java.util.concurrent.CancellationException; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; -import java.util.jar.Attributes; -import java.util.jar.Manifest; - -import javax.annotation.PostConstruct; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.boot.Banner.Mode; -import org.springframework.boot.WebApplicationType; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.builder.SpringApplicationBuilder; -import org.springframework.context.ConfigurableApplicationContext; -import org.springframework.context.annotation.ComponentScan; - -import gov.llnl.gnem.apps.coda.common.gui.SimpleGuiPreloader; -import gov.llnl.gnem.apps.coda.common.gui.util.CommonGuiUtils; -import javafx.application.Application; -import javafx.application.Platform; -import javafx.fxml.FXMLLoader; -import javafx.scene.Parent; -import javafx.scene.Scene; -import javafx.scene.image.Image; -import javafx.scene.text.Font; -import javafx.stage.Stage; -import reactor.core.publisher.Hooks; - -@SpringBootApplication -@ComponentScan("gov.llnl.gnem.apps.coda.common.gui") -@ComponentScan("gov.llnl.gnem.apps.coda.envelope.gui") -@ComponentScan("gov.llnl.gnem.apps.coda.envelope.model") -public class GuiApplication extends Application { - - private static final Logger log = LoggerFactory.getLogger(GuiApplication.class); - - private ConfigurableApplicationContext springContext; - - private Stage primaryStage; - - @PostConstruct - void started() { - TimeZone.setDefault(TimeZone.getTimeZone("UTC")); - } - - public GuiApplication() { - } - - public GuiApplication(ConfigurableApplicationContext springContext) { - this.springContext = springContext; - } - - public static void main(String[] args) { - String preloaderName = System.getProperty("javafx.preloader"); - if (preloaderName == null) { - System.setProperty("javafx.preloader", SimpleGuiPreloader.class.getName()); - } - launch(GuiApplication.class, args); - } - - @Override - public void init() throws Exception { - CommonGuiUtils.setIcon(this.getClass(), "/coda_256x256.png"); - springContext = new SpringApplicationBuilder(GuiApplication.class).bannerMode(Mode.OFF).web(WebApplicationType.NONE).headless(false).run(); - } - - @Override - public void start(Stage primaryStage) throws Exception { - this.primaryStage = primaryStage; - primaryStage.getIcons().add(new Image(this.getClass().getResourceAsStream("/coda_32x32.png"))); - primaryStage.getIcons().add(new Image(this.getClass().getResourceAsStream("/coda_64x64.png"))); - primaryStage.getIcons().add(new Image(this.getClass().getResourceAsStream("/coda_128x128.png"))); - primaryStage.getIcons().add(new Image(this.getClass().getResourceAsStream("/coda_256x256.png"))); - primaryStage.setOnCloseRequest((evt) -> Platform.exit()); - - AppProperties props = springContext.getBean(AppProperties.class); - - // Enable Reactor debugging stack-traces; these are very slow! - if (props.getDebugEnabled()) { - Hooks.onOperatorDebug(); - } - - try { - Class clazz = GuiApplication.class; - String className = clazz.getSimpleName() + ".class"; - String classPath = clazz.getResource(className).toString(); - String baseTitle = props.getBaseTitle(); - if (classPath.startsWith("jar")) { - String manifestPath = classPath.substring(0, classPath.indexOf('!') + 1) + "/META-INF/MANIFEST.MF"; - Manifest mf = new Manifest(new URL(manifestPath).openStream()); - Attributes atts = mf.getMainAttributes(); - // Put this info in the log to help with analysis - log.info( - "Version:{} Commit:{} Branch:{} By:{} at {}", - atts.getValue("Implementation-Version"), - atts.getValue("Implementation-Build"), - atts.getValue("Build-Branch"), - atts.getValue("Built-By"), - atts.getValue("Build-Timestamp")); - // Update the title bar - baseTitle += " Built at " + atts.getValue("Build-Timestamp"); - } else { - // Class not from JAR - log.info("{} not running from a jar.", baseTitle); - } - props.setBaseTitle(baseTitle); - } catch (IOException e) { - // should never happen... - log.error("Failed initializing!", e); - } - - Platform.setImplicitExit(true); - FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/fxml/EnvelopeGui.fxml")); - fxmlLoader.setControllerFactory(springContext::getBean); - - try { - Font.loadFont(getClass().getResource("/fxml/MaterialIcons-Regular.ttf").toExternalForm(), 18); - Parent root = fxmlLoader.load(); - Platform.runLater(() -> { - primaryStage.setTitle(props.getBaseTitle()); - Scene scene = new Scene(root, props.getHeight(), props.getWidth()); - primaryStage.setScene(scene); - primaryStage.show(); - }); - } catch (IllegalStateException | IOException e) { - log.error("Unable to load main panel FXML file, terminating. {}", e.getMessage(), e); - Platform.exit(); - } - } - - @Override - public void stop() throws Exception { - try { - CompletableFuture.runAsync(() -> { - springContext.stop(); - springContext.close(); - }).get(1, TimeUnit.SECONDS); - } catch (TimeoutException | ExecutionException | CancellationException e) { - } - Platform.exit(); - System.exit(0); - } - - public Stage getPrimaryStage() { - return primaryStage; - } - - public void setPrimaryStage(Stage primaryStage) { - this.primaryStage = primaryStage; - } -} diff --git a/envelope-gui/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/envelope-gui/src/main/resources/META-INF/additional-spring-configuration-metadata.json deleted file mode 100644 index f1e4d990..00000000 --- a/envelope-gui/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ /dev/null @@ -1,22 +0,0 @@ -{"properties": [ - { - "name": "envelope-app.height", - "type": "java.lang.String", - "description": "Default height (in pixels) the main window will use." - }, - { - "name": "envelope-app.width", - "type": "java.lang.String", - "description": "Default width (in pixels) the main window will use." - }, - { - "name": "envelope-app.baseTitle", - "type": "java.lang.String", - "description": "Default Title Bar entry for the application (i.e. Envelope Creator)" - }, - { - "name": "envelope-app.debug", - "type": "java.lang.String", - "description": "Flag for enabling additional Application level debugging functionality. This is not intended to affect logging levels or globally enable/disable debugging but rather to turn on additional hooks, stack tracing, etc that cross-cut the application. In general this should be left at the default value of false." - } -]} \ No newline at end of file diff --git a/envelope-gui/src/main/resources/application.properties b/envelope-gui/src/main/resources/application.properties deleted file mode 100644 index 3817cdbf..00000000 --- a/envelope-gui/src/main/resources/application.properties +++ /dev/null @@ -1,6 +0,0 @@ -spring.output.ansi.enabled=ALWAYS -logging.level.org.springframework.web.socket.*=off -logging.level.org.springframework.web.reactive.function.client.*=off -logging.level.org.springframework.web.socket.sockjs.client.SockJsClient=off -webclient.basePath=localhost:53922 -spring.codec.max-in-memory-size=-1 \ No newline at end of file diff --git a/envelope-gui/src/main/resources/bootstrap.yml b/envelope-gui/src/main/resources/bootstrap.yml deleted file mode 100644 index aec1c554..00000000 --- a/envelope-gui/src/main/resources/bootstrap.yml +++ /dev/null @@ -1,3 +0,0 @@ -spring: - application: - name: envelope-gui \ No newline at end of file diff --git a/envelope-gui/src/main/resources/coda-truststore.jks b/envelope-gui/src/main/resources/coda-truststore.jks deleted file mode 100644 index 32ba5e08..00000000 Binary files a/envelope-gui/src/main/resources/coda-truststore.jks and /dev/null differ diff --git a/envelope-gui/src/main/resources/fxml/CommonGui.css b/envelope-gui/src/main/resources/fxml/CommonGui.css deleted file mode 100644 index bac23c15..00000000 --- a/envelope-gui/src/main/resources/fxml/CommonGui.css +++ /dev/null @@ -1,48 +0,0 @@ -.material-icons { - -fx-font-family: 'Material Icons'; - -fx-font-weight: normal; - -fx-font-style: normal; - -fx-font-size: 18px; - /* Preferred icon size */ - -fx-display: inline-block; - -fx-line-height: 1; - -fx-text-transform: none; - -fx-letter-spacing: normal; - -fx-word-wrap: normal; - -fx-white-space: nowrap; - -fx-direction: ltr; -} - -.material-icons-medium { - -fx-font-family: 'Material Icons'; - -fx-font-weight: normal; - -fx-font-style: normal; - -fx-font-size: 14px; - /* Preferred icon size */ - -fx-display: inline-block; - -fx-line-height: 1; - -fx-text-transform: none; - -fx-letter-spacing: normal; - -fx-word-wrap: normal; - -fx-white-space: nowrap; - -fx-direction: ltr; -} - -.material-icons-small { - -fx-font-family: 'Material Icons'; - -fx-font-weight: normal; - -fx-font-style: normal; - -fx-font-size: 10px; - /* Preferred icon size */ - -fx-display: inline-block; - -fx-line-height: 1; - -fx-text-transform: none; - -fx-letter-spacing: normal; - -fx-word-wrap: normal; - -fx-white-space: nowrap; - -fx-direction: ltr; -} - -.red-bar { - -fx-accent: red; -} \ No newline at end of file diff --git a/envelope-gui/src/main/resources/fxml/EnvelopeGui.fxml b/envelope-gui/src/main/resources/fxml/EnvelopeGui.fxml deleted file mode 100644 index f9b20b5f..00000000 --- a/envelope-gui/src/main/resources/fxml/EnvelopeGui.fxml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/envelope-gui/src/main/resources/fxml/MaterialIcons-Regular.ttf b/envelope-gui/src/main/resources/fxml/MaterialIcons-Regular.ttf deleted file mode 100644 index 7015564a..00000000 Binary files a/envelope-gui/src/main/resources/fxml/MaterialIcons-Regular.ttf and /dev/null differ diff --git a/envelope-gui/src/test/resources/sac/IU.ANMO.SE.MXE.sac b/envelope-gui/src/test/resources/sac/IU.ANMO.SE.MXE.sac deleted file mode 100644 index c84cd139..00000000 Binary files a/envelope-gui/src/test/resources/sac/IU.ANMO.SE.MXE.sac and /dev/null differ diff --git a/envelope-gui/src/test/resources/sac/IU.ANMO.SE.MXN.sac b/envelope-gui/src/test/resources/sac/IU.ANMO.SE.MXN.sac deleted file mode 100644 index 0357915c..00000000 Binary files a/envelope-gui/src/test/resources/sac/IU.ANMO.SE.MXN.sac and /dev/null differ diff --git a/envelope-gui/src/test/resources/sac/IU.ANMO.SE.MXZ.sac b/envelope-gui/src/test/resources/sac/IU.ANMO.SE.MXZ.sac deleted file mode 100644 index 020b3242..00000000 Binary files a/envelope-gui/src/test/resources/sac/IU.ANMO.SE.MXZ.sac and /dev/null differ diff --git a/envelope-service/LICENSE.txt b/envelope-service/LICENSE.txt deleted file mode 100644 index c463fc26..00000000 --- a/envelope-service/LICENSE.txt +++ /dev/null @@ -1,206 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2017 Lawrence Livermore National Laboratory - - Licensed under the Apache License, Version 2.0 (the "License"); - 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. - - LLNL DISCLAIMER - - This work was performed under the auspices of the U.S. Department of Energy -by Lawrence Livermore National Laboratory under Contract DE-AC52-07NA27344. diff --git a/envelope-service/envelope-application/LICENSE.txt b/envelope-service/envelope-application/LICENSE.txt deleted file mode 100644 index c463fc26..00000000 --- a/envelope-service/envelope-application/LICENSE.txt +++ /dev/null @@ -1,206 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2017 Lawrence Livermore National Laboratory - - Licensed under the Apache License, Version 2.0 (the "License"); - 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. - - LLNL DISCLAIMER - - This work was performed under the auspices of the U.S. Department of Energy -by Lawrence Livermore National Laboratory under Contract DE-AC52-07NA27344. diff --git a/envelope-service/envelope-application/pom.xml b/envelope-service/envelope-application/pom.xml deleted file mode 100644 index d749d480..00000000 --- a/envelope-service/envelope-application/pom.xml +++ /dev/null @@ -1,130 +0,0 @@ - - - - gov.llnl.gnem.apps.coda.envelope - envelope-service - 1.0.10 - - - 4.0.0 - envelope-application - jar - envelope-application - - - - gov.llnl.gnem.apps.coda.envelope - envelope-service-impl - - - gov.llnl.gnem.apps.coda.envelope - envelope-service-api - - - gov.llnl.gnem.apps.coda.envelope - envelope-repository - - - gov.llnl.gnem.apps.coda.envelope - envelope-model - - - org.apache.commons - commons-lang3 - - - org.springframework.boot - spring-boot-starter - - - org.springframework.boot - spring-boot-starter-test - test - - - org.springframework.boot - spring-boot-devtools - true - - - org.springframework.boot - spring-boot-starter-data-jpa - - - org.springframework.boot - spring-boot-starter-jdbc - provided - - - com.h2database - h2 - provided - - - org.springframework - spring-websocket - - - org.springframework - spring-messaging - - - org.springframework.boot - spring-boot-autoconfigure - - - com.fasterxml.jackson.core - jackson-databind - - - org.springframework - spring-webmvc - - - org.springframework.boot - spring-boot-starter-web - - - gov.llnl.gnem.apps.coda.common - common-model - - - gov.llnl.gnem.apps.coda.common - common-application - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - org.springframework.boot - spring-boot-maven-plugin - - true - ${start-class} - runnable - true - - - - - repackage - - - - - - - diff --git a/envelope-service/envelope-application/src/main/java/gov/llnl/gnem/apps/coda/envelope/EnvelopeApplication.java b/envelope-service/envelope-application/src/main/java/gov/llnl/gnem/apps/coda/envelope/EnvelopeApplication.java deleted file mode 100644 index 7973d1f8..00000000 --- a/envelope-service/envelope-application/src/main/java/gov/llnl/gnem/apps/coda/envelope/EnvelopeApplication.java +++ /dev/null @@ -1,45 +0,0 @@ -/* -* Copyright (c) 2018, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory -* CODE-743439. -* All rights reserved. -* This file is part of CCT. For details, see https://github.com/LLNL/coda-calibration-tool. -* -* 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.envelope; - -import java.util.TimeZone; - -import javax.annotation.PostConstruct; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.EnableAutoConfiguration; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.domain.EntityScan; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.data.jpa.repository.config.EnableJpaRepositories; - -import gov.llnl.gnem.apps.coda.common.repository.DetachableJpaRepoImpl; - -@SpringBootApplication -@EnableAutoConfiguration -@ComponentScan("gov.llnl.gnem.apps.coda.common") -@ComponentScan("gov.llnl.gnem.apps.coda.envelope") -@EntityScan(basePackages = { "gov.llnl.gnem.apps.coda.envelope.model.domain", "gov.llnl.gnem.apps.coda.common" }) -@EnableJpaRepositories(basePackages = { "gov.llnl.gnem.apps.coda.envelope", "gov.llnl.gnem.apps.coda.common" }, repositoryBaseClass = DetachableJpaRepoImpl.class) -public class EnvelopeApplication { - @PostConstruct - void started() { - TimeZone.setDefault(TimeZone.getTimeZone("UTC")); - } - - public static void main(String[] args) { - SpringApplication.run(EnvelopeApplication.class, args); - } -} \ No newline at end of file diff --git a/envelope-service/envelope-application/src/main/resources/application-file.properties b/envelope-service/envelope-application/src/main/resources/application-file.properties deleted file mode 100644 index ef06e8f8..00000000 --- a/envelope-service/envelope-application/src/main/resources/application-file.properties +++ /dev/null @@ -1 +0,0 @@ -spring.datasource.url=jdbc:h2:./codaH2.db;DB_CLOSE_DELAY=-1;COMPRESS=TRUE;DB_CLOSE_ON_EXIT=FALSE;AUTO_SERVER=TRUE;AUTO_SERVER_PORT=9999 \ No newline at end of file diff --git a/envelope-service/envelope-application/src/main/resources/application.properties b/envelope-service/envelope-application/src/main/resources/application.properties deleted file mode 100644 index f29f755e..00000000 --- a/envelope-service/envelope-application/src/main/resources/application.properties +++ /dev/null @@ -1,18 +0,0 @@ -spring.output.ansi.enabled=ALWAYS -logging.level.root=ERROR -logging.level.gov.llnl.gnem.apps.coda.*=INFO -spring.datasource.driver-class-name=org.h2.Driver -server.port=53922 -spring.jpa.hibernate.ddl-auto=create -server.ssl.key-alias=selfsigned -server.ssl.key-password=changeit -server.ssl.key-store=classpath:coda-keystore.jks -server.ssl.key-store-provider=SUN -server.ssl.key-store-type=JKS -spring.datasource.continueOnError=true -spring.jdbc.template.fetch-size=1000 -spring.jpa.properties.hibernate.jdbc.time_zone = UTC -server.compression.enabled=true -server.compression.mime-types=text/html,text/xml,text/plain,text/css,text/javascript,application/javascript,application/json -server.compression.min-response-size=1024 -server.http2.enabled=true \ No newline at end of file diff --git a/envelope-service/envelope-application/src/main/resources/banner.txt b/envelope-service/envelope-application/src/main/resources/banner.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/envelope-service/envelope-application/src/main/resources/bootstrap.yml b/envelope-service/envelope-application/src/main/resources/bootstrap.yml deleted file mode 100644 index 9f3b33bc..00000000 --- a/envelope-service/envelope-application/src/main/resources/bootstrap.yml +++ /dev/null @@ -1,3 +0,0 @@ -spring: - application: - name: envelope-application \ No newline at end of file diff --git a/envelope-service/envelope-application/src/main/resources/coda-keystore.jks b/envelope-service/envelope-application/src/main/resources/coda-keystore.jks deleted file mode 100644 index 54eee10f..00000000 Binary files a/envelope-service/envelope-application/src/main/resources/coda-keystore.jks and /dev/null differ diff --git a/envelope-service/envelope-model/LICENSE.txt b/envelope-service/envelope-model/LICENSE.txt deleted file mode 100644 index c463fc26..00000000 --- a/envelope-service/envelope-model/LICENSE.txt +++ /dev/null @@ -1,206 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2017 Lawrence Livermore National Laboratory - - Licensed under the Apache License, Version 2.0 (the "License"); - 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. - - LLNL DISCLAIMER - - This work was performed under the auspices of the U.S. Department of Energy -by Lawrence Livermore National Laboratory under Contract DE-AC52-07NA27344. diff --git a/envelope-service/envelope-model/pom.xml b/envelope-service/envelope-model/pom.xml deleted file mode 100644 index df2e4ab5..00000000 --- a/envelope-service/envelope-model/pom.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - gov.llnl.gnem.apps.coda.envelope - envelope-service - 1.0.10 - - - 4.0.0 - envelope-model - jar - envelope-model - - - - org.springframework - spring-context - - - org.springframework.data - spring-data-jpa - - - org.springframework.data - spring-data-commons - - - javax.validation - validation-api - - - com.fasterxml.jackson.core - jackson-annotations - - - org.eclipse.persistence - javax.persistence - - - gov.llnl.gnem.apps.coda.common - common-model - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - - diff --git a/envelope-service/envelope-repository/LICENSE.txt b/envelope-service/envelope-repository/LICENSE.txt deleted file mode 100644 index c463fc26..00000000 --- a/envelope-service/envelope-repository/LICENSE.txt +++ /dev/null @@ -1,206 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2017 Lawrence Livermore National Laboratory - - Licensed under the Apache License, Version 2.0 (the "License"); - 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. - - LLNL DISCLAIMER - - This work was performed under the auspices of the U.S. Department of Energy -by Lawrence Livermore National Laboratory under Contract DE-AC52-07NA27344. diff --git a/envelope-service/envelope-repository/pom.xml b/envelope-service/envelope-repository/pom.xml deleted file mode 100644 index f174c627..00000000 --- a/envelope-service/envelope-repository/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - gov.llnl.gnem.apps.coda.envelope - envelope-service - 1.0.10 - - - 4.0.0 - envelope-repository - jar - envelope-repository - - - - gov.llnl.gnem.apps.coda.envelope - envelope-model - - - com.h2database - h2 - test - - - gov.llnl.gnem.apps.coda.common - common-repository - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - - diff --git a/envelope-service/envelope-service-api/LICENSE.txt b/envelope-service/envelope-service-api/LICENSE.txt deleted file mode 100644 index c463fc26..00000000 --- a/envelope-service/envelope-service-api/LICENSE.txt +++ /dev/null @@ -1,206 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2017 Lawrence Livermore National Laboratory - - Licensed under the Apache License, Version 2.0 (the "License"); - 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. - - LLNL DISCLAIMER - - This work was performed under the auspices of the U.S. Department of Energy -by Lawrence Livermore National Laboratory under Contract DE-AC52-07NA27344. diff --git a/envelope-service/envelope-service-api/pom.xml b/envelope-service/envelope-service-api/pom.xml deleted file mode 100644 index d136eccb..00000000 --- a/envelope-service/envelope-service-api/pom.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - gov.llnl.gnem.apps.coda.envelope - envelope-service - 1.0.10 - - - 4.0.0 - envelope-service-api - jar - envelope-service-api - - - - gov.llnl.gnem.apps.coda.envelope - envelope-model - - - gov.llnl.gnem.apps.coda.common - common-model - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - - diff --git a/envelope-service/envelope-service-impl/LICENSE.txt b/envelope-service/envelope-service-impl/LICENSE.txt deleted file mode 100644 index c463fc26..00000000 --- a/envelope-service/envelope-service-impl/LICENSE.txt +++ /dev/null @@ -1,206 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2017 Lawrence Livermore National Laboratory - - Licensed under the Apache License, Version 2.0 (the "License"); - 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. - - LLNL DISCLAIMER - - This work was performed under the auspices of the U.S. Department of Energy -by Lawrence Livermore National Laboratory under Contract DE-AC52-07NA27344. diff --git a/envelope-service/envelope-service-impl/pom.xml b/envelope-service/envelope-service-impl/pom.xml deleted file mode 100644 index 98c904e8..00000000 --- a/envelope-service/envelope-service-impl/pom.xml +++ /dev/null @@ -1,98 +0,0 @@ - - - - - gov.llnl.gnem.apps.coda.envelope - envelope-service - 1.0.10 - - - 4.0.0 - envelope-service-impl - jar - envelope-service-impl - - - - gov.llnl.gnem.apps.coda.envelope - envelope-repository - - - gov.llnl.gnem.apps.coda.envelope - envelope-service-api - - - gov.llnl.gnem.apps.coda.envelope - envelope-model - - - com.fasterxml.jackson.core - jackson-annotations - - - org.slf4j - slf4j-api - - - - - gov.llnl.gnem.apps.coda.common - common-model - - - gov.llnl.gnem.apps.coda.common - common-service-impl - - - gov.llnl.gnem.apps.coda.calibration - externals - - - org.junit.jupiter - junit-jupiter - test - - - org.springframework - spring-tx - - - org.apache.commons - commons-lang3 - - - ch.qos.logback - logback-classic - - - org.apache.commons - commons-math3 - - - org.mockito - mockito-core - test - - - org.mockito - mockito-junit-jupiter - test - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - - diff --git a/envelope-service/pom.xml b/envelope-service/pom.xml deleted file mode 100644 index bfb4ffa5..00000000 --- a/envelope-service/pom.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - gov.llnl.gnem.apps.coda.calibration - coda-calibration - 1.0.10 - - - gov.llnl.gnem.apps.coda.envelope - 4.0.0 - envelope-service - envelope-service - pom - - - envelope-model - envelope-repository - envelope-service-api - envelope-service-impl - envelope-application - - diff --git a/envelope-standalone/LICENSE.txt b/envelope-standalone/LICENSE.txt deleted file mode 100644 index c463fc26..00000000 --- a/envelope-standalone/LICENSE.txt +++ /dev/null @@ -1,206 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2017 Lawrence Livermore National Laboratory - - Licensed under the Apache License, Version 2.0 (the "License"); - 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. - - LLNL DISCLAIMER - - This work was performed under the auspices of the U.S. Department of Energy -by Lawrence Livermore National Laboratory under Contract DE-AC52-07NA27344. diff --git a/envelope-standalone/pom.xml b/envelope-standalone/pom.xml deleted file mode 100644 index a8976067..00000000 --- a/envelope-standalone/pom.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - gov.llnl.gnem.apps.coda.calibration - coda-calibration - 1.0.10 - - - 4.0.0 - envelope-standalone - envelope-standalone - jar - - - - - org.apache.maven.plugins - maven-compiler-plugin - - - org.apache.maven.plugins - maven-surefire-plugin - - - org.apache.maven.plugins - maven-jar-plugin - - - - true - - - ${project.version} - ${buildNumber} - ${scmBranch} - ${maven.build.timestamp} - - - - - - org.springframework.boot - spring-boot-maven-plugin - - true - ${start-class} - runnable - true - - - - - repackage - - - - - - - - - gov.llnl.gnem.apps.coda.envelope - envelope-application - - - gov.llnl.gnem.apps.coda.envelope - envelope-gui - - - com.h2database - h2 - provided - - - diff --git a/envelope-standalone/src/main/java/gov/llnl/gnem/apps/coda/envelope/standalone/EnvelopeStandalone.java b/envelope-standalone/src/main/java/gov/llnl/gnem/apps/coda/envelope/standalone/EnvelopeStandalone.java deleted file mode 100644 index b30f1d79..00000000 --- a/envelope-standalone/src/main/java/gov/llnl/gnem/apps/coda/envelope/standalone/EnvelopeStandalone.java +++ /dev/null @@ -1,114 +0,0 @@ -/* -* Copyright (c) 2018, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory -* CODE-743439. -* All rights reserved. -* This file is part of CCT. For details, see https://github.com/LLNL/coda-calibration-tool. -* -* 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.envelope.standalone; - -import java.util.TimeZone; -import java.util.concurrent.CancellationException; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; - -import javax.annotation.PostConstruct; -import javax.swing.SwingUtilities; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.builder.SpringApplicationBuilder; -import org.springframework.context.ConfigurableApplicationContext; -import org.springframework.context.annotation.ComponentScan; - -import gov.llnl.gnem.apps.coda.common.gui.SimpleGuiPreloader; -import gov.llnl.gnem.apps.coda.common.gui.util.CommonGuiUtils; -import gov.llnl.gnem.apps.coda.envelope.EnvelopeApplication; -import gov.llnl.gnem.apps.coda.envelope.gui.GuiApplication; -import javafx.application.Application; -import javafx.application.Platform; -import javafx.embed.swing.JFXPanel; -import javafx.stage.Stage; - -@SpringBootApplication -@ComponentScan("gov.llnl.gnem.apps.coda") -public class EnvelopeStandalone extends Application { - - private static final Logger log = LoggerFactory.getLogger(EnvelopeStandalone.class); - private static volatile ConfigurableApplicationContext springContext; - private static String[] initialArgs; - - @PostConstruct - void started() { - TimeZone.setDefault(TimeZone.getTimeZone("UTC")); - } - - public static synchronized void main(String[] args) { - try { - initialArgs = args; - String preloaderName = System.getProperty("javafx.preloader"); - if (preloaderName == null) { - System.setProperty("javafx.preloader", SimpleGuiPreloader.class.getName()); - } - final CountDownLatch latch = new CountDownLatch(1); - SwingUtilities.invokeLater(() -> { - new JFXPanel(); // initializes JavaFX environment - latch.countDown(); - }); - - if (!latch.await(5L, TimeUnit.SECONDS)) { - throw new ExceptionInInitializerError(); - } - launch(EnvelopeStandalone.class, args); - } catch (Exception e) { - log.error("Exception at EnvelopeStandalone::main", e); - Platform.exit(); - System.exit(1); - } - } - - @Override - public void init() throws Exception { - CommonGuiUtils.setIcon(this.getClass(), "/coda_256x256.png"); - setContext(new SpringApplicationBuilder(EnvelopeApplication.class).headless(false).run(initialArgs)); - } - - private ConfigurableApplicationContext setContext(ConfigurableApplicationContext context) { - if (springContext != null) { - return springContext; - } - - springContext = context; - return springContext; - } - - @Override - public void start(Stage primaryStage) throws Exception { - CommonGuiUtils.setIcon(this.getClass(), "/coda_256x256.png"); - new GuiApplication(springContext).start(primaryStage); - } - - @Override - public void stop() throws Exception { - try { - CompletableFuture.runAsync(() -> { - springContext.stop(); - springContext.close(); - }).get(1, TimeUnit.SECONDS); - } catch (TimeoutException | ExecutionException | CancellationException e) { - } - Platform.exit(); - System.exit(0); - } -} diff --git a/envelope-standalone/src/main/resources/application.properties b/envelope-standalone/src/main/resources/application.properties deleted file mode 100644 index ffb17749..00000000 --- a/envelope-standalone/src/main/resources/application.properties +++ /dev/null @@ -1,36 +0,0 @@ -#Server -spring.output.ansi.enabled=ALWAYS -spring.jpa.open-in-view=false -logging.level.root=ERROR -logging.level.gov.llnl.gnem.apps.coda.*=INFO -spring.datasource.driver-class-name=org.h2.Driver -server.port=53922 -server.address=127.0.0.1 -spring.jpa.hibernate.ddl-auto=create -server.ssl.key-alias=selfsigned -server.ssl.key-password=changeit -server.ssl.key-store=classpath:coda-keystore.jks -server.ssl.key-store-provider=SUN -server.ssl.key-store-type=JKS -spring.datasource.continueOnError=true -spring.jdbc.template.fetch-size=1000 -spring.jpa.properties.hibernate.jdbc.time_zone = UTC -server.compression.enabled=true -server.compression.mime-types=text/html,text/xml,text/plain,text/css,text/javascript,application/javascript,application/json -server.compression.min-response-size=1024 -server.http2.enabled=true -management.endpoints.web.exposure.include[0]=info -management.endpoints.web.exposure.include[1]=health -management.endpoints.web.exposure.include[2]=metrics -management.endpoints.web.exposure.include[3]=prometheus - -#Client -webclient.basePath=localhost:53922 -webclient.subscriptions=/topic/status-events -logging.level.org.springframework.web.socket.*=off -logging.level.org.springframework.web.reactive.function.client.*=off -logging.level.org.springframework.web.socket.sockjs.client.SockJsClient=off -envelope-app.height=1200 -envelope-app.width=800 -envelope-app.baseTitle=Envelope Tool -spring.codec.max-in-memory-size=-1 \ No newline at end of file diff --git a/envelope-standalone/src/main/resources/bootstrap.yml b/envelope-standalone/src/main/resources/bootstrap.yml deleted file mode 100644 index 7258f2c1..00000000 --- a/envelope-standalone/src/main/resources/bootstrap.yml +++ /dev/null @@ -1,3 +0,0 @@ -spring: - application: - name: envelope-standalone \ No newline at end of file diff --git a/example-notebooks/measure-mws/Mw-From-FDSN-waveforms.ipynb b/example-notebooks/measure-mws/Mw-From-FDSN-waveforms.ipynb index d415e2cf..fa03897d 100644 --- a/example-notebooks/measure-mws/Mw-From-FDSN-waveforms.ipynb +++ b/example-notebooks/measure-mws/Mw-From-FDSN-waveforms.ipynb @@ -6,19 +6,21 @@ "metadata": {}, "outputs": [], "source": [ - "#You might need to install obspy if you don't already have it (written with ObsPy 1.0.1)\n", - "#%sx pip install obspy" + "#You might need to install some additonal dependencies (written with ObsPy 1.2.2, Pandas 1.2.3, Numpy 1.20.2, Matplotlib 3.4.1)\n", + "%sx pip install obspy numpy pandas matplotlib" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import obspy\n", "import requests\n", "import json\n", + "import numpy as np\n", + "import pandas as pd\n", "\n", "from obspy import read\n", "import matplotlib.pyplot as plt" @@ -28,60 +30,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Function to convert a Stream to a (minimal) Waveform object" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "def irisTraceToWaveformJson(stream, evid, originTime, evLat, evLon): \n", - " obj = []\n", - " for tr in stream.traces: \n", - " stat = tr.stats\n", - " inventory = client.get_stations(network=stat.network, station=stat.station,\n", - " starttime=stat.starttime,\n", - " endtime=stat.endtime) \n", - " wave = {}\n", - " event = {}\n", - " event[\"eventId\"] = evid\n", - " event[\"originTime\"] = originTime\n", - " event[\"latitude\"] = evLat\n", - " event[\"longitude\"] = evLon\n", - " wave[\"event\"] = event\n", - " \n", - " stream = {}\n", - " station = {}\n", - " station[\"networkName\"] = stat.network\n", - " station[\"stationName\"] = stat.station\n", - " station[\"latitude\"] = inventory.networks[0].stations[0].latitude\n", - " station[\"longitude\"] = inventory.networks[0].stations[0].longitude\n", - " stream[\"station\"] = station;\n", - " stream[\"channelName\"] = stat.channel\n", - " wave[\"stream\"] = stream\n", - " \n", - " wave[\"beginTime\"] = str(stat.starttime)\n", - " wave[\"endTime\"] = str(stat.endtime)\n", - " wave[\"sampleRate\"] = stat.sampling_rate\n", - " wave[\"segment\"] = tr.data.tolist()\n", - " obj.append(wave)\n", - " \n", - " envelopeJob = {}\n", - " envelopeJob[\"data\"] = obj\n", - " \n", - " return envelopeJob" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Upload and run the calibration and envelope application services from the terminal before the rest of the notebook\n", - "\n", - "java -jar envelope-application-1.0.*-runnable.jar\n", - "\n", + "### Upload and run the calibration application services from the terminal before the rest of the notebook\n", "java -jar calibration-application-1.0.*-runnable.jar" ] }, @@ -94,7 +43,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -108,19 +57,37 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Here I am just picking an event that I know the calibration should be valid for given the stations in question" + "Here I am just picking events at random that I know the calibrated stations were likely to see and we have mws for comparison.\n", + "\n", + "The mw part isn't necessary but makes the plots more challenging to interpret and it would be best to update them to have categorical indicators for the method.\n", + "\n", + "For the sake of simplicity in this example we just limit ourselves, the rest is an exercise left to the reader." ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": { "scrolled": true }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "11 Event(s) in Catalog:\n", + "2019-10-15T19:42:30.540000Z | +36.645, -121.274 | 4.71 Mw | manual\n", + "2019-10-15T05:33:42.810000Z | +37.938, -122.057 | 4.46 Mw | manual\n", + "...\n", + "2015-08-17T13:49:17.320000Z | +37.837, -122.232 | 4.01 Mw | manual\n", + "2015-05-22T02:53:00.780000Z | +38.432, -122.250 | 4.09 Mw | manual\n", + "To see all events call 'print(CatalogObject.__str__(print_all=True))'\n" + ] + } + ], "source": [ - "starttime = UTCDateTime(\"2007/10/31\")\n", - "endtime = UTCDateTime(\"2007/11/01\")\n", + "starttime = UTCDateTime(\"2015/01/01\")\n", + "endtime = UTCDateTime(\"2019/12/01\")\n", "cat = client.get_events(starttime=starttime, endtime=endtime,\n", " minmagnitude=4.0, minlatitude=36.5, maxlatitude=38.5, minlongitude=-123, maxlongitude=-121)\n", "print(cat)" @@ -157,10 +124,16 @@ " for trace in stn.traces:\n", " trace.data = trace.data * 1e+9 \n", " \n", + " sten = ste + stn\n", + " for tr in sten.traces:\n", + " tr.meta[\"evid\"] = evid\n", + " tr.meta[\"evlat\"] = evlat\n", + " tr.meta[\"evlon\"] = evlon\n", + " tr.meta[\"evtime\"] = t\n", " if (st == None):\n", - " st = ste + stn\n", + " st = sten\n", " else:\n", - " st = st + ste + stn \n", + " st = st + sten\n", "\n", "print(st)" ] @@ -169,7 +142,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Convert the ObsPy Stream into Waveform JSON" + "Saving off the data to save us some time and bandwidth if we need to retrieve the results again" ] }, { @@ -178,7 +151,75 @@ "metadata": {}, "outputs": [], "source": [ - "waveData = irisTraceToWaveformJson(st, evid, str(t), evlat, evlon)" + "st.write(\"data_query_result.pickle\")" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "st = obspy.read(\"data_query_result.pickle\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Function to convert a Stream to a (minimal) Waveform object" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "def irisTraceToWaveformJson(stream): \n", + " obj = []\n", + " for tr in stream.traces: \n", + " stat = tr.stats\n", + " inventory = client.get_stations(network=stat.network, station=stat.station,\n", + " starttime=stat.starttime,\n", + " endtime=stat.endtime) \n", + " wave = {}\n", + " event = {}\n", + " event[\"eventId\"] = tr.meta[\"evid\"]\n", + " event[\"originTime\"] = str(tr.meta[\"evtime\"])\n", + " event[\"latitude\"] = tr.meta[\"evlat\"]\n", + " event[\"longitude\"] = tr.meta[\"evlon\"]\n", + " wave[\"event\"] = event\n", + " \n", + " stream = {}\n", + " station = {}\n", + " station[\"networkName\"] = stat.network\n", + " station[\"stationName\"] = stat.station\n", + " station[\"latitude\"] = inventory.networks[0].stations[0].latitude\n", + " station[\"longitude\"] = inventory.networks[0].stations[0].longitude\n", + " stream[\"station\"] = station;\n", + " stream[\"channelName\"] = stat.channel\n", + " wave[\"stream\"] = stream\n", + " \n", + " wave[\"beginTime\"] = str(stat.starttime)\n", + " wave[\"endTime\"] = str(stat.endtime)\n", + " wave[\"sampleRate\"] = stat.sampling_rate\n", + " wave[\"segment\"] = tr.data.tolist()\n", + " obj.append(wave)\n", + " \n", + " envelopeJob = {}\n", + " envelopeJob[\"data\"] = obj\n", + " \n", + " return envelopeJob" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "waveData = irisTraceToWaveformJson(st)" ] }, { @@ -192,7 +233,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "metadata": {}, "outputs": [], "source": [ @@ -208,9 +249,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "200\n", + "\n" + ] + } + ], "source": [ "with open(\"norcal_bands.json\") as bands:\n", " norcal_bands = json.load(bands)\n", @@ -228,9 +278,17 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 9, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "200\n" + ] + } + ], "source": [ "with open(\"norcal_site.json\") as corrections:\n", " norcal_corrections = json.load(corrections)\n", @@ -242,18 +300,24 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Post the data to the envelopes service and decode the resulting stacks. Note that I am not posting envelope bands in this request and just relying on the default configuration so this will output fewer bands than we actually calibrated against. In practice I would want to submit the bands with the job to get the full spectra I have calibrations for (see EnvelopeJob for the format for that)." + "Post the data to the envelopes endpoint and decode the resulting stacks. Note that I am not posting envelope bands in this request and just relying on the default configuration so this will output fewer bands than we actually calibrated against. In practice I would want to submit the bands with the job to get the full spectra I have calibrations for (see EnvelopeJob for the format for that)." ] }, { "cell_type": "code", - "execution_count": null, - "metadata": { - "scrolled": false - }, - "outputs": [], + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "200\n" + ] + } + ], "source": [ - "r = requests.post('https://127.0.0.1:53922/api/v1/envelopes/create/batch-stacks-only/10000', json=waveData, verify=False)\n", + "r = requests.post('https://127.0.0.1:53921/api/v1/envelopes/create/batch-stacks-only/10000', json=waveData, verify=False)\n", "print(r.status_code)\n", "envData = json.loads(r.text)[\"resultPayload\"]" ] @@ -267,11 +331,19 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 11, "metadata": { "scrolled": true }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "200\n" + ] + } + ], "source": [ "request = {\n", " \"stacks\": envData,\n", @@ -282,13 +354,54 @@ "eventMws = json.loads(r.text)" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This will return details about the measured events. I'm just picking one to look at here." + ] + }, { "cell_type": "code", - "execution_count": null, + "execution_count": 12, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{\n", + " \"eventId\": \"72453246\",\n", + " \"mw\": 4.271013291513935,\n", + " \"mwSd\": null,\n", + " \"mw1Max\": 4.357547301878603,\n", + " \"mw1Min\": 4.173798261585144,\n", + " \"mw2Max\": 4.357547301878603,\n", + " \"mw2Min\": 4.062097843507903,\n", + " \"refMw\": null,\n", + " \"valMw\": null,\n", + " \"apparentStressInMpa\": 0.14708008050657245,\n", + " \"apparentStress1Max\": 0.14708008050657245,\n", + " \"apparentStress1Min\": 0.14708008050657245,\n", + " \"apparentStress2Max\": 0.14708008050657245,\n", + " \"apparentStress2Min\": 0.14708008050657245,\n", + " \"refApparentStressInMpa\": null,\n", + " \"valApparentStressInMpa\": null,\n", + " \"cornerFreq\": 1.029730309287659,\n", + " \"cornerFreqSd\": null,\n", + " \"dataCount\": 58,\n", + " \"latitude\": 38.4316667,\n", + " \"longitude\": -122.2503333,\n", + " \"depth\": 0.0,\n", + " \"datetime\": \"2015-05-22T02:53:00.780Z\",\n", + " \"iterations\": 27,\n", + " \"misfit\": 0.002330191867568431\n", + "}\n" + ] + } + ], "source": [ - "print(eventMws[\"measuredMwDetails\"][\"40204628\"])" + "print(json.dumps(eventMws[\"measuredMwDetails\"][\"72453246\"], indent=4, sort_keys=False))" ] }, { @@ -300,29 +413,296 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 13, "metadata": {}, "outputs": [], "source": [ - "fig, ax = plt.subplots()\n", - "x1 = [cat.events[0].magnitudes[0].mag]\n", - "x2 = []\n", + "mwcomp = {}\n", + "\n", + "for catEv in cat.events:\n", + "# Note this split is for the NCEDC and how they format their event identification strings, you will need to update this for IRIS or others!\n", + " x = mwcomp.get(str(str(catEv.resource_id).split(\"/\")[3]), {})\n", + " x[\"eventTime\"] = catEv.origins[0].time\n", + " x[\"ncal_mw\"] = catEv.magnitudes[0].mag\n", + " mwcomp[str(str(catEv.resource_id).split(\"/\")[3])] = x\n", + "\n", "for evs in eventMws[\"measuredMwDetails\"]:\n", - " x2.append(eventMws[\"measuredMwDetails\"][evs][\"mw\"]) \n", - "scale = 200.0\n", + " x = mwcomp.get(str(eventMws[\"measuredMwDetails\"][evs][\"eventId\"]), {})\n", + " x[\"cct_mw\"] = eventMws[\"measuredMwDetails\"][evs][\"mw\"]\n", + " x[\"minMw\"] = eventMws[\"measuredMwDetails\"][evs][\"mw2Min\"]\n", + " x[\"maxMw\"] = eventMws[\"measuredMwDetails\"][evs][\"mw2Max\"]\n", + " mwcomp[str(eventMws[\"measuredMwDetails\"][evs][\"eventId\"])] = x\n", + " \n", + "df = pd.DataFrame.from_dict(mwcomp, orient='index')" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
eventTimencal_mwcct_mwminMwmaxMw
727829712017-03-31T10:55:53.700000Z4.003.8818753.6884683.979786
725073962015-08-17T13:49:17.320000Z4.014.2075574.0758464.321306
729067812017-10-10T00:53:18.270000Z4.094.1563304.1098854.210936
724532462015-05-22T02:53:00.780000Z4.094.2710134.0620984.357547
731052762018-11-02T12:58:54.230000Z4.114.1273123.9797214.163055
726635062016-07-19T21:38:38.910000Z4.224.3319124.2257184.436379
732254212019-07-16T20:11:01.470000Z4.314.2715864.1071254.366192
729488012018-01-04T10:39:37.730000Z4.384.3185914.2274184.405946
732918802019-10-15T05:33:42.810000Z4.464.5399464.4276824.611228
729233802017-11-13T19:31:29.050000Z4.584.6824184.4739304.781167
732923602019-10-15T19:42:30.540000Z4.714.7103334.5339404.905543
\n", + "
" + ], + "text/plain": [ + " eventTime ncal_mw cct_mw minMw maxMw\n", + "72782971 2017-03-31T10:55:53.700000Z 4.00 3.881875 3.688468 3.979786\n", + "72507396 2015-08-17T13:49:17.320000Z 4.01 4.207557 4.075846 4.321306\n", + "72906781 2017-10-10T00:53:18.270000Z 4.09 4.156330 4.109885 4.210936\n", + "72453246 2015-05-22T02:53:00.780000Z 4.09 4.271013 4.062098 4.357547\n", + "73105276 2018-11-02T12:58:54.230000Z 4.11 4.127312 3.979721 4.163055\n", + "72663506 2016-07-19T21:38:38.910000Z 4.22 4.331912 4.225718 4.436379\n", + "73225421 2019-07-16T20:11:01.470000Z 4.31 4.271586 4.107125 4.366192\n", + "72948801 2018-01-04T10:39:37.730000Z 4.38 4.318591 4.227418 4.405946\n", + "73291880 2019-10-15T05:33:42.810000Z 4.46 4.539946 4.427682 4.611228\n", + "72923380 2017-11-13T19:31:29.050000Z 4.58 4.682418 4.473930 4.781167\n", + "73292360 2019-10-15T19:42:30.540000Z 4.71 4.710333 4.533940 4.905543" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df.sort_values([\"ncal_mw\"], ascending=True)" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAc0AAAJNCAYAAABTHS5YAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Z1A+gAAAACXBIWXMAAAsTAAALEwEAmpwYAAAwC0lEQVR4nO3de3xddZ3v/9eHRkhNgQDV2FoktBZFQAWbH5xhlDBgvMADNXjByngZjq3o8TIijhwd3IoO4xGP1VGHIs5DHKlV5rTgQXEyoyQwzoChR7k7U1paqe0UYQiQkAh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8FDgeIiAbgYODhIousAznjTEScDnwSOCul9PtiS6wLk43zgcCxQPdon5OAH3ox0B7L+X3eBPwwpfRUSul+4D8YCVHtxPs0a1hEtAMfSymdudv6DwDHpZTeFxHnAJ0ppbdWoMS6MME4H8/Id8avTSmtrUBpdWW8cd6tT/don9sKKqvuTPD7/Frg7Smld0XEbEYudHt5Ssl/cO/EI806ERGfjYizRl9+CzgsIu4DPgp8onKV1ZfdxvmLwCzgmoj4VUT8sIKl1ZXdxlllsts4/yPwcETcA9wIXGhgPpNHmpIkZfJIU5KkTIamJEmZDE1JkjIZmpIkZTI0JUnKZGhKVSginhcRKyNiXUSsiYgfR8RRo21Hjb5eGxH/LyJ+EBFvG73t5VcR0R8R/z7683d2227r6JNCPrfTutkR8VREfK3ozynVmoZKFyBpV6OT668GrkopnTO67mVAS0T8BvgR8NGU0v8dbWsHHkopvXz0dTcTTwBwPyMTd39q9PVbgLvL8VmkeuORplR9TgWeSildvmNFSun2lNLNwGLg33YE5mhbd0rprj3Y/hPAvTtNRfc24Afw9PMW748RzRGxLSJeNdp20+jjo6Rpy9CUqs+xwHgTa0/UtidWAudExOHANmAzQEppG/DvwEuAPwb+H/DKiDiAkSeNOF2gpjVDU5qefgK8GjgH+P5ubTcDrxpdLmUkPNuA3iILlKqRoSlVn7uBV0yhLVtK6UlGjlgvYGTS+Z3dBLwS+P+AHwPNjDwu6ua93a9U6wxNqfr8DDggIpbsWBERL42IVwIrgD+KiDN2antVRBw7hf18CfiLlNJ/7bb+F8AfAdtTSkPAr4CljISpNK0ZmlKVSSNPUXgTcProLSd3M3Ka9D9TSoPAmcAHR285uQd4P/C7Kezn7pTSVWOs/z3wAHDL6KqbGXmu5Z1T+kBSHfEpJ5IkZfJIU5KkTIamJEmZDE1JkjIZmpIkZTI0JUnKZGhKkpTJ0JQkKZOhKUlSpv8fmF5R8lQeaesAAAAASUVORK5CYII=\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "fig, ax = plt.subplots()\n", + "x1 = df[\"cct_mw\"]\n", + "x2 = df[\"ncal_mw\"]\n", + "uqLow = df[\"cct_mw\"]-df[\"minMw\"]\n", + "uqHigh = df[\"maxMw\"]-df[\"cct_mw\"]\n", "\n", - "ax.scatter(x1,x1, c='blue', s=scale, label='NC Mw',\n", - " alpha=1, edgecolors='none')\n", + "scale = 100.0\n", + "\n", + "plt.errorbar(x1,x2,yerr=[uqLow, uqHigh], marker=\"o\", linestyle=\"None\", markersize=7, markeredgecolor='black', markerfacecolor='black', capsize=10, color='black')\n", "\n", - "ax.scatter(x2,x2, c='red', s=scale, label='CCT Mw',\n", + "ax.scatter(x1,x1, c='blue', s=scale, label='NCal Ma',\n", " alpha=1, edgecolors='none')\n", "\n", "ax.legend()\n", "ax.grid(True)\n", + "ax.set_aspect(1)\n", + "fig.set_size_inches(10,10)\n", + "ax.set_ylabel(\"Ncal Mw\")\n", + "ax.set_xlabel(\"CCT Mw\")\n", "\n", "plt.show()" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "From this we can see that with this rough calibration I whipped up was not perfect and start to look at where the gaps are and begin refining the calibration. Usually in the CCT GUI application but in practice you could do so entirely using the REST API we have been using in this notebook. \n", + "\n", + "Also, the envelopes are entirely auto-picked in this instance so tweaking the parameters to use different windows and SNR criteria can likely improve this even with a very rough calibration." + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX4AAAD4CAYAAADrRI2NAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Z1A+gAAAACXBIWXMAAAsTAAALEwEAmpwYAAAq0UlEQVR4nO3de3hU1b3w8e+PJJBwS+QmCcECHkC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gcUC722v46mNf75wN1e6z5otWyhfBlaedM6ASeBdK+0P2D9FNuFNRTP8zPoReBvXBg+5T3saaP9Zn8IFHilH7A/VM9rPL3id2J1sOy0v4CTvV4zAmtI4C5gJRd6z7tj/Vzeb39RuzlVZuAfsX4S78Jn2CbwKheG7a3C6x9BM1+8lvZ1M1YN4ixwDFgdxjI399n0w/p1tdd+n7/hZ3/9aBr4/xGrmepDrP6JUXZ6FtaIn932+3uH12vutvNwgKYn7q/sMp+3H0ucKi9WzfUjrJrdv3IhuLcHXrPXbccOlF4n9Xt+8vRj+xie75ineSDqn7G97g6sc/AjvCpRWBWxDXY+1wCX2OmlXDhn1wFD7fR/oum5XBTK+xfJMjdz/g3A+t56hhw/2ta44HOM62ga+DOwfgHvxvo1Mry18umUDUop5TJ65a5SSrmMBn6llHIZDfxKKeUyGviVUsplNPArpZTLaOBXSimX0cCvlFIu8/8BN8ZdV1AB40wAAAAASUVORK5CYII=\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "df.plot(marker=\"o\", linestyle=\"None\")" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAD4CAYAAADsKpHdAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Z1A+gAAAACXBIWXMAAAsTAAALEwEAmpwYAAAe4klEQVR4nO3dfZQU9b3n8fdHHAEVQWGSVQYEjSE+DA/aoLuuYMSANyqKG4m50TV7k5iY3I33eIIr8RzjJfFq4t0jak5yNSY31/gUTZQY72aJEYjmEB+G8CQQVBQDY1YQHCLr6AJ+94/6jTbtPHRP99A9w+d1Tp+p+tWvq771m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TwTpK2o+s37etbx2gGThOUttdFT9BdvVCLSmqvdK0ktax1LbvKKYaU+z2VS+pXxo+CjgGeKmL7QvgTLKEsSlvXqMl7Z+GjyQ7qt+Qxj+U/o4kO39wb3rbfGrj8whFtllEnBYRoyJiFNmR4z9FxPckHSRpUHrvQWQnpdv2Ve3uDzvah0XEnIhoSMu4CFgYERenyfNJbQZMIbvaqGNVyKwHAVuBwXllv0iNsRL4FTA8lf8Hssz3V7Lsuol0Bp6sb/F5smx5TcE3jVVpfncDB6fyO4E3eP9ysabOYkrlB6R5PEd2eeAZNdJeL5KdQ2lbl7arEEaRXYq7luxqjCPz3pNL67Ee+B7vXxbY4TqSHWE91U5MX07LaPt/DU3lM9P/6B2yb4QLKtEGPdVe3VzHkts+TX8J+FhB2cTUXv83xby6ltsL+C9kJ0aXp23l3K62rzTtJ2TnCPKXe0nBvM7Pm/YksIbsvMzUvPKqfx67s43l1bmOdBRAdoXkivRazZ77sI72hx3uwwq25/xekSHAv5PtE/9AwaWqhS/fusLMzAD/UtnMzBInBDMzA5wQzMwscUIwMzPACcHMzBInBDMzA5wQzMws+f+lVUMNbJwrewAAAABJRU5ErkJggg==\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "df[df[\"ncal_mw\"] < 4.2][['ncal_mw','cct_mw']].plot(marker=\"o\", linestyle=\"None\")" + ] + }, { "cell_type": "code", "execution_count": null, @@ -347,9 +727,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.6" + "version": "3.8.8" } }, "nbformat": 4, - "nbformat_minor": 2 + "nbformat_minor": 4 } diff --git a/example-notebooks/measure-mws/norcal_bands.json b/example-notebooks/measure-mws/norcal_bands.json index 6e6bf335..4045b9f2 100644 --- a/example-notebooks/measure-mws/norcal_bands.json +++ b/example-notebooks/measure-mws/norcal_bands.json @@ -1,380 +1,434 @@ [ - { "velocity0" : 0.0, - "velocity1" : 0.0, - "velocity2" : 0.0, - "beta0" : 0.0, - "beta1" : 0.0, - "beta2" : 0.0, - "gamma0" : 0.0, - "gamma1" : 0.0, - "gamma2" : 0.0, - "s1" : 0.0, - "s2" : 0.0, - "xc" : 0.0, - "xt" : 0.0, - "q" : 0.0, - "snrThresholdAboveNoiseLog10" : 0.5, - "minWindowLengthSec" : 100.0, - "maxWindowLengthSec" : 1000.0, - "measurementTimeSec" : 100.0, - "lowFreqHz" : 0.02, - "highFreqHz" : 0.03 - }, { - "velocity0" : 0.0, - "velocity1" : 0.0, - "velocity2" : 0.0, - "beta0" : 0.0, - "beta1" : 0.0, - "beta2" : 0.0, - "gamma0" : 0.0, - "gamma1" : 0.0, - "gamma2" : 0.0, - "s1" : 0.0, - "s2" : 0.0, - "xc" : 0.0, - "xt" : 0.0, - "q" : 0.0, - "snrThresholdAboveNoiseLog10" : 0.5, - "minWindowLengthSec" : 100.0, - "maxWindowLengthSec" : 800.0, - "measurementTimeSec" : 100.0, - "lowFreqHz" : 0.03, - "highFreqHz" : 0.05 - }, { - "velocity0" : 0.0, - "velocity1" : 0.0, - "velocity2" : 0.0, - "beta0" : 0.0, - "beta1" : 0.0, - "beta2" : 0.0, - "gamma0" : 0.0, - "gamma1" : 0.0, - "gamma2" : 0.0, - "s1" : 0.0, - "s2" : 0.0, - "xc" : 0.0, - "xt" : 0.0, - "q" : 0.0, - "snrThresholdAboveNoiseLog10" : 0.5, - "minWindowLengthSec" : 75.0, - "maxWindowLengthSec" : 600.0, - "measurementTimeSec" : 100.0, - "lowFreqHz" : 0.05, - "highFreqHz" : 0.1 - }, { - "velocity0" : 0.0, - "velocity1" : 0.0, - "velocity2" : 0.0, - "beta0" : 0.0, - "beta1" : 0.0, - "beta2" : 0.0, - "gamma0" : 0.0, - "gamma1" : 0.0, - "gamma2" : 0.0, - "s1" : 0.0, - "s2" : 0.0, - "xc" : 0.0, - "xt" : 0.0, - "q" : 0.0, - "snrThresholdAboveNoiseLog10" : 0.5, - "minWindowLengthSec" : 75.0, - "maxWindowLengthSec" : 550.0, - "measurementTimeSec" : 100.0, - "lowFreqHz" : 0.1, - "highFreqHz" : 0.2 - }, { - "velocity0" : 4.575846794095369, - "velocity1" : 2331.8988367174925, - "velocity2" : 939.1843017293486, - "beta0" : -0.004175839320854598, - "beta1" : 0.10000001690713503, - "beta2" : 1499.9999518564662, - "gamma0" : 4.942771698733528E-8, - "gamma1" : -24.212743236178344, - "gamma2" : 30.888563672619433, - "s1" : 0.1711463096494123, - "s2" : 1.0, - "xc" : 113.28928417238498, - "xt" : 1.5995294981138386, - "q" : 999.9804220950298, - "snrThresholdAboveNoiseLog10" : 0.5, - "minWindowLengthSec" : 50.0, - "maxWindowLengthSec" : 550.0, - "measurementTimeSec" : 100.0, - "lowFreqHz" : 0.2, - "highFreqHz" : 0.3 - }, { - "velocity0" : 2.6582584143999735, - "velocity1" : 29.096740128721187, - "velocity2" : 35.385321733851384, - "beta0" : -0.005246703727129597, - "beta1" : 0.10000000229481049, - "beta2" : 1499.999973385328, - "gamma0" : 3.2401299507210657E-6, - "gamma1" : -23.1149177695392, - "gamma2" : 27.326833270974674, - "s1" : 1.147392540572914E-10, - "s2" : 1.0, - "xc" : 883.6781306436754, - "xt" : 12.487210341997631, - "q" : 51.37999512177607, - "snrThresholdAboveNoiseLog10" : 0.5, - "minWindowLengthSec" : 50.0, - "maxWindowLengthSec" : 500.0, - "measurementTimeSec" : 100.0, - "lowFreqHz" : 0.3, - "highFreqHz" : 0.5 - }, { - "velocity0" : 3.424187598682965, - "velocity1" : 185.91214453963065, - "velocity2" : 114.20220746778973, - "beta0" : 1.3940488706842537E-4, - "beta1" : 11.77806131594984, - "beta2" : 1499.999984877897, - "gamma0" : 0.07558742771840413, - "gamma1" : -20.170202314802992, - "gamma2" : 27.40736797958633, - "s1" : 0.04218057670758441, - "s2" : 1.0, - "xc" : 489.4260664757258, - "xt" : 1.0000002304160365, - "q" : 62.23946380132334, - "snrThresholdAboveNoiseLog10" : 0.5, - "minWindowLengthSec" : 50.0, - "maxWindowLengthSec" : 500.0, - "measurementTimeSec" : 100.0, - "lowFreqHz" : 0.5, - "highFreqHz" : 0.7 - }, { - "velocity0" : 3.1484252720928185, - "velocity1" : 103.19064353442396, - "velocity2" : 72.25179573082997, - "beta0" : -0.00895410318480751, - "beta1" : 0.10000000001650736, - "beta2" : 34.38320821125805, - "gamma0" : 0.10466314712084354, - "gamma1" : -28.436086196987635, - "gamma2" : 42.6594291459471, - "s1" : 5.574270382949618E-10, - "s2" : 1.0, - "xc" : 117.94832818333444, - "xt" : 12.487520816805022, - "q" : 144.80835638965607, - "snrThresholdAboveNoiseLog10" : 0.5, - "minWindowLengthSec" : 40.0, - "maxWindowLengthSec" : 450.0, - "measurementTimeSec" : 100.0, - "lowFreqHz" : 0.7, - "highFreqHz" : 1.0 - }, { - "velocity0" : 3.1871965607394532, - "velocity1" : 60.84123624130058, - "velocity2" : 44.5450866988864, - "beta0" : -0.010690780884884458, - "beta1" : 0.10000000005861766, - "beta2" : 34.18597196497762, - "gamma0" : 1.1561659992629855E-5, - "gamma1" : -76.08312782780655, - "gamma2" : 83.2787728000889, - "s1" : 0.05982459883796033, - "s2" : 1.0, - "xc" : 403.37390279425847, - "xt" : 1.0066829350067572, - "q" : 111.33076150543297, - "snrThresholdAboveNoiseLog10" : 0.5, - "minWindowLengthSec" : 40.0, - "maxWindowLengthSec" : 450.0, - "measurementTimeSec" : 100.0, - "lowFreqHz" : 1.0, - "highFreqHz" : 1.5 - }, { - "velocity0" : 3.445744732034482, - "velocity1" : 90.60326839569474, - "velocity2" : 53.23933019996416, - "beta0" : -0.011431401207615583, - "beta1" : 0.189077244494572, - "beta2" : 51.087258638521114, - "gamma0" : 0.04459594451011774, - "gamma1" : -89.9472306442939, - "gamma2" : 100.99076597016023, - "s1" : 0.2785755236977024, - "s2" : 1.0, - "xc" : 101.86967576854201, - "xt" : 1.000000019102354, - "q" : 347.93914682411844, - "snrThresholdAboveNoiseLog10" : 0.5, - "minWindowLengthSec" : 40.0, - "maxWindowLengthSec" : 400.0, - "measurementTimeSec" : 100.0, - "lowFreqHz" : 1.5, - "highFreqHz" : 2.0 - }, { - "velocity0" : 3.8262114550896573, - "velocity1" : 174.34437074254672, - "velocity2" : 88.15119853820705, - "beta0" : -0.01357675405954652, - "beta1" : 0.10000000000514343, - "beta2" : 22.902337951411983, - "gamma0" : 5.564472652805369E-6, - "gamma1" : -96.0663055058496, - "gamma2" : 96.61774665652783, - "s1" : 0.11305313929878484, - "s2" : 1.0, - "xc" : 344.5547056142478, - "xt" : 1.000000004123145, - "q" : 221.77034329091265, - "snrThresholdAboveNoiseLog10" : 0.5, - "minWindowLengthSec" : 40.0, - "maxWindowLengthSec" : 400.0, - "measurementTimeSec" : 100.0, - "lowFreqHz" : 2.0, - "highFreqHz" : 3.0 - }, { - "velocity0" : 3.8782646623499617, - "velocity1" : 168.21550156404814, - "velocity2" : 84.21659025075162, - "beta0" : -0.014880766379389511, - "beta1" : 0.2844366087235525, - "beta2" : 45.80322774590515, - "gamma0" : 0.10620059549237823, - "gamma1" : -79.69271146229846, - "gamma2" : 100.99877083139381, - "s1" : 0.2617522614682076, - "s2" : 1.0, - "xc" : 85.6051766691948, - "xt" : 1.535308170661418, - "q" : 495.404564810097, - "snrThresholdAboveNoiseLog10" : 0.5, - "minWindowLengthSec" : 40.0, - "maxWindowLengthSec" : 400.0, - "measurementTimeSec" : 100.0, - "lowFreqHz" : 3.0, - "highFreqHz" : 4.0 - }, { - "velocity0" : 3.958280013312457, - "velocity1" : 194.51918732633973, - "velocity2" : 96.54473920063424, - "beta0" : -0.020686983643045494, - "beta1" : 0.1309373832265403, - "beta2" : 32.04253705454344, - "gamma0" : 0.3144405666373449, - "gamma1" : -19.03122760113236, - "gamma2" : 24.151849122942966, - "s1" : 0.277753606986424, - "s2" : 1.0, - "xc" : 85.94949412793703, - "xt" : 1.3344631825811466, - "q" : 469.26257603684644, - "snrThresholdAboveNoiseLog10" : 0.5, - "minWindowLengthSec" : 40.0, - "maxWindowLengthSec" : 400.0, - "measurementTimeSec" : 100.0, - "lowFreqHz" : 4.0, - "highFreqHz" : 6.0 - }, { - "velocity0" : 3.6058863577396933, - "velocity1" : 82.07369413442049, - "velocity2" : 45.281765148512974, - "beta0" : -0.028703436331740502, - "beta1" : 0.10000000084663817, - "beta2" : 1499.9999926932783, - "gamma0" : 1.8660183494089397E-5, - "gamma1" : -62.77023598360952, - "gamma2" : 67.3582690134521, - "s1" : 0.2491212638403199, - "s2" : 1.0, - "xc" : 711.3745890221786, - "xt" : 10.652970554311345, - "q" : 370.0348041515178, - "snrThresholdAboveNoiseLog10" : 0.5, - "minWindowLengthSec" : 40.0, - "maxWindowLengthSec" : 350.0, - "measurementTimeSec" : 100.0, - "lowFreqHz" : 6.0, - "highFreqHz" : 8.0 - }, { - "velocity0" : 3.648933773297847, - "velocity1" : 86.89402301830341, - "velocity2" : 48.9068943836867, - "beta0" : -0.03629576387761958, - "beta1" : 0.10000000243786925, - "beta2" : 1499.999998068444, - "gamma0" : 9.741914406850537E-6, - "gamma1" : -41.75371454446225, - "gamma2" : 49.011358538069295, - "s1" : 1.9575911074819298E-8, - "s2" : 1.0, - "xc" : 79.75202569864227, - "xt" : 12.487495425549598, - "q" : 458.84527656481146, - "snrThresholdAboveNoiseLog10" : 0.5, - "minWindowLengthSec" : 20.0, - "maxWindowLengthSec" : 350.0, - "measurementTimeSec" : 100.0, - "lowFreqHz" : 8.0, - "highFreqHz" : 10.0 - }, { - "velocity0" : 3.4811151205495126, - "velocity1" : 53.28770492439687, - "velocity2" : 29.84929131393643, - "beta0" : -0.04099143730044818, - "beta1" : 0.10000000030153681, - "beta2" : 1499.9999978935668, - "gamma0" : 9.27886855366605E-6, - "gamma1" : -33.169704832860056, - "gamma2" : 42.1289056183459, - "s1" : 8.626150925777366E-6, - "s2" : 1.0, - "xc" : 52.63753983603881, - "xt" : 5.742960491902131, - "q" : 600.7560095464406, - "snrThresholdAboveNoiseLog10" : 1.0, - "minWindowLengthSec" : 20.0, - "maxWindowLengthSec" : 350.0, - "measurementTimeSec" : 100.0, - "lowFreqHz" : 10.0, - "highFreqHz" : 15.0 - }, { - "velocity0" : 3.234189654108328, - "velocity1" : 11.072238528959593, - "velocity2" : 4.049550298137772, - "beta0" : -0.04802072252145412, - "beta1" : 0.10000000103192104, - "beta2" : 1499.999999820308, - "gamma0" : 1.3562201418273849E-6, - "gamma1" : -13.08861775922687, - "gamma2" : 10.168463513925552, - "s1" : 8.382521592506749E-7, - "s2" : 1.0, - "xc" : 59.77947385049096, - "xt" : 2.2905769664793296, - "q" : 786.2244103219438, - "snrThresholdAboveNoiseLog10" : 1.0, - "minWindowLengthSec" : 20.0, - "maxWindowLengthSec" : 350.0, - "measurementTimeSec" : 100.0, - "lowFreqHz" : 15.0, - "highFreqHz" : 20.0 - }, { - "velocity0" : 3.3116918442361136, - "velocity1" : 10.4338681303174, - "velocity2" : 3.7108860815265134, - "beta0" : -0.03047562357665207, - "beta1" : 19.999999994844586, - "beta2" : 1206.613412411262, - "gamma0" : 3.0531158824862772E-6, - "gamma1" : -14.14328523965259, - "gamma2" : 11.106103991501657, - "s1" : 1.4591814609487062E-8, - "s2" : 1.0, - "xc" : 152.19283386367925, - "xt" : 1.0995398238802487, - "q" : 999.9999834938094, - "snrThresholdAboveNoiseLog10" : 1.0, - "minWindowLengthSec" : 20.0, - "maxWindowLengthSec" : 350.0, - "measurementTimeSec" : 100.0, - "lowFreqHz" : 20.0, - "highFreqHz" : 25.0 + { + "id": -14, + "version": 1, + "velocity0": 3.605886359037728, + "velocity1": 82.07369553995687, + "velocity2": 45.28176570926518, + "beta0": -0.02863025934803831, + "beta1": 0.10000000411484503, + "beta2": 1499.9999865509567, + "gamma0": 0.12259766042435719, + "gamma1": -31.983283089099697, + "gamma2": 32.05240144569115, + "p1": 0.12713462297467557, + "xc": 513.7600768405479, + "xt": 2.358103886080996, + "q": 326.73295494109794, + "s2": 1.0, + "snrThresholdAboveNoiseLog10": 0.5, + "minWindowLengthSec": 40.0, + "maxWindowLengthSec": 350.0, + "measurementTimeSec": 100.0, + "highFreqHz": 8.0, + "lowFreqHz": 6.0 + }, + { + "id": -13, + "version": 1, + "velocity0": 3.958280061903103, + "velocity1": 194.51920327852358, + "velocity2": 96.54474584925065, + "beta0": -0.019885737674648463, + "beta1": 0.2385744860103528, + "beta2": 63.006447552841024, + "gamma0": 0.3978048856069531, + "gamma1": -10.10920860044729, + "gamma2": 8.52446739643306, + "p1": 0.09010585557555777, + "xc": 512.3903868609173, + "xt": 1.2123340496441286, + "q": 284.3390695152833, + "s2": 1.0, + "snrThresholdAboveNoiseLog10": 0.5, + "minWindowLengthSec": 40.0, + "maxWindowLengthSec": 400.0, + "measurementTimeSec": 100.0, + "highFreqHz": 6.0, + "lowFreqHz": 4.0 + }, + { + "id": -12, + "version": 1, + "velocity0": 3.878264621076888, + "velocity1": 168.2154870032264, + "velocity2": 84.21658317977594, + "beta0": -0.014195278135188786, + "beta1": 0.526648284192494, + "beta2": 97.28956924442817, + "gamma0": 0.24584673469434606, + "gamma1": -36.657886749016015, + "gamma2": 45.520024320392544, + "p1": 0.10091935090845403, + "xc": 473.4142159753189, + "xt": 1.042828251857678, + "q": 254.2897444520961, + "s2": 1.0, + "snrThresholdAboveNoiseLog10": 0.5, + "minWindowLengthSec": 40.0, + "maxWindowLengthSec": 400.0, + "measurementTimeSec": 100.0, + "highFreqHz": 4.0, + "lowFreqHz": 3.0 + }, + { + "id": -11, + "version": 1, + "velocity0": 3.82621147456741, + "velocity1": 174.34437883419153, + "velocity2": 88.15120227247967, + "beta0": -0.013676962680724295, + "beta1": 0.10000000009260723, + "beta2": 46.566007538937136, + "gamma0": 2.745976156353247e-5, + "gamma1": -87.73109918892773, + "gamma2": 77.93080516540333, + "p1": 0.13280739986161094, + "xc": 291.0374340411797, + "xt": 1.2859513461492091, + "q": 227.2252994198447, + "s2": 1.0, + "snrThresholdAboveNoiseLog10": 0.5, + "minWindowLengthSec": 40.0, + "maxWindowLengthSec": 400.0, + "measurementTimeSec": 100.0, + "highFreqHz": 3.0, + "lowFreqHz": 2.0 + }, + { + "id": -10, + "version": 1, + "velocity0": 3.445744739914094, + "velocity1": 90.60327010979348, + "velocity2": 53.23933099439042, + "beta0": -0.007783921348944497, + "beta1": 2.28756946013999, + "beta2": 392.1174825845847, + "gamma0": 0.34073358831969924, + "gamma1": -17.644497344480616, + "gamma2": 15.010409741541332, + "p1": 0.07001114940363264, + "xc": 266.3958356563209, + "xt": 1.1862525140023197, + "q": 155.89084264960675, + "s2": 1.0, + "snrThresholdAboveNoiseLog10": 0.5, + "minWindowLengthSec": 40.0, + "maxWindowLengthSec": 400.0, + "measurementTimeSec": 100.0, + "highFreqHz": 2.0, + "lowFreqHz": 1.5 + }, + { + "id": -9, + "version": 1, + "velocity0": 3.187196549120382, + "velocity1": 60.84123302961735, + "velocity2": 44.54508415939158, + "beta0": -0.010532305297570151, + "beta1": 0.10000000010491536, + "beta2": 38.03771819255894, + "gamma0": 0.08256069298183126, + "gamma1": -54.910891672246365, + "gamma2": 59.06606243546043, + "p1": 0.08763128820708894, + "xc": 344.3604661274263, + "xt": 4.1299666974465525, + "q": 124.10940769755926, + "s2": 1.0, + "snrThresholdAboveNoiseLog10": 0.5, + "minWindowLengthSec": 40.0, + "maxWindowLengthSec": 450.0, + "measurementTimeSec": 100.0, + "highFreqHz": 1.5, + "lowFreqHz": 1.0 + }, + { + "id": -8, + "version": 1, + "velocity0": 3.1484252662151606, + "velocity1": 103.19063909179188, + "velocity2": 72.2517918984052, + "beta0": -0.008501531669392418, + "beta1": 0.12039992275620347, + "beta2": 34.79222456635759, + "gamma0": 0.17906011264542593, + "gamma1": -19.26118486074224, + "gamma2": 30.803807722845278, + "p1": 8.201477370705384e-6, + "xc": 276.9888972879342, + "xt": 1.0000046805986647, + "q": 73.29534328387876, + "s2": 1.0, + "snrThresholdAboveNoiseLog10": 0.5, + "minWindowLengthSec": 40.0, + "maxWindowLengthSec": 450.0, + "measurementTimeSec": 100.0, + "highFreqHz": 1.0, + "lowFreqHz": 0.7 + }, + { + "id": -7, + "version": 1, + "velocity0": 3.424187621189276, + "velocity1": 185.91214921242752, + "velocity2": 114.20220851291623, + "beta0": 0.0036798618750857985, + "beta1": 16.810153183574002, + "beta2": 1499.9999937548184, + "gamma0": 0.14999400405720878, + "gamma1": -13.731437059253322, + "gamma2": 19.624585569662834, + "p1": 0.05012485152369658, + "xc": 279.5311382849794, + "xt": 1.2287917346220079, + "q": 63.338295636065325, + "s2": 1.0, + "snrThresholdAboveNoiseLog10": 0.5, + "minWindowLengthSec": 50.0, + "maxWindowLengthSec": 500.0, + "measurementTimeSec": 100.0, + "highFreqHz": 0.7, + "lowFreqHz": 0.5 + }, + { + "id": -6, + "version": 1, + "velocity0": 2.6582584294808815, + "velocity1": 29.09674274758375, + "velocity2": 35.385323320324154, + "beta0": -0.002042321928413604, + "beta1": 4.576818101101118, + "beta2": 1499.9999962905592, + "gamma0": 0.06916167582414409, + "gamma1": -18.70236601952289, + "gamma2": 24.316994610335488, + "p1": 0.025346269423031424, + "xc": 687.4963799621962, + "xt": 12.410108269606933, + "q": 57.67993476806547, + "s2": 1.0, + "snrThresholdAboveNoiseLog10": 0.5, + "minWindowLengthSec": 50.0, + "maxWindowLengthSec": 500.0, + "measurementTimeSec": 100.0, + "highFreqHz": 0.5, + "lowFreqHz": 0.3 + }, + { + "id": -5, + "version": 1, + "velocity0": 4.57584459850611, + "velocity1": 2331.894308548421, + "velocity2": 939.1833057183011, + "beta0": -0.004010104037076954, + "beta1": 0.10000000916630024, + "beta2": 1499.9999940687812, + "gamma0": 1.6844191181829977e-6, + "gamma1": -30.016525912103287, + "gamma2": 41.953493374613466, + "p1": 0.1776358368481852, + "xc": 113.98924117498026, + "xt": 1.594494713133902, + "q": 999.9834020277688, + "s2": 1.0, + "snrThresholdAboveNoiseLog10": 0.5, + "minWindowLengthSec": 50.0, + "maxWindowLengthSec": 550.0, + "measurementTimeSec": 100.0, + "highFreqHz": 0.3, + "lowFreqHz": 0.2 + }, + { + "id": -4, + "version": 0, + "velocity0": 0.0, + "velocity1": 0.0, + "velocity2": 0.0, + "beta0": 0.0, + "beta1": 0.0, + "beta2": 0.0, + "gamma0": 0.0, + "gamma1": 0.0, + "gamma2": 0.0, + "p1": 0.0, + "xc": 0.0, + "xt": 0.0, + "q": 0.0, + "s2": 0.0, + "snrThresholdAboveNoiseLog10": 0.5, + "minWindowLengthSec": 75.0, + "maxWindowLengthSec": 550.0, + "measurementTimeSec": 100.0, + "highFreqHz": 0.2, + "lowFreqHz": 0.1 + }, + { + "id": -3, + "version": 0, + "velocity0": 0.0, + "velocity1": 0.0, + "velocity2": 0.0, + "beta0": 0.0, + "beta1": 0.0, + "beta2": 0.0, + "gamma0": 0.0, + "gamma1": 0.0, + "gamma2": 0.0, + "p1": 0.0, + "xc": 0.0, + "xt": 0.0, + "q": 0.0, + "s2": 0.0, + "snrThresholdAboveNoiseLog10": 0.5, + "minWindowLengthSec": 75.0, + "maxWindowLengthSec": 600.0, + "measurementTimeSec": 100.0, + "highFreqHz": 0.1, + "lowFreqHz": 0.05 + }, + { + "id": -2, + "version": 0, + "velocity0": 0.0, + "velocity1": 0.0, + "velocity2": 0.0, + "beta0": 0.0, + "beta1": 0.0, + "beta2": 0.0, + "gamma0": 0.0, + "gamma1": 0.0, + "gamma2": 0.0, + "p1": 0.0, + "xc": 0.0, + "xt": 0.0, + "q": 0.0, + "s2": 0.0, + "snrThresholdAboveNoiseLog10": 0.5, + "minWindowLengthSec": 100.0, + "maxWindowLengthSec": 800.0, + "measurementTimeSec": 100.0, + "highFreqHz": 0.05, + "lowFreqHz": 0.03 + }, + { + "id": -1, + "version": 0, + "velocity0": 0.0, + "velocity1": 0.0, + "velocity2": 0.0, + "beta0": 0.0, + "beta1": 0.0, + "beta2": 0.0, + "gamma0": 0.0, + "gamma1": 0.0, + "gamma2": 0.0, + "p1": 0.0, + "xc": 0.0, + "xt": 0.0, + "q": 0.0, + "s2": 0.0, + "snrThresholdAboveNoiseLog10": 0.5, + "minWindowLengthSec": 100.0, + "maxWindowLengthSec": 1000.0, + "measurementTimeSec": 100.0, + "highFreqHz": 0.03, + "lowFreqHz": 0.02 + }, + { + "id": 86, + "version": 0, + "velocity0": 3.6489337781300706, + "velocity1": 86.8940253397213, + "velocity2": 48.906895733411226, + "beta0": -0.03588613311103974, + "beta1": 0.10000000017068078, + "beta2": 1499.9999973058318, + "gamma0": 6.800341826940244e-6, + "gamma1": -40.72711405453105, + "gamma2": 43.43025180063787, + "p1": 4.58782658203706e-6, + "xc": 92.7634765363034, + "xt": 12.487546307866914, + "q": 458.4561904332226, + "s2": 1.0, + "snrThresholdAboveNoiseLog10": 0.5, + "minWindowLengthSec": 20.0, + "maxWindowLengthSec": 350.0, + "measurementTimeSec": 100.0, + "highFreqHz": 10.0, + "lowFreqHz": 8.0 + }, + { + "id": 87, + "version": 0, + "velocity0": 3.311691852212257, + "velocity1": 10.433868075668158, + "velocity2": 3.7108860515631292, + "beta0": -0.043516432416574, + "beta1": 0.10000000145792218, + "beta2": 1499.9999962716763, + "gamma0": 5.485215951556501e-7, + "gamma1": -16.876824517104183, + "gamma2": 11.298680613531783, + "p1": 5.512857433021127e-8, + "xc": 138.01356900779493, + "xt": 1.0000000131155993, + "q": 970.3406385916056, + "s2": 1.0, + "snrThresholdAboveNoiseLog10": 1.0, + "minWindowLengthSec": 20.0, + "maxWindowLengthSec": 350.0, + "measurementTimeSec": 100.0, + "highFreqHz": 25.0, + "lowFreqHz": 20.0 + }, + { + "id": 88, + "version": 0, + "velocity0": 3.234189657957281, + "velocity1": 11.072238426762082, + "velocity2": 4.049550255059621, + "beta0": -0.04783592014109169, + "beta1": 0.10000000007953314, + "beta2": 1499.999999304902, + "gamma0": 1.856229493013388e-6, + "gamma1": -12.757674944524416, + "gamma2": 7.975319246307504, + "p1": 3.890095647252871e-6, + "xc": 53.92486708032039, + "xt": 1.0000386197021935, + "q": 863.4141812125026, + "s2": 1.0, + "snrThresholdAboveNoiseLog10": 1.0, + "minWindowLengthSec": 20.0, + "maxWindowLengthSec": 350.0, + "measurementTimeSec": 100.0, + "highFreqHz": 20.0, + "lowFreqHz": 15.0 + }, + { + "id": 89, + "version": 0, + "velocity0": 3.4811151262418285, + "velocity1": 53.28770369491077, + "velocity2": 29.849290101025293, + "beta0": -0.04057442595075646, + "beta1": 0.10000000047130238, + "beta2": 1499.9999997389825, + "gamma0": 8.603151818797824e-6, + "gamma1": -29.453909637724063, + "gamma2": 31.254487217803234, + "p1": 2.8939150790838767e-6, + "xc": 252.471255118309, + "xt": 1.000042790340864, + "q": 428.3018163400325, + "s2": 1.0, + "snrThresholdAboveNoiseLog10": 1.0, + "minWindowLengthSec": 20.0, + "maxWindowLengthSec": 350.0, + "measurementTimeSec": 100.0, + "highFreqHz": 15.0, + "lowFreqHz": 10.0 } ] \ No newline at end of file diff --git a/example-notebooks/measure-mws/norcal_site.json b/example-notebooks/measure-mws/norcal_site.json index 0a175b2e..8127d5a2 100644 --- a/example-notebooks/measure-mws/norcal_site.json +++ b/example-notebooks/measure-mws/norcal_site.json @@ -1,926 +1,1010 @@ [ - { - "lowFreqHz": 0.2, - "highFreqHz": 0.3, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "SAO" - }, - "siteTerm": 19.160301172988373 - }, - { - "lowFreqHz": 0.3, - "highFreqHz": 0.5, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "SAO" - }, - "siteTerm": 19.078495953084072 - }, - { - "lowFreqHz": 0.5, - "highFreqHz": 0.7, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "SAO" - }, - "siteTerm": 19.00135341977889 - }, - { - "lowFreqHz": 0.7, - "highFreqHz": 1.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "SAO" - }, - "siteTerm": 19.03492718945587 - }, - { - "lowFreqHz": 1.0, - "highFreqHz": 1.5, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "SAO" - }, - "siteTerm": 18.94226636451329 - }, - { - "lowFreqHz": 1.5, - "highFreqHz": 2.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "SAO" - }, - "siteTerm": 18.92723226138862 - }, - { - "lowFreqHz": 2.0, - "highFreqHz": 3.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "SAO" - }, - "siteTerm": 19.184367156400697 - }, - { - "lowFreqHz": 3.0, - "highFreqHz": 4.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "SAO" - }, - "siteTerm": 19.14718589386693 - }, - { - "lowFreqHz": 4.0, - "highFreqHz": 6.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "SAO" - }, - "siteTerm": 19.211116316565025 - }, - { - "lowFreqHz": 6.0, - "highFreqHz": 8.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "SAO" - }, - "siteTerm": 19.57881986308872 - }, - { - "lowFreqHz": 8.0, - "highFreqHz": 10.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "SAO" - }, - "siteTerm": 20.164195454405423 - }, - { - "lowFreqHz": 10.0, - "highFreqHz": 15.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "SAO" - }, - "siteTerm": 20.325371990356185 - }, - { - "lowFreqHz": 15.0, - "highFreqHz": 20.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "SAO" - }, - "siteTerm": 21.24328806924078 - }, - { - "lowFreqHz": 20.0, - "highFreqHz": 25.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "SAO" - }, - "siteTerm": 21.48709133874192 - }, - { - "lowFreqHz": 0.2, - "highFreqHz": 0.3, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "CVS" - }, - "siteTerm": 18.99512062088609 - }, - { - "lowFreqHz": 0.3, - "highFreqHz": 0.5, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "CVS" - }, - "siteTerm": 18.712207283591184 - }, - { - "lowFreqHz": 0.5, - "highFreqHz": 0.7, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "CVS" - }, - "siteTerm": 18.688751493057524 - }, - { - "lowFreqHz": 0.7, - "highFreqHz": 1.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "CVS" - }, - "siteTerm": 18.84134477372329 - }, - { - "lowFreqHz": 1.0, - "highFreqHz": 1.5, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "CVS" - }, - "siteTerm": 18.891154656359777 - }, - { - "lowFreqHz": 1.5, - "highFreqHz": 2.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "CVS" - }, - "siteTerm": 18.82400240637313 - }, - { - "lowFreqHz": 2.0, - "highFreqHz": 3.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "CVS" - }, - "siteTerm": 18.949633953462328 - }, - { - "lowFreqHz": 3.0, - "highFreqHz": 4.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "CVS" - }, - "siteTerm": 18.961351413110204 - }, - { - "lowFreqHz": 4.0, - "highFreqHz": 6.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "CVS" - }, - "siteTerm": 19.06547621563001 - }, - { - "lowFreqHz": 6.0, - "highFreqHz": 8.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "CVS" - }, - "siteTerm": 19.591903909961985 - }, - { - "lowFreqHz": 8.0, - "highFreqHz": 10.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "CVS" - }, - "siteTerm": 20.181175758798673 - }, - { - "lowFreqHz": 10.0, - "highFreqHz": 15.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "CVS" - }, - "siteTerm": 20.371678739288434 - }, - { - "lowFreqHz": 15.0, - "highFreqHz": 20.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "CVS" - }, - "siteTerm": 21.34581922180849 - }, - { - "lowFreqHz": 20.0, - "highFreqHz": 25.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "CVS" - }, - "siteTerm": 21.607084224674125 - }, - { - "lowFreqHz": 0.2, - "highFreqHz": 0.3, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "WENL" - }, - "siteTerm": 18.736694993008697 - }, - { - "lowFreqHz": 0.3, - "highFreqHz": 0.5, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "WENL" - }, - "siteTerm": 18.6085082031463 - }, - { - "lowFreqHz": 0.5, - "highFreqHz": 0.7, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "WENL" - }, - "siteTerm": 18.580578107370048 - }, - { - "lowFreqHz": 0.7, - "highFreqHz": 1.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "WENL" - }, - "siteTerm": 18.661130492426334 - }, - { - "lowFreqHz": 1.0, - "highFreqHz": 1.5, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "WENL" - }, - "siteTerm": 18.587026724834214 - }, - { - "lowFreqHz": 1.5, - "highFreqHz": 2.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "WENL" - }, - "siteTerm": 18.495225296106195 - }, - { - "lowFreqHz": 2.0, - "highFreqHz": 3.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "WENL" - }, - "siteTerm": 18.802400569430816 - }, - { - "lowFreqHz": 3.0, - "highFreqHz": 4.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "WENL" - }, - "siteTerm": 19.062474655337304 - }, - { - "lowFreqHz": 4.0, - "highFreqHz": 6.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "WENL" - }, - "siteTerm": 19.293388411261628 - }, - { - "lowFreqHz": 6.0, - "highFreqHz": 8.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "WENL" - }, - "siteTerm": 19.927795134546052 - }, - { - "lowFreqHz": 8.0, - "highFreqHz": 10.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "WENL" - }, - "siteTerm": 20.71777025105482 - }, - { - "lowFreqHz": 10.0, - "highFreqHz": 15.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "WENL" - }, - "siteTerm": 20.95605674566051 - }, - { - "lowFreqHz": 15.0, - "highFreqHz": 20.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "WENL" - }, - "siteTerm": 21.977061937887687 - }, - { - "lowFreqHz": 20.0, - "highFreqHz": 25.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "WENL" - }, - "siteTerm": 22.434419365054662 - }, - { - "lowFreqHz": 0.2, - "highFreqHz": 0.3, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "MHC" - }, - "siteTerm": 19.16939859693607 - }, - { - "lowFreqHz": 0.3, - "highFreqHz": 0.5, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "MHC" - }, - "siteTerm": 19.017950318784074 - }, - { - "lowFreqHz": 0.5, - "highFreqHz": 0.7, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "MHC" - }, - "siteTerm": 19.009162895220566 - }, - { - "lowFreqHz": 0.7, - "highFreqHz": 1.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "MHC" - }, - "siteTerm": 19.092002502327013 - }, - { - "lowFreqHz": 1.0, - "highFreqHz": 1.5, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "MHC" - }, - "siteTerm": 19.003217210334803 - }, - { - "lowFreqHz": 1.5, - "highFreqHz": 2.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "MHC" - }, - "siteTerm": 18.82289301772976 - }, - { - "lowFreqHz": 2.0, - "highFreqHz": 3.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "MHC" - }, - "siteTerm": 18.971415371018573 - }, - { - "lowFreqHz": 3.0, - "highFreqHz": 4.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "MHC" - }, - "siteTerm": 19.04471931436847 - }, - { - "lowFreqHz": 4.0, - "highFreqHz": 6.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "MHC" - }, - "siteTerm": 19.18005864178982 - }, - { - "lowFreqHz": 6.0, - "highFreqHz": 8.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "MHC" - }, - "siteTerm": 19.699135341247306 - }, - { - "lowFreqHz": 8.0, - "highFreqHz": 10.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "MHC" - }, - "siteTerm": 20.567061588389226 - }, - { - "lowFreqHz": 10.0, - "highFreqHz": 15.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "MHC" - }, - "siteTerm": 20.881575622400995 - }, - { - "lowFreqHz": 15.0, - "highFreqHz": 20.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "MHC" - }, - "siteTerm": 21.583272275826253 - }, - { - "lowFreqHz": 20.0, - "highFreqHz": 25.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "MHC" - }, - "siteTerm": 21.71934534466365 - }, - { - "lowFreqHz": 0.2, - "highFreqHz": 0.3, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "BRK" - }, - "siteTerm": 19.04877726147648 - }, - { - "lowFreqHz": 0.3, - "highFreqHz": 0.5, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "BRK" - }, - "siteTerm": 18.94587417634078 - }, - { - "lowFreqHz": 0.5, - "highFreqHz": 0.7, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "BRK" - }, - "siteTerm": 18.9446945401333 - }, - { - "lowFreqHz": 0.7, - "highFreqHz": 1.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "BRK" - }, - "siteTerm": 19.130348029868408 - }, - { - "lowFreqHz": 1.0, - "highFreqHz": 1.5, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "BRK" - }, - "siteTerm": 19.132496348352337 - }, - { - "lowFreqHz": 1.5, - "highFreqHz": 2.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "BRK" - }, - "siteTerm": 18.99038581312458 - }, - { - "lowFreqHz": 2.0, - "highFreqHz": 3.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "BRK" - }, - "siteTerm": 19.095240446941464 - }, - { - "lowFreqHz": 3.0, - "highFreqHz": 4.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "BRK" - }, - "siteTerm": 19.086051904658667 - }, - { - "lowFreqHz": 4.0, - "highFreqHz": 6.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "BRK" - }, - "siteTerm": 19.21581849365575 - }, - { - "lowFreqHz": 6.0, - "highFreqHz": 8.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "BRK" - }, - "siteTerm": 19.47267090338083 - }, - { - "lowFreqHz": 8.0, - "highFreqHz": 10.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "BRK" - }, - "siteTerm": 20.214852088102568 - }, - { - "lowFreqHz": 10.0, - "highFreqHz": 15.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "BRK" - }, - "siteTerm": 20.308757170743476 - }, - { - "lowFreqHz": 15.0, - "highFreqHz": 20.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "BRK" - }, - "siteTerm": 21.204031822475724 - }, - { - "lowFreqHz": 20.0, - "highFreqHz": 25.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "BRK" - }, - "siteTerm": 21.488165687721498 - }, - { - "lowFreqHz": 0.2, - "highFreqHz": 0.3, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "BKS" - }, - "siteTerm": 18.870102595771428 - }, - { - "lowFreqHz": 0.3, - "highFreqHz": 0.5, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "BKS" - }, - "siteTerm": 18.803226473636485 - }, - { - "lowFreqHz": 0.5, - "highFreqHz": 0.7, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "BKS" - }, - "siteTerm": 18.806428510906798 - }, - { - "lowFreqHz": 0.7, - "highFreqHz": 1.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "BKS" - }, - "siteTerm": 18.973413963390275 - }, - { - "lowFreqHz": 1.0, - "highFreqHz": 1.5, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "BKS" - }, - "siteTerm": 18.794734140992663 - }, - { - "lowFreqHz": 1.5, - "highFreqHz": 2.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "BKS" - }, - "siteTerm": 18.76183221756704 - }, - { - "lowFreqHz": 2.0, - "highFreqHz": 3.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "BKS" - }, - "siteTerm": 18.94993618865584 - }, - { - "lowFreqHz": 3.0, - "highFreqHz": 4.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "BKS" - }, - "siteTerm": 18.991833402259537 - }, - { - "lowFreqHz": 4.0, - "highFreqHz": 6.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "BKS" - }, - "siteTerm": 19.162600501197556 - }, - { - "lowFreqHz": 6.0, - "highFreqHz": 8.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "BKS" - }, - "siteTerm": 19.83031072662833 - }, - { - "lowFreqHz": 8.0, - "highFreqHz": 10.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "BKS" - }, - "siteTerm": 20.602040969603 - }, - { - "lowFreqHz": 10.0, - "highFreqHz": 15.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "BKS" - }, - "siteTerm": 20.72615229242341 - }, - { - "lowFreqHz": 15.0, - "highFreqHz": 20.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "BKS" - }, - "siteTerm": 21.538993894177555 - }, - { - "lowFreqHz": 20.0, - "highFreqHz": 25.0, - "station": { - "networkName": "BK", - "latitude": 0.0, - "longitude": 0.0, - "stationName": "BKS" - }, - "siteTerm": 22.061618316796142 - } -] \ No newline at end of file + { + "siteTerm": 19.18066499943507, + "lowFreqHz": 0.2, + "highFreqHz": 0.3, + "station": { + "@id": "81e9856f-9ea1-4c1c-8578-650a7e252c8c", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "SAO" + } + }, + { + "siteTerm": 19.029440873759736, + "lowFreqHz": 0.3, + "highFreqHz": 0.5, + "station": { + "@id": "29ec9f7a-ba26-47dd-bf45-8dee294c139e", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "SAO" + } + }, + { + "siteTerm": 18.974059806106936, + "lowFreqHz": 0.5, + "highFreqHz": 0.7, + "station": { + "@id": "8e7e3078-0163-4f6c-8a37-f6657c9ed936", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "SAO" + } + }, + { + "siteTerm": 19.0030185018411, + "lowFreqHz": 0.7, + "highFreqHz": 1.0, + "station": { + "@id": "52d3b764-d60d-472b-836e-01c3a041c780", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "SAO" + } + }, + { + "siteTerm": 18.843801846605203, + "lowFreqHz": 1.0, + "highFreqHz": 1.5, + "station": { + "@id": "03ac4a08-3dcf-4ceb-8004-e691debc2303", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "SAO" + } + }, + { + "siteTerm": 19.08649849870715, + "lowFreqHz": 1.5, + "highFreqHz": 2.0, + "station": { + "@id": "c5fd5519-40a4-44df-93a2-ffb32e684e63", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "SAO" + } + }, + { + "siteTerm": 19.16463642858329, + "lowFreqHz": 2.0, + "highFreqHz": 3.0, + "station": { + "@id": "8f3b8c69-9508-49ed-9438-f8c2f9bd64a2", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "SAO" + } + }, + { + "siteTerm": 19.313628812243323, + "lowFreqHz": 3.0, + "highFreqHz": 4.0, + "station": { + "@id": "b92f4af4-874e-42ce-97f1-adc91d6fd671", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "SAO" + } + }, + { + "siteTerm": 19.45361030825169, + "lowFreqHz": 4.0, + "highFreqHz": 6.0, + "station": { + "@id": "9c9f7f20-dd05-46a6-8718-e6d2b89ef975", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "SAO" + } + }, + { + "siteTerm": 19.82644758985891, + "lowFreqHz": 6.0, + "highFreqHz": 8.0, + "station": { + "@id": "93e28e25-3d2e-4e00-aa1e-5cd4c2c23875", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "SAO" + } + }, + { + "siteTerm": 20.24874573251031, + "lowFreqHz": 8.0, + "highFreqHz": 10.0, + "station": { + "@id": "f29e2fc3-af7e-43c5-ae0b-16d2bb7615a2", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "SAO" + } + }, + { + "siteTerm": 20.364631486156537, + "lowFreqHz": 10.0, + "highFreqHz": 15.0, + "station": { + "@id": "eec638d8-bb3f-4eec-b723-c9290630af64", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "SAO" + } + }, + { + "siteTerm": 21.422021808796522, + "lowFreqHz": 15.0, + "highFreqHz": 20.0, + "station": { + "@id": "777d710b-f7c9-46b9-ba47-1122da8fb29f", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "SAO" + } + }, + { + "siteTerm": 21.347368088624386, + "lowFreqHz": 20.0, + "highFreqHz": 25.0, + "station": { + "@id": "7095d22f-5293-4ae1-8a71-7ed7a1cf1edc", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "SAO" + } + }, + { + "siteTerm": 19.055811226233974, + "lowFreqHz": 0.2, + "highFreqHz": 0.3, + "station": { + "@id": "2ed8b58e-a3c3-4644-a224-62b897eeace2", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "CVS" + } + }, + { + "siteTerm": 18.744069906443848, + "lowFreqHz": 0.3, + "highFreqHz": 0.5, + "station": { + "@id": "898686ea-5b44-429b-850e-2f8a479951d3", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "CVS" + } + }, + { + "siteTerm": 18.726317249095644, + "lowFreqHz": 0.5, + "highFreqHz": 0.7, + "station": { + "@id": "63b66c98-316b-45b3-b8fc-4300cbd8f982", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "CVS" + } + }, + { + "siteTerm": 18.876216037986254, + "lowFreqHz": 0.7, + "highFreqHz": 1.0, + "station": { + "@id": "f3d4560d-aea8-45d5-aed6-27d8eb8bc77e", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "CVS" + } + }, + { + "siteTerm": 18.85302781405518, + "lowFreqHz": 1.0, + "highFreqHz": 1.5, + "station": { + "@id": "0a5943e9-4572-4a0c-be1b-ff279b24b9fb", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "CVS" + } + }, + { + "siteTerm": 19.018507211944936, + "lowFreqHz": 1.5, + "highFreqHz": 2.0, + "station": { + "@id": "2834d4bd-68a4-4d0b-9a21-39f2ea52a376", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "CVS" + } + }, + { + "siteTerm": 18.957027531764563, + "lowFreqHz": 2.0, + "highFreqHz": 3.0, + "station": { + "@id": "2d642599-c113-436b-b6a5-c2064bffcb13", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "CVS" + } + }, + { + "siteTerm": 19.219808235512044, + "lowFreqHz": 3.0, + "highFreqHz": 4.0, + "station": { + "@id": "933b412a-cd73-43ec-85cb-70d0c5db0d24", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "CVS" + } + }, + { + "siteTerm": 19.411576367664487, + "lowFreqHz": 4.0, + "highFreqHz": 6.0, + "station": { + "@id": "3668cfa5-5233-4895-85b2-c48d1d0ff55a", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "CVS" + } + }, + { + "siteTerm": 19.856098086592684, + "lowFreqHz": 6.0, + "highFreqHz": 8.0, + "station": { + "@id": "661d78dc-8e1c-4107-b5ee-2259c33c6ab5", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "CVS" + } + }, + { + "siteTerm": 20.40729730787254, + "lowFreqHz": 8.0, + "highFreqHz": 10.0, + "station": { + "@id": "bba796bf-3ffd-4105-9dbd-460895839745", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "CVS" + } + }, + { + "siteTerm": 20.556805133416066, + "lowFreqHz": 10.0, + "highFreqHz": 15.0, + "station": { + "@id": "6121f86d-c787-4c3b-909c-dbeda6fce8e2", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "CVS" + } + }, + { + "siteTerm": 21.47263423537711, + "lowFreqHz": 15.0, + "highFreqHz": 20.0, + "station": { + "@id": "24daeca1-c3b9-4616-8389-7a8f3d904748", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "CVS" + } + }, + { + "siteTerm": 21.506639978755103, + "lowFreqHz": 20.0, + "highFreqHz": 25.0, + "station": { + "@id": "7f9bb6b7-4990-437d-a471-33022e8de6d1", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "CVS" + } + }, + { + "siteTerm": 18.78201915439756, + "lowFreqHz": 0.2, + "highFreqHz": 0.3, + "station": { + "@id": "a0d848c8-e2e0-436d-9b39-ef816425e58f", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "WENL" + } + }, + { + "siteTerm": 18.602669026124218, + "lowFreqHz": 0.3, + "highFreqHz": 0.5, + "station": { + "@id": "c5aa44cf-e3e0-4533-98d6-b13c0dc265f2", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "WENL" + } + }, + { + "siteTerm": 18.575861653471826, + "lowFreqHz": 0.5, + "highFreqHz": 0.7, + "station": { + "@id": "7a470a89-b6cb-4d68-8703-b1de628ad687", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "WENL" + } + }, + { + "siteTerm": 18.668796818977796, + "lowFreqHz": 0.7, + "highFreqHz": 1.0, + "station": { + "@id": "727b3a97-e872-4c96-88d1-4c61d63f8b71", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "WENL" + } + }, + { + "siteTerm": 18.546856866645324, + "lowFreqHz": 1.0, + "highFreqHz": 1.5, + "station": { + "@id": "96b75af6-5054-4f1f-8ffa-1e36a7367e4c", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "WENL" + } + }, + { + "siteTerm": 18.74345497179193, + "lowFreqHz": 1.5, + "highFreqHz": 2.0, + "station": { + "@id": "f834bf3e-31c9-4959-853f-c3ff0dfca59e", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "WENL" + } + }, + { + "siteTerm": 18.80287958211991, + "lowFreqHz": 2.0, + "highFreqHz": 3.0, + "station": { + "@id": "a7d5eebe-4c55-4a56-a507-b2c5b7e7df08", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "WENL" + } + }, + { + "siteTerm": 19.226781518189313, + "lowFreqHz": 3.0, + "highFreqHz": 4.0, + "station": { + "@id": "2b805bb1-9ecd-4207-9ebd-9b5e76e1cbc3", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "WENL" + } + }, + { + "siteTerm": 19.54083881877828, + "lowFreqHz": 4.0, + "highFreqHz": 6.0, + "station": { + "@id": "c8204709-becd-47fa-b006-395e2fe04171", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "WENL" + } + }, + { + "siteTerm": 20.203505665435856, + "lowFreqHz": 6.0, + "highFreqHz": 8.0, + "station": { + "@id": "be59c5a4-9eef-40fd-a176-ef85390d5d11", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "WENL" + } + }, + { + "siteTerm": 20.816307852087803, + "lowFreqHz": 8.0, + "highFreqHz": 10.0, + "station": { + "@id": "82265546-bc9f-4bd7-9604-a101450391f6", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "WENL" + } + }, + { + "siteTerm": 21.012688178143538, + "lowFreqHz": 10.0, + "highFreqHz": 15.0, + "station": { + "@id": "72545096-0104-47aa-b55c-d20b4b03b504", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "WENL" + } + }, + { + "siteTerm": 22.104544557686324, + "lowFreqHz": 15.0, + "highFreqHz": 20.0, + "station": { + "@id": "e015e3fe-6ae7-42b5-be29-3bf86da202aa", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "WENL" + } + }, + { + "siteTerm": 22.322886349792153, + "lowFreqHz": 20.0, + "highFreqHz": 25.0, + "station": { + "@id": "1958857e-7255-457e-8347-4455d9733dea", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "WENL" + } + }, + { + "siteTerm": 19.149716049231102, + "lowFreqHz": 0.2, + "highFreqHz": 0.3, + "station": { + "@id": "2b85120d-88cb-4b53-b8d0-106cb0caa56d", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "MHC" + } + }, + { + "siteTerm": 19.017173295329602, + "lowFreqHz": 0.3, + "highFreqHz": 0.5, + "station": { + "@id": "27308b08-6be5-45c4-ba3b-c7d6af12040f", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "MHC" + } + }, + { + "siteTerm": 19.0366637491391, + "lowFreqHz": 0.5, + "highFreqHz": 0.7, + "station": { + "@id": "faea5be0-83b8-4542-a5b7-d18113fcfadf", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "MHC" + } + }, + { + "siteTerm": 19.056554203791677, + "lowFreqHz": 0.7, + "highFreqHz": 1.0, + "station": { + "@id": "fbc85935-6a40-4430-bc75-17f2be5593c0", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "MHC" + } + }, + { + "siteTerm": 18.8818202916536, + "lowFreqHz": 1.0, + "highFreqHz": 1.5, + "station": { + "@id": "50b15022-edcd-4aee-b598-720be3c3a407", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "MHC" + } + }, + { + "siteTerm": 18.91308404113081, + "lowFreqHz": 1.5, + "highFreqHz": 2.0, + "station": { + "@id": "0bdea214-0add-4e59-8d7e-a58fa3ebbb2f", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "MHC" + } + }, + { + "siteTerm": 18.913013965196505, + "lowFreqHz": 2.0, + "highFreqHz": 3.0, + "station": { + "@id": "0c79d8dc-d859-4c6a-b116-441d6ea8ed47", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "MHC" + } + }, + { + "siteTerm": 19.22971320461257, + "lowFreqHz": 3.0, + "highFreqHz": 4.0, + "station": { + "@id": "4264b457-4e4d-445d-bc46-0ce18fd33d79", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "MHC" + } + }, + { + "siteTerm": 19.41987190647541, + "lowFreqHz": 4.0, + "highFreqHz": 6.0, + "station": { + "@id": "a662014e-5195-44be-b85d-7436118cd875", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "MHC" + } + }, + { + "siteTerm": 19.924782594395637, + "lowFreqHz": 6.0, + "highFreqHz": 8.0, + "station": { + "@id": "5e58ef13-6cde-49a4-a075-fd86cc32fd24", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "MHC" + } + }, + { + "siteTerm": 20.664550322122484, + "lowFreqHz": 8.0, + "highFreqHz": 10.0, + "station": { + "@id": "982500db-f88d-407f-afa5-ae041c224d4d", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "MHC" + } + }, + { + "siteTerm": 20.958030954522496, + "lowFreqHz": 10.0, + "highFreqHz": 15.0, + "station": { + "@id": "902c9fde-798a-40b8-8a9a-39c9362b1e70", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "MHC" + } + }, + { + "siteTerm": 21.731656773596768, + "lowFreqHz": 15.0, + "highFreqHz": 20.0, + "station": { + "@id": "f3f8f468-7481-49f5-ae15-fa43ef78bcbc", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "MHC" + } + }, + { + "siteTerm": 21.657265513878517, + "lowFreqHz": 20.0, + "highFreqHz": 25.0, + "station": { + "@id": "7062f579-cd7a-4434-b38a-1e4f4c6a2ef6", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "MHC" + } + }, + { + "siteTerm": 19.132407103959206, + "lowFreqHz": 0.2, + "highFreqHz": 0.3, + "station": { + "@id": "eddac07b-09c1-4fba-ac6b-b02184ca61c6", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "BRK" + } + }, + { + "siteTerm": 18.988271991747805, + "lowFreqHz": 0.3, + "highFreqHz": 0.5, + "station": { + "@id": "94f76d37-b10c-46bc-a105-9471fdc0a81d", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "BRK" + } + }, + { + "siteTerm": 19.01193771093575, + "lowFreqHz": 0.5, + "highFreqHz": 0.7, + "station": { + "@id": "03451526-ac0a-4864-9cb6-80b5a9e7c1b9", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "BRK" + } + }, + { + "siteTerm": 19.177830876253445, + "lowFreqHz": 0.7, + "highFreqHz": 1.0, + "station": { + "@id": "b018ef13-794f-42ce-b2c2-6d71905115e7", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "BRK" + } + }, + { + "siteTerm": 19.08599415640652, + "lowFreqHz": 1.0, + "highFreqHz": 1.5, + "station": { + "@id": "a6f2debb-5708-4f62-90d2-feed37be0a7a", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "BRK" + } + }, + { + "siteTerm": 19.222008671678143, + "lowFreqHz": 1.5, + "highFreqHz": 2.0, + "station": { + "@id": "d3403ae9-6b92-40a4-b779-4dbe41716b31", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "BRK" + } + }, + { + "siteTerm": 19.157092053457472, + "lowFreqHz": 2.0, + "highFreqHz": 3.0, + "station": { + "@id": "f5085f82-3f27-473c-a419-9b8b77f9e20e", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "BRK" + } + }, + { + "siteTerm": 19.35115934765357, + "lowFreqHz": 3.0, + "highFreqHz": 4.0, + "station": { + "@id": "4f5f8ee1-cf64-4c77-801d-ec85e9c9a0c8", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "BRK" + } + }, + { + "siteTerm": 19.50268452551519, + "lowFreqHz": 4.0, + "highFreqHz": 6.0, + "station": { + "@id": "07c6adca-b16f-4c92-822a-8c91547d7899", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "BRK" + } + }, + { + "siteTerm": 19.828703714226727, + "lowFreqHz": 6.0, + "highFreqHz": 8.0, + "station": { + "@id": "a4166dea-1484-418c-ae91-a7169bd2a284", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "BRK" + } + }, + { + "siteTerm": 20.397339859253915, + "lowFreqHz": 8.0, + "highFreqHz": 10.0, + "station": { + "@id": "5e266298-86b0-492b-95de-a1f29356a6a0", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "BRK" + } + }, + { + "siteTerm": 20.50088633033109, + "lowFreqHz": 10.0, + "highFreqHz": 15.0, + "station": { + "@id": "3e597ff6-0696-4428-9c59-9b59372cc232", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "BRK" + } + }, + { + "siteTerm": 21.393575961168878, + "lowFreqHz": 15.0, + "highFreqHz": 20.0, + "station": { + "@id": "566ab5ef-2afa-4417-85d8-0d04d4eeb7a7", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "BRK" + } + }, + { + "siteTerm": 21.4648991354487, + "lowFreqHz": 20.0, + "highFreqHz": 25.0, + "station": { + "@id": "69bffd0c-9a33-4331-b71a-cae754c436e9", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "BRK" + } + }, + { + "siteTerm": 18.95130420544801, + "lowFreqHz": 0.2, + "highFreqHz": 0.3, + "station": { + "@id": "b23a5c34-dedc-4850-b356-b5d6c39d87fb", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "BKS" + } + }, + { + "siteTerm": 18.805890373070653, + "lowFreqHz": 0.3, + "highFreqHz": 0.5, + "station": { + "@id": "c06ac732-567a-4e29-8f14-996a9515c9a0", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "BKS" + } + }, + { + "siteTerm": 18.86251273511122, + "lowFreqHz": 0.5, + "highFreqHz": 0.7, + "station": { + "@id": "6da684f7-63ea-496f-b976-5863855449bd", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "BKS" + } + }, + { + "siteTerm": 18.9875348127755, + "lowFreqHz": 0.7, + "highFreqHz": 1.0, + "station": { + "@id": "f76b5f84-3cf8-4585-812f-d285f682f488", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "BKS" + } + }, + { + "siteTerm": 18.785441029526325, + "lowFreqHz": 1.0, + "highFreqHz": 1.5, + "station": { + "@id": "9ce86d84-7023-48a4-bf72-cd1042fa3005", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "BKS" + } + }, + { + "siteTerm": 18.987364078516098, + "lowFreqHz": 1.5, + "highFreqHz": 2.0, + "station": { + "@id": "6f0b908c-b05a-45c0-8428-392b954579e5", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "BKS" + } + }, + { + "siteTerm": 18.965404827291053, + "lowFreqHz": 2.0, + "highFreqHz": 3.0, + "station": { + "@id": "b1a5412b-e84f-4d6e-ae8a-c3845d780508", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "BKS" + } + }, + { + "siteTerm": 19.206289788786393, + "lowFreqHz": 3.0, + "highFreqHz": 4.0, + "station": { + "@id": "130b4b1d-78c5-4788-bd3f-ef68f8df00cf", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "BKS" + } + }, + { + "siteTerm": 19.453771340249585, + "lowFreqHz": 4.0, + "highFreqHz": 6.0, + "station": { + "@id": "a7530b15-d5df-4e67-bd36-940476e5cbc0", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "BKS" + } + }, + { + "siteTerm": 20.12540927205573, + "lowFreqHz": 6.0, + "highFreqHz": 8.0, + "station": { + "@id": "af0978d8-9894-4bf2-afad-3a535ee6644a", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "BKS" + } + }, + { + "siteTerm": 20.767201960997724, + "lowFreqHz": 8.0, + "highFreqHz": 10.0, + "station": { + "@id": "9e0e56cb-bc83-41b6-8169-6c8c4822f50f", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "BKS" + } + }, + { + "siteTerm": 20.88186348291356, + "lowFreqHz": 10.0, + "highFreqHz": 15.0, + "station": { + "@id": "c31d646a-3b4b-4ad7-b184-1b47322319f6", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "BKS" + } + }, + { + "siteTerm": 21.788992250927492, + "lowFreqHz": 15.0, + "highFreqHz": 20.0, + "station": { + "@id": "26ee994b-e3bc-45de-a368-6adf697e10a5", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "BKS" + } + }, + { + "siteTerm": 21.847940079311876, + "lowFreqHz": 20.0, + "highFreqHz": 25.0, + "station": { + "@id": "fb80e534-70a0-47d3-905f-be201abcbb17", + "networkName": "BK", + "latitude": 0.0, + "longitude": 0.0, + "stationName": "BKS" + } + } +] diff --git a/externals/pom.xml b/externals/pom.xml index 983d8e4b..1bcd2bbe 100644 --- a/externals/pom.xml +++ b/externals/pom.xml @@ -7,7 +7,7 @@ gov.llnl.gnem.apps.coda.calibration coda-calibration - 1.0.10 + 1.0.11 externals @@ -76,6 +76,11 @@ ch.qos.logback logback-classic + + org.junit.jupiter + junit-jupiter + test + diff --git a/externals/src/main/java/llnl/gnem/core/gui/plotting/jmultiaxisplot/JPlotMouseListener.java b/externals/src/main/java/llnl/gnem/core/gui/plotting/jmultiaxisplot/JPlotMouseListener.java index a317fd8b..cc0e6dcf 100755 --- a/externals/src/main/java/llnl/gnem/core/gui/plotting/jmultiaxisplot/JPlotMouseListener.java +++ b/externals/src/main/java/llnl/gnem/core/gui/plotting/jmultiaxisplot/JPlotMouseListener.java @@ -596,7 +596,7 @@ public void mouseDragged(MouseEvent me) { int x = me.getX(); int y = me.getY(); - if (!plot.getPlotRegion().getRect().contains(x, y)) { + if (plot.getPlotRegion().getRect() == null || !plot.getPlotRegion().getRect().contains(x, y)) { return; } if (dragging && plot.getCurrentSubplot(x, y) != currentDragSubplot) { diff --git a/externals/src/main/java/llnl/gnem/core/gui/plotting/jmultiaxisplot/SubplotZoomData.java b/externals/src/main/java/llnl/gnem/core/gui/plotting/jmultiaxisplot/SubplotZoomData.java index 4e74eb21..e5e90272 100755 --- a/externals/src/main/java/llnl/gnem/core/gui/plotting/jmultiaxisplot/SubplotZoomData.java +++ b/externals/src/main/java/llnl/gnem/core/gui/plotting/jmultiaxisplot/SubplotZoomData.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2018, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory +* Copyright (c) 2021, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory * CODE-743439. * All rights reserved. * This file is part of CCT. For details, see https://github.com/LLNL/coda-calibration-tool. @@ -23,7 +23,7 @@ * * @author Doug Dodge */ -class SubplotZoomData { +public class SubplotZoomData { private final JSubplot p; private final Stack stack; diff --git a/externals/src/main/java/llnl/gnem/core/io/FileDataSource.java b/externals/src/main/java/llnl/gnem/core/io/FileDataSource.java index a64dbfee..57a0f7b3 100755 --- a/externals/src/main/java/llnl/gnem/core/io/FileDataSource.java +++ b/externals/src/main/java/llnl/gnem/core/io/FileDataSource.java @@ -162,6 +162,8 @@ public void getData(float[] dataArray, int offset, int numRequested) { if (legitFormat) { dis = new DataInputStream(new ByteArrayInputStream(buffer)); + } else { + dis = new DataInputStream(new ByteArrayInputStream(new byte[0])); } // perform appropriate read diff --git a/externals/src/main/java/llnl/gnem/core/util/FileInputArrayLoader.java b/externals/src/main/java/llnl/gnem/core/util/FileInputArrayLoader.java index 9afae542..dc2a6802 100755 --- a/externals/src/main/java/llnl/gnem/core/util/FileInputArrayLoader.java +++ b/externals/src/main/java/llnl/gnem/core/util/FileInputArrayLoader.java @@ -71,21 +71,9 @@ public static String[] fillStrings(final String filename) throws IOException { } public static String[] fillStrings(final String filename, boolean discardEmptyLines) throws IOException { - BufferedReader input = null; - FileReader file = null; - try { - file = new FileReader(filename); - input = new BufferedReader(file); + try (FileReader file = new FileReader(filename); BufferedReader input = new BufferedReader(file);) { return fillStrings(input, discardEmptyLines); - } finally { - if (input != null) { - input.close(); - } - if (file != null) { - file.close(); - } } - } private static String[] fillStrings(BufferedReader input, boolean discardEmptyLines) throws IOException { diff --git a/externals/src/main/java/llnl/gnem/core/util/SeriesMath.java b/externals/src/main/java/llnl/gnem/core/util/SeriesMath.java index e18cc9dd..f3556f24 100755 --- a/externals/src/main/java/llnl/gnem/core/util/SeriesMath.java +++ b/externals/src/main/java/llnl/gnem/core/util/SeriesMath.java @@ -1,5 +1,5 @@ /* -* Copyright (c) 2018, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory +* Copyright (c) 2021, Lawrence Livermore National Security, LLC. Produced at the Lawrence Livermore National Laboratory * CODE-743439. * All rights reserved. * This file is part of CCT. For details, see https://github.com/LLNL/coda-calibration-tool. @@ -20,7 +20,6 @@ import java.util.Collection; import java.util.Collections; import java.util.List; -import java.util.Vector; import org.apache.commons.math3.complex.Complex; import org.apache.commons.math3.stat.descriptive.rank.Median; @@ -45,6 +44,8 @@ */ public class SeriesMath { + private static final String LENGTH_MISMATCH = "Length of input x and y arrays is not the same."; + private static final String EMPTY_ARRAY = "Empty Array!"; private static final double EPS = 0.00001; private static final int R = 0; private static final int I = 1; @@ -58,7 +59,7 @@ public class SeriesMath { * - the second data series * @return result[ii] = data1[ii] + data2[ii] */ - public static double[] add(double data1[], double data2[]) { + public static double[] add(double[] data1, double[] data2) { if (data1.length != data2.length) { return null; } @@ -80,7 +81,7 @@ public static double[] add(double data1[], double data2[]) { * @param value * @return */ - public static double[] add(double data[], double value) { + public static double[] add(double[] data, double value) { double[] result = new double[data.length]; for (int ii = 0; ii < data.length; ii++) { @@ -90,7 +91,7 @@ public static double[] add(double data[], double value) { return result; } - public static float[] add(float data[], float value) { + public static float[] add(float[] data, float value) { float[] result = new float[data.length]; for (int ii = 0; ii < data.length; ii++) { result[ii] = data[ii] + value; @@ -98,7 +99,7 @@ public static float[] add(float data[], float value) { return result; } - public static float[] add(float data[], double value) { + public static float[] add(float[] data, double value) { return add(data, (float) value); } @@ -128,7 +129,7 @@ public static void addScalar(float[] data, double value) { * @param data * Array containing the series values */ - public static void addScalar(double data[], double value) { + public static void addScalar(double[] data, double value) { int NPTS = data.length; if (NPTS < 1) { return; @@ -278,7 +279,7 @@ public static double[] meanSmooth(double[] data, int halfWidth) { } result[j] = sum / W; } - System.arraycopy(data, N - halfWidth, result, N - halfWidth, N - (N - halfWidth));// TODO is this working correctly? + System.arraycopy(data, N - halfWidth, result, N - halfWidth, N - (N - halfWidth)); return result; } @@ -466,7 +467,7 @@ public static double slope(float[] data) { * - the second data series * @return result[ii] = data1[ii] - data2[ii] */ - public static double[] subtract(double data1[], double data2[]) { + public static double[] subtract(double[] data1, double[] data2) { if (data1.length != data2.length) { return null; } @@ -490,7 +491,7 @@ public static double[] subtract(double data1[], double data2[]) { * - the second data series * @return result[ii] = data1[ii] - data2[ii] */ - public static float[] subtract(float data1[], float data2[]) { + public static float[] subtract(float[] data1, float[] data2) { if (data1.length != data2.length) { return null; } @@ -612,7 +613,7 @@ public static double autocorrelate(float[] x, int shift) { * @param x * - the data series */ - public static double[] autocorrelate(double x[]) { + public static double[] autocorrelate(double[] x) { return crosscorrelate(x, x); } @@ -627,7 +628,7 @@ public static double[] autocorrelate(double x[]) { * "energy" of the trace * @return autocorrelation. */ - public static double autocorrelate(double x[], int shift) { + public static double autocorrelate(double[] x, int shift) { return crosscorrelate(x, x, shift); } @@ -672,7 +673,7 @@ public static double[] crosscorrelate(float[] x, float[] y) { * * Note the energy of a trace is the autocorrelation at zero shift */ - public static double crosscorrelate(float x[], float y[], int shift) { + public static double crosscorrelate(float[] x, float[] y, int shift) { double result = 0; for (int ii = 0; ii < x.length; ii++) { @@ -696,7 +697,7 @@ public static double crosscorrelate(float x[], float y[], int shift) { * the second data series * @return the cross-correlation series */ - public static double[] crosscorrelate(double x[], double y[]) { + public static double[] crosscorrelate(double[] x, double[] y) { int shift = Math.max(x.length, y.length) - 1; double[] result = new double[2 * shift + 1]; @@ -720,7 +721,7 @@ public static double[] crosscorrelate(double x[], double y[]) { * @return the cross correlation at a specific point Note the energy of a * trace is the autocorrelation at zero shift */ - public static double crosscorrelate(double x[], double y[], int shift) { + public static double crosscorrelate(double[] x, double[] y, int shift) { double result = 0; for (int ii = 0; ii < x.length; ii++) { @@ -834,10 +835,7 @@ public static double[] decimate(double[] data, int decimationfactor) { * @return */ public static Double dotProduct(double[] data1, double[] data2) { - double[] elementbyelement = elementMultiplication(data1, data2); - - Double result = getSum(elementbyelement);// check that this returns null when the lengths are not identical - return result; + return getSum(elementMultiplication(data1, data2)); } /** @@ -850,10 +848,7 @@ public static Double dotProduct(double[] data1, double[] data2) { * @return */ public static Double dotProduct(float[] data1, float[] data2) { - float[] elementbyelement = elementMultiplication(data1, data2); - - Double result = getSum(elementbyelement); - return result; + return getSum(elementMultiplication(data1, data2)); } /** @@ -1029,7 +1024,7 @@ public static float[] envelope(float[] data) { public static int[] find(long[] array, String condition, long value) { int[] indexes; Integer temp; - Vector indexV = new Vector<>(); + List indexV = new ArrayList<>(); if (condition.equals("==")) { for (int i = 0; i < array.length; i++) { @@ -1310,8 +1305,8 @@ public static DiscontinuityCollection findDiscontinuities(float[] data, double s * - the specific double value you are looking for * @return - a Vector of all the indices which match that value */ - public static ArrayList findIndicesOf(double data[], double value) { - ArrayList result = new ArrayList<>(); + public static List findIndicesOf(double[] data, double value) { + List result = new ArrayList<>(); for (int i = 0; i < data.length; i++) { if (data[i] == value) { @@ -1361,9 +1356,9 @@ public static double getEnergy(float[] x) { * @param data * @return the largest absolute value in the series */ - public static float getExtremum(float data[]) { + public static float getExtremum(float[] data) { float smax = 0.0f; - float sabs = 0.0f; + float sabs; for (int i = 0; i < data.length; i++) { sabs = Math.abs(data[i]); if (sabs > smax) { @@ -1391,7 +1386,7 @@ public static Collection getGlitches(float[] data, int windowLength, dou RollingStats window1 = null; RollingStats window2 = null; for (int i = windowLength; i < data.length - windowLength; i++) { - if (i == windowLength) { + if (window1 == null) { window1 = new RollingStats(Arrays.copyOfRange(data, 0, windowLength - 1)); window2 = new RollingStats(Arrays.copyOfRange(data, i + 1, i + windowLength)); } else { @@ -1444,7 +1439,7 @@ public static float getMax(float[] data, int idx1, int idx2) { * Array containing the series values * @return The max value of the series */ - public static float getMax(float data[]) { + public static float getMax(float[] data) { return getMax(data, 0, data.length - 1); } @@ -1455,7 +1450,7 @@ public static float getMax(float data[]) { * Array containing the series values * @return The max value of the series */ - public static double getMax(double data[]) { + public static double getMax(double[] data) { int Nsamps = data.length; if (Nsamps < 1) { return 0.0F; @@ -1481,10 +1476,10 @@ public static double getMax(Collection data) { * Array containing the series values * @return The (index, max value) of the series */ - public static PairT getMaxIndex(float data[]) { + public static PairT getMaxIndex(float[] data) { int Nsamps = data.length; if (Nsamps < 1) { - throw new IllegalStateException("Empty Array!"); + throw new IllegalStateException(EMPTY_ARRAY); } float max = -Float.MAX_VALUE; int imax = 0; @@ -1505,10 +1500,10 @@ public static PairT getMaxIndex(float data[]) { * Array containing the series values * @return The (index, max value) of the series */ - public static PairT getMaxIndex(double data[]) { + public static PairT getMaxIndex(double[] data) { int Nsamps = data.length; if (Nsamps < 1) { - throw new IllegalStateException("Empty Array!"); + throw new IllegalStateException(EMPTY_ARRAY); } double max = -Double.MAX_VALUE; int imax = 0; @@ -1537,7 +1532,7 @@ public static double getMean(float[] data) { } public static double getMean(Collection c) { - if (c.size() < 1) { + if (c.isEmpty()) { return 0; } else { return getSum(c) / c.size(); @@ -1551,8 +1546,7 @@ public static double getMean(Collection c) { * Array containing the series values * @return The mean value of the series */ - public static double getMean(double data[]) //TODO RENAME - NOT DOT PRODUCT - { + public static double getMean(double[] data) { if (data.length < 1) { return (0.0); } @@ -1657,10 +1651,10 @@ public static double getMin(double[] data) { * Array containing the series values * @return The (index, min value) of the series */ - public static PairT getMinIndex(double data[]) { + public static PairT getMinIndex(double[] data) { int Nsamps = data.length; if (Nsamps < 1) { - throw new IllegalStateException("Empty Array!"); + throw new IllegalStateException(EMPTY_ARRAY); } double min = Double.MAX_VALUE; int imin = 0; @@ -1681,10 +1675,10 @@ public static PairT getMinIndex(double data[]) { * Array containing the series values * @return The (index, max value) of the series */ - public static PairT getMinIndex(float data[]) { + public static PairT getMinIndex(float[] data) { int Nsamps = data.length; if (Nsamps < 1) { - throw new IllegalStateException("Empty Array!"); + throw new IllegalStateException(EMPTY_ARRAY); } float min = Float.MAX_VALUE; int imin = 0; @@ -1706,7 +1700,7 @@ public static PairT getMinIndex(float data[]) { * @param data * @return */ - public static double getNorm(double data[]) { + public static double getNorm(double[] data) { double sumsquares = 0.; for (int ii = 0; ii < data.length; ii++) { sumsquares = sumsquares + data[ii] * data[ii]; @@ -1829,10 +1823,10 @@ public static double getSnr(float[] data, double sampleRate, double dataStartTim int preWinStartIndex = (int) Math.round((preWinStartTime - dataStartTime) * sampleRate); int postWinEndIndex = (int) Math.round((postWinEndTime - dataStartTime) * sampleRate); - return getSnr(data, sampleRate, pickIndex, preWinStartIndex, postWinEndIndex); + return getSnr(data, pickIndex, preWinStartIndex, postWinEndIndex); } - public static double getSnr(float[] data, double sampleRate, int pickIndex, int preWinStartIndex, int postWinEndIndex) { + public static double getSnr(float[] data, int pickIndex, int preWinStartIndex, int postWinEndIndex) { int preWinSamples = pickIndex - preWinStartIndex + 1; if (preWinSamples < 2) { @@ -1869,7 +1863,7 @@ public static double getStDev(float[] data) { * Array containing the series values * @return The standard deviation value */ - public static double getStDev(double data[]) { + public static double getStDev(double[] data) { return Math.sqrt(getVariance(data)); } @@ -1964,7 +1958,7 @@ public static double getSum(Collection c) { * Array containing the series values * @return The sum of the values */ - public static double getSum(double data[]) { + public static double getSum(double[] data) { double result = 0.0; for (double aData : data) { result += aData; @@ -1989,7 +1983,7 @@ public static double getSumOfSquares(float[] data) { * @param data * is an Array containing the series values */ - public static double[] getUnitVector(double data[]) { + public static double[] getUnitVector(double[] data) { double norm = getNorm(data); if (norm == 0.) // The original data are a zero vector. Return the original zero vector as the unit vector @@ -2049,7 +2043,7 @@ public static double getVariance(Collection c) { * Array containing the series values * @return The variance value */ - public static double getVariance(double data[]) { + public static double getVariance(double[] data) { int Nsamps = data.length; if (Nsamps < 2) { return (0.0); @@ -2181,7 +2175,7 @@ public static double interpolate(double[] x, double[] y, double xinterp) { public static float interpolate(float[] x, float[] y, float xinterp) { int N = x.length; if (y.length != N) { - throw new IllegalArgumentException("Length of input x and y arrays is not the same."); + throw new IllegalArgumentException(LENGTH_MISMATCH); } if (xinterp < x[0] || xinterp > x[N - 1]) { throw new IllegalArgumentException("xinterp value is out of the range of x."); @@ -2214,7 +2208,7 @@ public static double interpolate(double xStart, double dx, double[] y, double xi if (xinterp < xStart || xinterp > (y.length - 1) * dx) { throw new IllegalArgumentException("The xinterp value is out of range."); } - double x[] = new double[1]; + double[] x = new double[1]; x[0] = xStart; return wigint(x, y, dx, EPS, xinterp); } @@ -2237,9 +2231,9 @@ public static double interpolate(double xStart, double dx, double[] y, double xi public static double[] interpolate(double[] x, double[] y, double[] xinterp) { int N = x.length; if (y.length != N) { - throw new IllegalArgumentException("Length of input x and y arrays is not the same."); + throw new IllegalArgumentException(LENGTH_MISMATCH); } - double result[] = new double[xinterp.length]; + double[] result = new double[xinterp.length]; for (int j = 0; j < xinterp.length; ++j) { result[j] = wigint(x, y, 0.0, EPS, xinterp[j]); } @@ -2264,17 +2258,18 @@ public static double[] interpolate(double[] x, double[] y, double[] xinterp) { public static float[] interpolate(float[] x, float[] y, float[] xinterp) { int N = x.length; if (y.length != N) { - throw new IllegalArgumentException("Length of input x and y arrays is not the same."); + throw new IllegalArgumentException(LENGTH_MISMATCH); } - double X[] = new double[N]; - double Y[] = new double[N]; + double[] X = new double[N]; + double[] Y = new double[N]; for (int j = 0; j < x.length; ++j) { X[j] = x[j]; } for (int j = 0; j < y.length; ++j) { Y[j] = y[j]; } - float result[] = new float[xinterp.length]; + + float[] result = new float[xinterp.length]; for (int j = 0; j < xinterp.length; ++j) { result[j] = (float) wigint(X, Y, 0.0, EPS, xinterp[j]); } @@ -2297,11 +2292,11 @@ public static float[] interpolate(float[] x, float[] y, float[] xinterp) { * @return The interpolated y-value. */ public static double[] interpolate(double xStart, double dx, double[] y, double[] xinterp) { - double x[] = new double[y.length]; + double[] x = new double[y.length]; for (int j = 0; j < y.length; ++j) { x[j] = xStart + j * dx; } - double result[] = new double[xinterp.length]; + double[] result = new double[xinterp.length]; for (int j = 0; j < xinterp.length; ++j) { result[j] = wigint(x, y, 0.0, EPS, xinterp[j]); } @@ -2324,14 +2319,14 @@ public static double[] interpolate(double xStart, double dx, double[] y, double[ * @return The interpolated y-value. */ public static float[] interpolate(float xStart, float dx, float[] y, float[] xinterp) { - double x[] = new double[1]; + double[] x = new double[1]; x[0] = xStart; - double Y[] = new double[y.length]; + double[] Y = new double[y.length]; for (int j = 0; j < y.length; ++j) { Y[j] = y[j]; } - float result[] = new float[xinterp.length]; + float[] result = new float[xinterp.length]; for (int j = 0; j < xinterp.length; ++j) { result[j] = (float) wigint(x, Y, dx, EPS, xinterp[j]); } @@ -2346,14 +2341,14 @@ public static float[] interpolate(double xStart, double oldDx, float[] y, double xinterp[j] = (xStart + j * newDx); } - double x[] = new double[1]; + double[] x = new double[1]; x[0] = xStart; - double Y[] = new double[y.length]; + double[] Y = new double[y.length]; for (int j = 0; j < y.length; ++j) { Y[j] = y[j]; } - float result[] = new float[xinterp.length]; + float[] result = new float[xinterp.length]; for (int j = 0; j < xinterp.length; ++j) { result[j] = (float) wigint(x, Y, oldDx, EPS, xinterp[j]); } @@ -2573,7 +2568,7 @@ public static void removeGlitches(float[] data, double threshhold) { public static boolean hasFlatSegments(float[] data, int segmentlength) { float[] dx = new float[segmentlength]; - // todo currently hardwiring the number of elements that must be flat - replace with windowlength + //TODO: currently hardwiring the number of elements that must be flat - replace with windowlength for (int jj = 0; jj < (data.length - 9); jj++) { for (int subset = 1; subset < 10; subset++)// currently - 10 points in a row are flagged { @@ -3123,13 +3118,14 @@ public double covariance(double[] vec1, double[] vec2) { double xAverage = getMean(vec1); double yAverage = getMean(vec2); - double sumDifferencesX = 0, sumDifferencesY = 0; + double sumDifferencesX = 0; + double sumDifferencesY = 0; for (int indexVec = 0; indexVec < n; indexVec++) { sumDifferencesX += vec1[indexVec] - xAverage; sumDifferencesY += vec2[indexVec] - yAverage; } - return (1 / (n - 1)) * sumDifferencesX * sumDifferencesY; + return (1.0 / (n - 1.0)) * sumDifferencesX * sumDifferencesY; } diff --git a/externals/src/main/java/llnl/gnem/core/util/randomNumbers/BaseRandomAlgorithm.java b/externals/src/main/java/llnl/gnem/core/util/randomNumbers/BaseRandomAlgorithm.java index 8e8d2631..472396de 100755 --- a/externals/src/main/java/llnl/gnem/core/util/randomNumbers/BaseRandomAlgorithm.java +++ b/externals/src/main/java/llnl/gnem/core/util/randomNumbers/BaseRandomAlgorithm.java @@ -40,7 +40,7 @@ public int getBoundedInt(int lower, int upper) { long max = Integer.MAX_VALUE; long inRange = max - min; long value = this.nextInt(); - double numerator = (value - min) * outRange; + double numerator = (value - min) * (double) outRange; long result = lower + Math.round(numerator / inRange); return (int) result; } diff --git a/externals/src/main/java/llnl/gnem/core/waveform/seismogram/TimeSeries.java b/externals/src/main/java/llnl/gnem/core/waveform/seismogram/TimeSeries.java index 92dc72c0..f28e90ab 100755 --- a/externals/src/main/java/llnl/gnem/core/waveform/seismogram/TimeSeries.java +++ b/externals/src/main/java/llnl/gnem/core/waveform/seismogram/TimeSeries.java @@ -444,27 +444,10 @@ public void Taper(double TaperPercent) { } public void WriteASCIIfile(String filename) throws IOException { - FileOutputStream out = null; - BufferedOutputStream bout = null; - PrintStream pout = null; - try { - out = new FileOutputStream(filename); - - bout = new BufferedOutputStream(out); - pout = new PrintStream(bout); + try (FileOutputStream out = new FileOutputStream(filename); BufferedOutputStream bout = new BufferedOutputStream(out); PrintStream pout = new PrintStream(bout);) { for (int j = 0; j < data.length; ++j) { pout.println(String.valueOf((j / samprate)) + " " + data[j]); } - } finally { - if (pout != null) { - pout.close(); - } - if (bout != null) { - bout.close(); - } - if (out != null) { - out.close(); - } } } @@ -497,13 +480,13 @@ public void addInPlace(TimeSeries other) { int myOffset = (int) Math.round((myStart - earliest) * getSamprate()); int myLast = myOffset + data.length - 1; if (myLast > nsamps - 1) { - nsamps = myLast + 1; + nsamps = myLast + 1l; } int otherOffset = (int) Math.round((otherStart - earliest) * samprate); int otherLast = otherOffset + other.data.length - 1; if (otherLast > nsamps - 1) { - nsamps = otherLast + 1; + nsamps = otherLast + 1l; } float[] result = new float[(int) nsamps]; System.arraycopy(data, 0, result, myOffset, data.length); @@ -1173,7 +1156,7 @@ public double getSnr(double pickEpochTime, Epoch epoch, double preSeconds, doubl int pick = getIndexForTime(pickEpochTime); int startIndex = getIndexForTime(Math.max(start, pickEpochTime - preSeconds)); int endIndex = getIndexForTime(Math.min(end, pickEpochTime + postSeconds)); - return SeriesMath.getSnr(data, samprate, pick, startIndex, endIndex); + return SeriesMath.getSnr(data, pick, startIndex, endIndex); } /** diff --git a/mapping/pom.xml b/mapping/pom.xml index 23d9ea98..c5d23a7f 100644 --- a/mapping/pom.xml +++ b/mapping/pom.xml @@ -7,7 +7,7 @@ gov.llnl.gnem.apps.coda.calibration coda-calibration - 1.0.10 + 1.0.11 gov.llnl.gnem.apps.coda.common diff --git a/pom.xml b/pom.xml index 6f1dd70b..9dd8f5a5 100644 --- a/pom.xml +++ b/pom.xml @@ -1,27 +1,20 @@ - + 4.0.0 gov.llnl.gnem.apps.coda.calibration coda-calibration - 1.0.10 + 1.0.11 coda-calibration pom externals - common-service mapping - common-gui calibration-service calibration-gui calibration-standalone - envelope-service - envelope-gui - envelope-standalone @@ -78,31 +71,32 @@ 3.2.4 3.2.0 - 16-ea+1 + 15.0.1 2.4.0-b180830.0359 - 2.4.0-M2 - 2020.0.0-M2 + 2.5.0-M2 + 2020.0.4 2.2.1 - 1.13 + 1.14 1.3.04 - 1.50 - 10.4.0 + 1.51 + 11.0.0.M1 2.0.0-RC1 - 1.17.1 + 1.18.1 0.14.3 + 21.0.0.2 1.17 1.20 3.6.1 - 29.0-jre + 30.1-jre 2.4.0 - 5.3.0-M2 - 5.7.0-RC1 - 3.5.5 + 5.3.4 + 5.8.0-M1 + 3.8.0 1.3.2 @@ -133,7 +127,7 @@ org.openjfx javafx-swing ${jfx.version} - + org.openjfx javafx-web @@ -297,12 +291,12 @@ ${spring.boot.version} pom import - + org.springframework.boot spring-boot-loader ${spring.boot.version} - + org.springframework.boot spring-boot-starter-actuator @@ -313,7 +307,7 @@ spring-boot-starter-web ${spring.boot.version} - + org.eclipse.persistence javax.persistence @@ -374,17 +368,17 @@ org.locationtech.jts jts-core ${jts.version} - + org.locationtech.jts.io jts-io-common ${jts.version} - + org.wololo jts2geojson ${jts2geojson.version} - + diff --git a/schema/calibration-input-params.json.example b/schema/calibration-input-params.json.example index ef3cb014..0f3ef764 100644 --- a/schema/calibration-input-params.json.example +++ b/schema/calibration-input-params.json.example @@ -97,6 +97,8 @@ "maxBeta": -1.0E-4, "minGamma": 0.001, "maxGamma": 4.0, - "iterations": 10 + "iterations": 10, + "fittingPointCount": 10000, + "lengthWeight": 0.001 } } \ No newline at end of file diff --git a/schema/calibration-input-params.jsonschema b/schema/calibration-input-params.jsonschema index 957483e3..b44d8b00 100644 --- a/schema/calibration-input-params.jsonschema +++ b/schema/calibration-input-params.jsonschema @@ -1067,6 +1067,24 @@ "examples": [ 1 ] + }, + "fittingPointCount": { + "$id": "#/properties/shape-constraints/properties/fittingPointCount", + "type": "number", + "title": "Maximum number of samples for the initial shape calibration curve fitting to use for the optimization pass. If the sample number is higher than this for the envelope being fit it will down-sample to reach this number.", + "default": 10000, + "examples": [ + 10000 + ] + }, + "lengthWeight": { + "$id": "#/properties/shape-constraints/properties/lengthWeight", + "type": "number", + "title": "This is the cost function weighting used during autopicking to preferentially weight stopping times that are longer. Effectively this discounts the length normalized misfit value, M, using the current length as a fraction of maximum acceptable length. The optimization is then min(residual) { residual = M - ((M * length-weight) * (current-length/possible-length)) }. ", + "default": 0.001, + "examples": [ + 0.001 + ] } } }