QuakeML 1.2 Specification Comparison Reportο
This document provides a comprehensive comparison between the official QuakeML 1.2 Basic Event Description (BED)
specification and our TypeScript implementation in lib/types/quakeml.ts.
Overviewο
QuakeML is an XML-based data exchange format for seismological data developed by the seismological community. The QuakeML 1.2 BED (Basic Event Description) schema defines the structure for representing earthquake event data including origins, magnitudes, picks, arrivals, focal mechanisms, and moment tensors.
Official Specification: https://quake.ethz.ch/quakeml/
Our Implementation: lib/types/quakeml.ts
Implementation Status Summaryο
Category |
Status |
Notes |
|---|---|---|
Base Types (RealQuantity, TimeQuantity, etc.) |
Fully Supported |
All uncertainty fields included |
Event Types |
Fully Supported |
All 47+ event types from specification |
Event Description |
Fully Supported |
All description types supported |
Origin |
Fully Supported |
Includes CompositeTime for historical events |
Origin Quality |
Fully Supported |
All 12 quality metrics |
Origin Uncertainty |
Fully Supported |
Includes confidence ellipsoid |
Magnitude |
Fully Supported |
Includes station magnitude contributions |
Station Magnitude |
Fully Supported |
Includes comment field |
Pick |
Fully Supported |
All onset and polarity types |
Arrival |
Fully Supported |
All residual and weight fields |
Amplitude |
Fully Supported |
Includes TimeWindow |
Focal Mechanism |
Fully Supported |
Includes waveformID array |
Moment Tensor |
Fully Supported |
Includes DataUsed for inversion details |
Nodal Planes |
Fully Supported |
Both planes with preferred indicator |
Principal Axes |
Fully Supported |
T, P, N axes with uncertainties |
Recently Added Fields (Session Updates)ο
The following 5 fields were recently added to achieve fuller QuakeML 1.2 compliance:
1. CompositeTime Interface NEWο
Purpose: Represents time of rupture start for complex, historic, or poorly constrained events where the exact time is uncertain but individual components (year, month, day, etc.) may be known with different levels of precision.
QuakeML Specification Reference: Section 3.2.4 - CompositeTime
TypeScript Interface:
export interface CompositeTime {
year?: IntegerQuantity;
month?: IntegerQuantity;
day?: IntegerQuantity;
hour?: IntegerQuantity;
minute?: IntegerQuantity;
second?: RealQuantity;
}
Added to: Origin interface as compositeTime?: CompositeTime[]
Use Case: Historical earthquakes where only the year or approximate date is known.
Example QuakeML:
<origin publicID="smi:example/origin/1">
<time>
<value>1906-04-18T05:12:21Z</value>
<uncertainty>60</uncertainty>
</time>
<compositeTime>
<year>
<value>1906</value>
</year>
<month>
<value>4</value>
</month>
<day>
<value>18</value>
<uncertainty>1</uncertainty>
</day>
</compositeTime>
<!-- ... other fields -->
</origin>
2. StationMagnitudeContribution Interface NEWο
Purpose: Describes the contribution of a single station magnitude to a network magnitude calculation, including residual and weight information.
QuakeML Specification Reference: Section 3.4.2 - StationMagnitudeContribution
TypeScript Interface:
export interface StationMagnitudeContribution {
stationMagnitudeID: string;
residual?: number;
weight?: number;
}
Added to: Magnitude interface as stationMagnitudeContributions?: StationMagnitudeContribution[]
Use Case: Understanding which stations contributed to a network magnitude and their relative weights.
Example QuakeML:
<magnitude publicID="smi:example/magnitude/mw/1">
<mag>
<value>6.5</value>
<uncertainty>0.1</uncertainty>
</mag>
<type>Mw</type>
<stationCount>15</stationCount>
<stationMagnitudeContribution>
<stationMagnitudeID>smi:example/stationmag/1</stationMagnitudeID>
<residual>0.05</residual>
<weight>1.0</weight>
</stationMagnitudeContribution>
<stationMagnitudeContribution>
<stationMagnitudeID>smi:example/stationmag/2</stationMagnitudeID>
<residual>-0.12</residual>
<weight>0.8</weight>
</stationMagnitudeContribution>
</magnitude>
4. DataUsed Interface in MomentTensor NEWο
Purpose: Describes the data used in a moment tensor inversion, including wave type, station count, component count, and period range.
QuakeML Specification Reference: Section 3.5.3 - DataUsed
TypeScript Interfaces:
export type DataUsedWaveType =
| 'P waves'
| 'body waves'
| 'surface waves'
| 'mantle waves'
| 'combined';
export interface DataUsed {
waveType: DataUsedWaveType;
stationCount?: number;
componentCount?: number;
shortestPeriod?: number;
longestPeriod?: number;
}
Added to: MomentTensor interface as dataUsed?: DataUsed[]
Use Case: Documenting what seismic data was used to derive a moment tensor solution.
Example QuakeML:
<momentTensor publicID="smi:example/mt/1">
<derivedOriginID>smi:example/origin/1</derivedOriginID>
<scalarMoment>
<value>1.2e19</value>
</scalarMoment>
<dataUsed>
<waveType>body waves</waveType>
<stationCount>45</stationCount>
<componentCount>90</componentCount>
<shortestPeriod>40</shortestPeriod>
<longestPeriod>150</longestPeriod>
</dataUsed>
<dataUsed>
<waveType>surface waves</waveType>
<stationCount>32</stationCount>
<componentCount>64</componentCount>
<shortestPeriod>50</shortestPeriod>
<longestPeriod>300</longestPeriod>
</dataUsed>
<tensor>
<Mrr><value>1.1e19</value></Mrr>
<Mtt><value>-0.5e19</value></Mtt>
<Mpp><value>-0.6e19</value></Mpp>
<Mrt><value>0.3e19</value></Mrt>
<Mrp><value>0.4e19</value></Mrp>
<Mtp><value>-0.2e19</value></Mtp>
</tensor>
</momentTensor>
5. WaveformID Array in FocalMechanism NEWο
Purpose: References the waveforms used in the focal mechanism determination, linking back to the actual seismic data used in the analysis.
QuakeML Specification Reference: Section 3.5.1 - FocalMechanism (waveformID child element)
TypeScript Change:
export interface FocalMechanism {
publicID: string;
triggeringOriginID?: string;
nodalPlanes?: NodalPlanes;
principalAxes?: PrincipalAxes;
azimuthalGap?: number;
stationPolarityCount?: number;
misfit?: number;
stationDistributionRatio?: number;
methodID?: string;
momentTensor?: MomentTensor;
evaluationMode?: EvaluationMode;
evaluationStatus?: EvaluationStatus;
creationInfo?: CreationInfo;
comment?: Comment[];
waveformID?: WaveformStreamID[]; // NEW: Waveforms used in determination
}
Use Case: Tracing which waveforms contributed to a focal mechanism solution for quality assessment.
Example QuakeML:
<focalMechanism publicID="smi:example/focalmech/1">
<triggeringOriginID>smi:example/origin/1</triggeringOriginID>
<nodalPlanes>
<nodalPlane1>
<strike><value>215</value></strike>
<dip><value>45</value></dip>
<rake><value>90</value></rake>
</nodalPlane1>
<nodalPlane2>
<strike><value>35</value></strike>
<dip><value>45</value></dip>
<rake><value>90</value></rake>
</nodalPlane2>
</nodalPlanes>
<stationPolarityCount>25</stationPolarityCount>
<waveformID networkCode="NZ" stationCode="WEL" channelCode="HHZ"/>
<waveformID networkCode="NZ" stationCode="SNZO" channelCode="HHZ"/>
<waveformID networkCode="NZ" stationCode="BFZ" channelCode="HHZ"/>
</focalMechanism>
Complete Field Mapping Referenceο
Base Typesο
QuakeML Element |
TypeScript Interface |
Fields |
|---|---|---|
RealQuantity |
|
value, uncertainty, lowerUncertainty, upperUncertainty, confidenceLevel |
TimeQuantity |
|
value (ISO 8601), uncertainty, lowerUncertainty, upperUncertainty, confidenceLevel |
IntegerQuantity |
|
value, uncertainty, lowerUncertainty, upperUncertainty, confidenceLevel |
CreationInfo |
|
agencyID, agencyURI, author, authorURI, creationTime, version |
Comment |
|
text, id, creationInfo |
WaveformStreamID |
|
networkCode, stationCode, locationCode, channelCode, resourceURI |
Event Typesο
Our implementation supports all 47+ event types defined in QuakeML 1.2:
export type EventType =
| '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';
Event Structureο
QuakeML Element |
TypeScript Field |
Description |
|---|---|---|
publicID (attribute) |
|
Unique resource identifier |
preferredOriginID |
|
Reference to preferred origin |
preferredMagnitudeID |
|
Reference to preferred magnitude |
preferredFocalMechanismID |
|
Reference to preferred focal mechanism |
type |
|
Event classification |
typeCertainty |
|
known or suspected |
description |
|
Array of descriptions |
comment |
|
Array of comments |
creationInfo |
|
Creation metadata |
origin |
|
Array of origins |
magnitude |
|
Array of magnitudes |
stationMagnitude |
|
Array of station magnitudes |
pick |
|
Array of picks |
amplitude |
|
Array of amplitudes |
focalMechanism |
|
Array of focal mechanisms |
Origin Structureο
QuakeML Element |
TypeScript Field |
Description |
|---|---|---|
publicID |
|
Unique identifier |
time |
|
Origin time with uncertainty |
latitude |
|
Epicenter latitude |
longitude |
|
Epicenter longitude |
depth |
|
Hypocenter depth |
depthType |
|
How depth was determined |
timeFixed |
|
Whether time was fixed |
epicenterFixed |
|
Whether epicenter was fixed |
referenceSystemID |
|
Coordinate system reference |
methodID |
|
Location method |
earthModelID |
|
Earth model used |
quality |
|
Quality metrics |
originUncertainty |
|
Location uncertainty |
type |
|
Origin type |
region |
|
Geographic region |
evaluationMode |
|
manual/automatic |
evaluationStatus |
|
preliminary/confirmed/reviewed/final/rejected |
creationInfo |
|
Creation metadata |
comment |
|
Array of comments |
arrival |
|
Associated arrivals |
compositeTime NEW |
|
For historical/uncertain times |
Magnitude Structureο
QuakeML Element |
TypeScript Field |
Description |
|---|---|---|
publicID |
|
Unique identifier |
mag |
|
Magnitude value with uncertainty |
type |
|
Magnitude type (ML, Mw, mb, Ms, etc.) |
originID |
|
Reference to origin |
methodID |
|
Calculation method |
stationCount |
|
Number of stations used |
azimuthalGap |
|
Largest gap in azimuth coverage |
evaluationMode |
|
manual/automatic |
evaluationStatus |
|
Status of evaluation |
creationInfo |
|
Creation metadata |
comment |
|
Array of comments |
stationMagnitudeContribution NEW |
|
Station contributions |
Focal Mechanism Structureο
QuakeML Element |
TypeScript Field |
Description |
|---|---|---|
publicID |
|
Unique identifier |
triggeringOriginID |
|
Reference to triggering origin |
nodalPlanes |
|
Two nodal planes |
principalAxes |
|
T, P, N axes |
azimuthalGap |
|
Largest gap in station azimuth |
stationPolarityCount |
|
Number of polarities used |
misfit |
|
Solution misfit |
stationDistributionRatio |
|
Station distribution quality |
methodID |
|
Method used |
momentTensor |
|
Full moment tensor |
evaluationMode |
|
manual/automatic |
evaluationStatus |
|
Status of evaluation |
creationInfo |
|
Creation metadata |
comment |
|
Array of comments |
waveformID NEW |
|
Waveforms used |
Moment Tensor Structureο
QuakeML Element |
TypeScript Field |
Description |
|---|---|---|
publicID |
|
Unique identifier |
derivedOriginID |
|
Origin derived from MT |
momentMagnitudeID |
|
Associated Mw magnitude |
scalarMoment |
|
Scalar seismic moment |
tensor |
|
Six moment tensor components |
variance |
|
Solution variance |
varianceReduction |
|
Variance reduction |
doubleCouple |
|
Double-couple percentage |
clvd |
|
CLVD percentage |
iso |
|
Isotropic percentage |
greensFunctionID |
|
Greenβs functions used |
filterID |
|
Filter applied |
sourceTimeFunction |
|
Source time function |
methodID |
|
Inversion method |
category |
|
MT category |
inversionType |
|
Type of inversion |
creationInfo |
|
Creation metadata |
dataUsed NEW |
|
Data used in inversion |
Unsupported/Not Applicable Fieldsο
The following QuakeML 1.2 BED elements are intentionally not implemented as they are rarely used or require specialized handling:
Element |
Reason |
|---|---|
ResourceReference |
Handled as string type for flexibility |
OriginDepthType (some variants) |
We support the common subset; exotic variants rarely used |
EventParameters |
Our QuakeMLEvent serves as the top-level container |
All fields listed in the QuakeML 1.2 BED specification that are commonly used in seismological data exchange are fully supported.
Example: Complete QuakeML Eventο
The following example demonstrates how a complex QuakeML event maps to our TypeScript interfaces:
<?xml version="1.0" encoding="UTF-8"?>
<quakeml xmlns="http://quakeml.org/xmlns/bed/1.2">
<eventParameters publicID="smi:example/eventparams/1">
<event publicID="smi:example/event/2024p001234">
<preferredOriginID>smi:example/origin/1</preferredOriginID>
<preferredMagnitudeID>smi:example/magnitude/mw/1</preferredMagnitudeID>
<preferredFocalMechanismID>smi:example/focalmech/1</preferredFocalMechanismID>
<type>earthquake</type>
<typeCertainty>known</typeCertainty>
<description>
<text>40 km NE of Wellington</text>
<type>region name</type>
</description>
<origin publicID="smi:example/origin/1">
<time>
<value>2024-01-15T10:30:45.123Z</value>
<uncertainty>0.5</uncertainty>
</time>
<latitude>
<value>-41.2345</value>
<uncertainty>0.01</uncertainty>
</latitude>
<longitude>
<value>174.7890</value>
<uncertainty>0.01</uncertainty>
</longitude>
<depth>
<value>25000</value>
<uncertainty>2000</uncertainty>
</depth>
<quality>
<usedPhaseCount>45</usedPhaseCount>
<usedStationCount>32</usedStationCount>
<standardError>0.8</standardError>
<azimuthalGap>45</azimuthalGap>
</quality>
<evaluationMode>manual</evaluationMode>
<evaluationStatus>reviewed</evaluationStatus>
</origin>
<magnitude publicID="smi:example/magnitude/mw/1">
<mag>
<value>5.8</value>
<uncertainty>0.1</uncertainty>
</mag>
<type>Mw</type>
<originID>smi:example/origin/1</originID>
<stationCount>25</stationCount>
<stationMagnitudeContribution>
<stationMagnitudeID>smi:example/stationmag/1</stationMagnitudeID>
<residual>0.05</residual>
<weight>1.0</weight>
</stationMagnitudeContribution>
</magnitude>
<focalMechanism publicID="smi:example/focalmech/1">
<triggeringOriginID>smi:example/origin/1</triggeringOriginID>
<nodalPlanes>
<nodalPlane1>
<strike><value>215</value><uncertainty>5</uncertainty></strike>
<dip><value>45</value><uncertainty>3</uncertainty></dip>
<rake><value>90</value><uncertainty>10</uncertainty></rake>
</nodalPlane1>
<preferredPlane>1</preferredPlane>
</nodalPlanes>
<momentTensor>
<derivedOriginID>smi:example/origin/1</derivedOriginID>
<scalarMoment><value>5.6e17</value></scalarMoment>
<doubleCouple>0.92</doubleCouple>
<dataUsed>
<waveType>body waves</waveType>
<stationCount>45</stationCount>
</dataUsed>
</momentTensor>
<waveformID networkCode="NZ" stationCode="WEL" channelCode="HHZ"/>
</focalMechanism>
</event>
</eventParameters>
</quakeml>
Corresponding TypeScript Object:
const event: QuakeMLEvent = {
publicID: 'smi:example/event/2024p001234',
preferredOriginID: 'smi:example/origin/1',
preferredMagnitudeID: 'smi:example/magnitude/mw/1',
preferredFocalMechanismID: 'smi:example/focalmech/1',
type: 'earthquake',
typeCertainty: 'known',
description: [
{ text: '40 km NE of Wellington', type: 'region name' }
],
origins: [{
publicID: 'smi:example/origin/1',
time: { value: '2024-01-15T10:30:45.123Z', uncertainty: 0.5 },
latitude: { value: -41.2345, uncertainty: 0.01 },
longitude: { value: 174.7890, uncertainty: 0.01 },
depth: { value: 25000, uncertainty: 2000 },
quality: {
usedPhaseCount: 45,
usedStationCount: 32,
standardError: 0.8,
azimuthalGap: 45
},
evaluationMode: 'manual',
evaluationStatus: 'reviewed'
}],
magnitudes: [{
publicID: 'smi:example/magnitude/mw/1',
mag: { value: 5.8, uncertainty: 0.1 },
type: 'Mw',
originID: 'smi:example/origin/1',
stationCount: 25,
stationMagnitudeContributions: [{
stationMagnitudeID: 'smi:example/stationmag/1',
residual: 0.05,
weight: 1.0
}]
}],
focalMechanisms: [{
publicID: 'smi:example/focalmech/1',
triggeringOriginID: 'smi:example/origin/1',
nodalPlanes: {
nodalPlane1: {
strike: { value: 215, uncertainty: 5 },
dip: { value: 45, uncertainty: 3 },
rake: { value: 90, uncertainty: 10 }
},
preferredPlane: 1
},
momentTensor: {
derivedOriginID: 'smi:example/origin/1',
scalarMoment: { value: 5.6e17 },
doubleCouple: 0.92,
dataUsed: [{
waveType: 'body waves',
stationCount: 45
}]
},
waveformID: [{
networkCode: 'NZ',
stationCode: 'WEL',
channelCode: 'HHZ'
}]
}]
};
Referencesο
Implementation:
lib/types/quakeml.ts
3. Comment Field in StationMagnitude NEWο
Purpose: Allows adding comments to individual station magnitude measurements for quality notes, processing details, or analyst remarks.
QuakeML Specification Reference: Section 3.4.3 - StationMagnitude (comment child element)
TypeScript Change:
Use Case: Documenting why a particular station magnitude was excluded or weighted differently.
Example QuakeML: