Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update event type for QuakeML #256

Merged
merged 1 commit into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading