Skip to content

Commit

Permalink
Merge pull request #256 from GeoNet/seiscomp-update
Browse files Browse the repository at this point in the history
update event type for QuakeML
  • Loading branch information
sue-h-gns authored Aug 7, 2024
2 parents 5215dac + cf514e3 commit bae9e7e
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 15 deletions.
87 changes: 73 additions & 14 deletions cmd/fdsn-ws/fdsn_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,23 +78,82 @@ var eventNotSupported = map[string]bool{
"includearrivals": true,
}

// copied from p.17 of FDSN-WS-Specifications-1.2.pdf
const EVENT_TYPES = `not existing, not reported, earthquake, anthropogenic event, collapse,
cavity collapse, mine collapse, building collapse, explosion, accidental explosion, chemical explosion,
controlled explosion, experimental explosion, industrial explosion, mining explosion, quarry blast,
road cut, blasting levee, nuclear explosion, induced or triggered event, rock burst, reservoir loading,
fluid injection, fluid extraction, crash, plane crash, train crash, boat crash, other event,
atmospheric event, sonic boom, sonic blast, acoustic noise, thunder, avalanche, snow avalanche,
debris avalanche, hydroacoustic event, ice quake, slide, landslide, rockslide, meteorite, volcanic eruption`
// from https://github.com/SeisComP/common/blob/master/libs/xml/0.13/sc3ml_0.13.xsd
// https://github.com/SeisComP/common/blob/master/libs/xml/0.13/sc3ml_0.13__quakeml_1.2.xsl
var validEventTypes = []string{
"not existing",
"not locatable",
"outside of network interest",
"earthquake",
"induced earthquake",
"quarry blast",
"explosion",
"chemical explosion",
"nuclear explosion",
"landslide",
"rockslide",
"snow avalanche",
"debris avalanche",
"mine collapse",
"building collapse",
"volcanic eruption",
"meteor impact",
"plane crash",
"sonic boom",
"duplicate",
"other",
"not reported",
"anthropogenic event",
"collapse",
"cavity collapse",
"accidental explosion",
"controlled explosion",
"experimental explosion",
"industrial explosion",
"mining explosion",
"road cut",
"blasting levee",
"induced or triggered event",
"rock burst",
"reservoir loading",
"fluid injection",
"fluid extraction",
"crash",
"train crash",
"boat crash",
"atmospheric event",
"sonic blast",
"acoustic noise",
"thunder",
"avalanche",
"hydroacoustic event",
"ice quake",
"slide",
"meteorite",
"calving",
"frost quake",
"tremor pulse",
"submarine landslide",
"rocket launch",
"rocket",
"rocket impact",
"artillery strike",
"bomb detonation",
"moving aircraft",
"atmospheric meteor explosion",
"volcano-tectonic",
"volcanic long-period",
"volcanic very-long-period",
"volcanic hybrid",
"volcanic rockfall",
"volcanic tremor",
"pyroclastic flow",
"lahar",
"other event",
}

const UNKNOWN_TYPE = "unknown"

var validEventTypes = strings.Split(
strings.ReplaceAll(
strings.ReplaceAll(EVENT_TYPES, "\n", ""),
", ", ","),
",") // remove spaces after comma

func initEventTemplate() {
var err error
var b bytes.Buffer
Expand Down
2 changes: 1 addition & 1 deletion cmd/fdsn-ws/fdsn_event_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ func TestEventTypes(t *testing.T) {
{"e*", false, []interface{}{"earthquake", "explosion", "experimental explosion"}},
{"z*", true, nil}, // no such match, expected value doesn't matter
{"experimental explosion", false, []interface{}{"experimental explosion"}},
{"e*,a*", false, []interface{}{"earthquake", "anthropogenic event", "explosion", "accidental explosion", "experimental explosion", "atmospheric event", "acoustic noise", "avalanche"}},
{"e*,a*", false, []interface{}{"earthquake", "explosion", "anthropogenic event", "accidental explosion", "experimental explosion", "atmospheric event", "acoustic noise", "avalanche", "artillery strike", "atmospheric meteor explosion"}},
{"unknown", false, []interface{}{""}}, // specify "unknown" means query for empty value
}
for _, c := range queryCases {
Expand Down

0 comments on commit bae9e7e

Please sign in to comment.