Skip to content

Commit

Permalink
CCT 1.0.17 Release Notes
Browse files Browse the repository at this point in the history
* Added a network average spectrum to the relative site and absolute site term plots
* Updates to all naming conventions for generating envelopes based on user feedback
* Updates to the naming conventions around loading and saving data based on user feedback.
* Add filter capabilities for including and excluding waveforms from the waveform plot displays based on specific criteria, such as event or station information
* Updates to the Data filter functionality to include new features and a redesigned layout that is more compact.
* Event depth headers on the SAC files are not (correctly) using Meters and will update the internal data representation accordingly.
* Corrected display bug in the relative site plot when site correction terms were missing for the primary station.
* New functions to export spectra value JSON directly from the spectra plots.
* New feature to allow exporting raw data JSON files from all plots in the GUI.
* Energy magnitude now being calculated in addition to Mw based on [Mayeda and Walter 1996] paper
* Updates to uncertainty quantification to include confidence intervals for apparent stress, corner frequency, total energy, observed apparent stress, and energy magnitude values in addition to Mw.
  • Loading branch information
justinbarno committed Jun 2, 2022
1 parent bae0587 commit 44c36ec
Show file tree
Hide file tree
Showing 78 changed files with 6,466 additions and 3,230 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.15-runnable.jar
java -jar coda-calibration/calibration-standalone/target/calibration-standalone-1.0.17-runnable.jar
```

#### **GUI alone**

```shell
java -jar coda-calibration/calibration-gui/target/calibration-gui-1.0.15-runnable.jar
java -jar coda-calibration/calibration-gui/target/calibration-gui-1.0.17-runnable.jar
```
#### **Calibration REST service alone**

```shell
java -jar coda-calibration/calibration-service/application/target/application-1.0.15-runnable.jar
java -jar coda-calibration/calibration-service/application/target/application-1.0.17-runnable.jar
```

#### A note about HTTPS
Expand Down
2 changes: 1 addition & 1 deletion calibration-gui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>gov.llnl.gnem.apps.coda.calibration</groupId>
<artifactId>coda-calibration</artifactId>
<version>1.0.16</version>
<version>1.0.17</version>
</parent>

<artifactId>calibration-gui</artifactId>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableColumn.CellDataFeatures;
import javafx.scene.control.TableView;
import javafx.scene.control.ToggleGroup;
import javafx.scene.input.MouseButton;
import javafx.scene.input.MouseEvent;

Expand Down Expand Up @@ -282,13 +283,13 @@ public void initialize() {
//The filter controller will manage the list so don't add the listData directly
//to the table, otherwise the event handlers will trip over themselves
DataFilterController<Waveform> filterController = new DataFilterController<>(tableView, listData);

filterController.addFilterToColumn(eventCol, (data, item) -> data.getEvent().getEventId().equals(item));
filterController.addFilterToColumn(depthCol, (data, item) -> dfmt2.format(data.getEvent().getDepth()).equals(item));
filterController.addFilterToColumn(lowFreqCol, (data, item) -> data.getLowFrequency().toString().equals(item));
filterController.addFilterToColumn(highFreqCol, (data, item) -> data.getHighFrequency().toString().equals(item));
filterController.addFilterToColumn(stationCol, (data, item) -> data.getStream().getStation().getStationName().equals(item));
filterController.addFilterToColumn(networkCol, (data, item) -> data.getStream().getStation().getNetworkName().equals(item));
ToggleGroup freqFieldsToggle = new ToggleGroup(); //The toggle group will prevent freqFields from both being active during the 'And' filter.
filterController.addFilterToColumn(false, null, eventCol, (data, value) -> data.getEvent().getEventId().equals(value));
filterController.addFilterToColumn(false, null, depthCol, (data, value) -> dfmt2.format(data.getEvent().getDepth()).equals(value));
filterController.addFilterToColumn(true, freqFieldsToggle, lowFreqCol, (data, value) -> data.getLowFrequency().toString().equals(value));
filterController.addFilterToColumn(true, freqFieldsToggle, highFreqCol, (data, value) -> data.getHighFrequency().toString().equals(value));
filterController.addFilterToColumn(false, null, stationCol, (data, value) -> data.getStream().getStation().getStationName().equals(value));
filterController.addFilterToColumn(false, null, networkCol, (data, value) -> data.getStream().getStation().getNetworkName().equals(value));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.util.List;
import java.util.function.Predicate;

import javafx.beans.value.ChangeListener;
import javafx.collections.FXCollections;
import javafx.collections.ListChangeListener;
import javafx.collections.ListChangeListener.Change;
Expand All @@ -30,6 +31,7 @@
import javafx.scene.control.Label;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.ToggleGroup;

class DataFilterController<T> {
// The list of unfiltered table items
Expand All @@ -39,12 +41,14 @@ class DataFilterController<T> {
// The filter buttons attached to columns
private List<Button> buttons;
private HashMap<TableColumn<T, ?>, ObservableList<Object>> columnFilterLists;
private List<ObservableList<Object>> sliderValues;
private FilteredList<T> filteredItems;

DataFilterController(final TableView<T> tableView, final ObservableList<T> items) {
this.items = items;
this.buttons = new ArrayList<>();
this.columnFilterLists = new HashMap<>();
this.sliderValues = new ArrayList<>();
this.filterDialog = new FilterDialogController();
this.predicateBuilder = new PredicateBuilder<>();

Expand All @@ -59,7 +63,7 @@ class DataFilterController<T> {
this.items.addListener((ListChangeListener<? super T>) change -> {
if (change.getList().isEmpty()) {
setFiltersDisabled(true);
filterDialog.clearComboSelections();
filterDialog.clearControlSelections();
} else {
setFiltersDisabled(false);
updateFilterLists(change);
Expand All @@ -71,13 +75,13 @@ class DataFilterController<T> {
filterDialog.hide();
});
filterDialog.setClearFiltersAction(e -> {
filterDialog.clearComboSelections();
filterDialog.clearControlSelections();
filterDialog.hide();
filteredItems.setPredicate(null);
});
}

public void addFilterToColumn(TableColumn<T, ?> column, PredicateBuilder.ValueComparer<T> converter) {
public void addFilterToColumn(boolean slider, ToggleGroup toggleGroup, TableColumn<T, ?> column, PredicateBuilder.ValueComparer<T> converter) {

// Create the checkbox that opens the filter panel/dialog
Button filterBtn = new Button();
Expand All @@ -91,9 +95,8 @@ public void addFilterToColumn(TableColumn<T, ?> column, PredicateBuilder.ValueCo
buttons.add(filterBtn);

String columnName = column.getText();
ObservableList<Object> filterOptions = FXCollections.observableList(new ArrayList<>());
filterOptions.add(null);
columnFilterLists.put(column, filterOptions);
ObservableList<Object> filterItemsList = FXCollections.observableList(new ArrayList<>());
columnFilterLists.put(column, filterItemsList);

// Create a label that wraps the checkbox so that the column text
// is displayed to the left of the checkbox
Expand All @@ -103,11 +106,30 @@ public void addFilterToColumn(TableColumn<T, ?> column, PredicateBuilder.ValueCo
column.setGraphic(buttonWrapper);
column.setText("");

// Update the filter dialog to include new filter options
filterDialog.addFilterOption(columnName, filterOptions, (options, oldValue, newValue) -> {
// Create handler for when active state changes
ChangeListener<? super Boolean> updateActive = (options, oldValue, newValue) -> {
if (oldValue != newValue) {
predicateBuilder.setPredicateActiveState(columnName, newValue);
}
};

// Create handler for when field control updates value
ChangeListener<? super Object> updateValue = (options, oldValue, newValue) -> {
String txtValue = newValue != null ? newValue.toString() : "";
predicateBuilder.setPredicate(columnName, converter, txtValue);
});
if (!txtValue.equals("")) {
predicateBuilder.setPredicate(columnName, converter, txtValue);
predicateBuilder.setPredicateActiveState(columnName, true);
filterDialog.setFieldActiveState(columnName, true);
}
};

// Update the filter dialog to include new filter options
if (slider) {
sliderValues.add(filterItemsList);
filterDialog.addFilterSlider(columnName, filterItemsList, toggleGroup, updateActive, updateValue);
} else {
filterDialog.addFilterOption(columnName, filterItemsList, toggleGroup, updateActive, updateValue);
}
}

public void setFiltersDisabled(Boolean disabled) {
Expand All @@ -123,9 +145,6 @@ public void updateFilterLists(final Change<? extends T> change) {
ObservableList<Object> filterList = entry.getValue();
Object itemVal = entry.getKey().getCellObservableValue(remItem).getValue();
filterList.remove(itemVal);
if (!filterList.contains(null)) { // Add a null value for comboboxes
filterList.add(null);
}
});
}
for (T addItem : change.getAddedSubList()) {
Expand All @@ -135,14 +154,15 @@ public void updateFilterLists(final Change<? extends T> change) {
if (!filterList.contains(itemVal)) { // Don't add duplicate items
filterList.add(itemVal);
}
if (!filterList.contains(null)) { // Add a null value for comboboxes
filterList.add(null);
}

filterList.sort((Comparator<Object>) entry.getKey().getComparator());
});
}
}

for (int idx = 0; idx < sliderValues.size(); idx++) {
filterDialog.updateSliders(idx, sliderValues.get(idx));
}
}

public void filterTableViewResults() {
Expand Down
Loading

0 comments on commit 44c36ec

Please sign in to comment.