Make Mwp amplitude and magnitude parameters configurable#197
Open
comoglu wants to merge 11 commits into
Open
Conversation
Two new options for controlling the map view when an event arrives, applied in priority order: 1. display.lonmin/max/latmin/max (already existing) — if set, the map is anchored to that region on every event popup, regardless of where the event is located. Useful for regional networks monitoring a fixed area (e.g. an scesv alias per region). 2. display.defaultEventRadius — configurable radius in degrees, centred on the event epicentre (mirrors olv.map.event.defaultRadius in scolv). A negative value (default) restores the original automatic behaviour of using the maximum arrival distance capped at 30 degrees. If neither option is set the existing behaviour is fully preserved.
Extends the City<T> template class with three new optional attributes
to carry richer location metadata sourced from GeoNames and Natural Earth:
type — location type, e.g. "city", "town", "village", "suburb"
state — ISO 3166-2 alphabetic subdivision abbreviation, e.g. "NSW", "CA"
Only present for countries that use alphabetic codes.
stateFull — full administrative region name, e.g. "New South Wales"
All three fields are serialized as XML attributes (NAMED_OBJECT),
consistent with the existing countryID and category fields. They default
to empty strings and are fully backwards-compatible — existing cities.xml
files without these attributes parse without error.
This allows applications such as scolv to display type and state
information via SCApp->cities() without requiring a separate supplementary
locations file.
- City<T>: add country() / setCountry() serialised as <country> child element
- City<T>: replace state/stateFull strings with AdminRegion { abbr, name }
serialised as <state abbr="NSW"><name>New South Wales</name></state>
- Document fixed type values: city, town, village, suburb
- Regenerate cities.xml with country names (Natural Earth), admin region
(ISO 3166-2 abbreviation + full name via NE admin1 shapefile), and type
(GeoNames feature codes); 70242 country names, 71654 states, 56860 types
Replace the manual enum class and custom string conversion with MAKEENUM as suggested by @gempa-jabe. The archive now handles string serialization automatically.
std::string members default to empty so the explicit reset is redundant and would corrupt data on write.
CityType and AdminRegion are optional in cities.xml; using plain types caused the archive to mark the entire City object invalid when those attributes/elements were absent, silently dropping all cities. Wrap both fields in OPT() (std::optional) so the archive skips missing fields gracefully. type() and adminRegion() return safe defaults when the optional is not set.
Replace British spellings: honoured→honored, unrecognised→unrecognized, centre→center.
Three independent improvements to the Mwp processor: 1. amplitudes.Mwp.useFirstPeak (boolean, default false) Adds a configurable option to use the first local maximum of the doubly-integrated displacement after the P arrival, as described in the original Tsuboi et al. (1995) algorithm, instead of the global maximum in the signal window. Default false preserves backward compatibility. Later arrivals (PP, pP, surface reflections) can inflate the global maximum for large events and contribute to Mwp saturation. 2. magnitudes.Mwp.estimateMw.a/b/stdError (double, Whitmore 2002 defaults) The Mw(Mwp) linear correction coefficients a=1.186, b=-1.222 and stdError=0.4 were previously hardcoded with a "Fixme" comment. They are now configurable from global.cfg, allowing operators to apply updated calibrations from larger or more recent datasets without recompiling. 3. PREM depth-dependent P-wave velocity and density computeMagnitude() now uses a PREM lookup table (Dziewonski & Anderson 1981) to select alpha and rho at the source depth instead of hardcoded mantle values (alpha=7900 m/s, rho=3400 kg/m3). This corrects a systematic depth-dependent bias: shallow crustal events (alpha~6400 m/s) were previously underestimated and deep mantle events (alpha~11000 m/s) overestimated. All changes are backward compatible. Without configuration overrides the processor behaves identically to the previous implementation except for the PREM depth correction which is always active. New description XML global_Mwp.xml exposes the configurable parameters in scconfig.
gempa-jabe
reviewed
May 8, 2026
gempa-jabe
reviewed
May 8, 2026
gempa-jabe
reviewed
May 8, 2026
Per gempa-jabe review on PR SeisComP#197: - Remove module.trunk. fallback from both setup() functions; localConfiguration reads bare keys directly and the module.trunk. prefix is an internal bindings mechanism that should never be constructed manually - Add whitespace around * in amplitude expression (1.E9 * Mwp_...)
Contributor
Author
|
I need to exclude one of the change which is not backward compatible. Coming up. |
The PREM α/ρ lookup changes compute_Mwp output by up to 0.24 mag for shallow events — a backward-incompatible behaviour change that belongs in a separate, follow-on PR together with the depth-stratified regression coefficients calibrated against it. This PR is now purely additive: useFirstPeak and the estimateMw coefficients are configurable but default values are unchanged from the original SeisComP behaviour.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
amplitudes.Mwp.useFirstPeak(boolean, defaultfalse) — option to use the first local maximum of the doubly-integrated displacement after the P arrival, as specified in the original Tsuboi et al. (1995) algorithm, instead of the global maximum. Defaultfalsepreserves backward compatibility. The global maximum can be inflated by later arrivals (PP, pP, surface reflections) for large events, contributing to Mwp saturation at M > 7.5.magnitudes.Mwp.estimateMw.a/b/stdError(double) — the Mw(Mwp) linear correction coefficients from Whitmore et al. (2002) (a=1.186,b=-1.222,stdError=0.4) were hardcoded with a// Fixmecomment. They are now readable fromglobal.cfg, allowing operators to apply updated calibrations from larger or more recent datasets without recompiling. Defaults are unchanged.global_Mwp.xml— new description file exposesuseFirstPeakandestimateMw.*in scconfig.Backward compatibility
This PR is purely additive. Without any configuration changes the processor output is identical to the previous implementation in all cases.
References
Test plan
amplitudes.Mwp.useFirstPeak = trueconfirmed via scamp debug log:+ useFirstPeak = trueglobal_Mwp.xmlparameters visible in scconfig