diff --git a/cmd/fdsn-ws/fdsn_event.go b/cmd/fdsn-ws/fdsn_event.go index f13f415..3f25d82 100644 --- a/cmd/fdsn-ws/fdsn_event.go +++ b/cmd/fdsn-ws/fdsn_event.go @@ -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 diff --git a/cmd/fdsn-ws/fdsn_event_test.go b/cmd/fdsn-ws/fdsn_event_test.go index b602e10..8fb1310 100644 --- a/cmd/fdsn-ws/fdsn_event_test.go +++ b/cmd/fdsn-ws/fdsn_event_test.go @@ -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 {