

XML, the eXtensible Markup Language has become the standard format for transferring data between computers and organizations because it is a clearly-defined way to structure, describe, and exchange data. The rapid proliferation of XML and the large number of XML parsers that can be freely integrated into applications has made XML a good format option for the Data Center to distribute seismic data.
XML is a "self-describing" format because individual elements are marked by start- and end-tags that provide information about their contents. Although XML is flexible in the elements it allows to be defined, it is very strict about the grammar contained within XML documents. The markup permitted in a particular XML document and individual document is defined in the source schema.
The X in XML stands for eXtensible, so the language can be adapted to meet many needs, and XML's flexible nature allows the file format to expand ad infinitum, while maintaining backward compatibility with older file versions.
The most common applications of XML involve the transmission of information for use by different software applications and systems. The SCEDC is putting effort into XML distribution of seismic data because we anticipate tremendous benefits associated with this method of flexible data exchange between distributed systems.
Why use XML for earthquake data?
- The SCSN produces a wide range of earthquake products, solutions and additional data that are archived in the SCEDC database. Without XML, the SCEDC is restricted to HTML, CSV or other character- or space-delimited formats for displaying and distributing the contents of our database. With the freedom of an extensible format, we have the capability to distribute a much wider range of data than we did previously.
- XML allows information filtering, so researchers can use XML filters to parse for elements that are of interest to their research project, and ignore elements that are not. This allows the Data Center to include a wider range of elements and attributes in the earthquake information we distribute than we have in the past.
- XML documents are self-describing and can be validated by a well-documented schema. Station metadata and earthquake event parameters can be described very differently by different organizations, but if the individual elements are well described in an XML schema, the sender and receiver can communicate with a common vocabulary.
XML offers a truly cross-platform, straightforward, long-term data-exchange format. XML documents are text, and can be read with any tool that can read a text file (not just the data, but the markup as well). In the long term, we are all better off if we can use the cleanly documented, well-understood, easy to parse, text-based formats that XML provides.
Current XML capabilities at the SCEDC
The SCEDC XML schema is located at:
http://www.data.scec.org/xml/event.xsd
Documentation of the schema is available at:
http://www.data.scec.org/xml/event
The SCEDC currently provides event and phase data in XML format from the catalog search pages on the Internet, and via the STP client.
Catalog Search
From the SCEDC catalog search pages at: http://www.data.scec.org/catalog_search/ select "XML" from the Search Format drop-down menu. Before you click the "Submit Results" button, you can click the button to either download the results of your query to a file on your computer, or output to the web page (the default option) to display the results in your web browser in XML format.
STP
To output the results of a query in XML, type 'XML' at the STP prompt. To return to normal output, type "NORM" The STP format will output the results of the phase and event command XML into a named file. For instance,
STP> XML
STP> event -f event.xml -t0 2004/09/20 2004/09/30 -type le -mag 3.0 6.0
This command will output a file named event.xml (the -f flag writes the user-defined-named file to the current directory) containing all local events between magnitude 3.0 and 6.0.
<?xml version="1.0" encoding="utf-8" ?>
<event_begin xsi:noNamespaceSchemaLocation="http://www.data.scec.org/xml/event.xsd">
<event unique_id="CI_10048137">
<location unique_id="CI_12310812">
<origin_time>2004-09-24T06:28:43.760Z</origin_time>
<latitude unit="degree">31.881000</latitude>
<longitude unit="degree">-115.742667</longitude>
<depth unit="km">6.000000</depth>
<magnitude unit="Ml">3.120000</magnitude>
<region>le</region>
</location>
</event>
<event unique_id="CI_14095628">
<location unique_id="CI_12313500">
<origin_time>2004-09-29T22:54:54.240Z</origin_time>
<latitude unit="degree">35.389833</latitude>
<longitude unit="degree">-118.623500</longitude>
<depth unit="km">3.550000</depth>
<magnitude unit="Ml">5.040000</magnitude>
<region>le</region>
</location>
</event>
</event_begin>
This is the same query displayed in the NORM output in STP:
STP> NORM
STP> event -t0 2004/09/20 2004/09/30 -type le -mag 3.0 6.0
10048137 le 2004/09/24,06:28:43.760 31.8810 -115.7427 6.00 3.12 l 0.5
14095628 le 2004/09/29,22:54:54.240 35.3898 -118.6235 3.55 5.04 l 1.0
# Number of events= 2
From this file, we see may be interested in the 5.04 event and want the phases for this event. We can get phases for event 14095628 with the following STP command:
STP> phase -f phase_14095628.xml -e 14095628
<?xml version="1.0" encoding="utf-8" ?>
<event_begin xsi:noNamespaceSchemaLocation="http://www.data.scec.org/xml/event.xsd">
</event>
<event unique_id="CI_14095628">
<location unique_id="CI_12313500">
<origin_time>2004-09-29T22:54:54.240Z</origin_time>
<latitude unit="degree">35.389833</latitude>
<longitude unit="degree">-118.623500</longitude>
<depth unit="km">3.550000</depth>
<magnitude unit="Ml">5.040000;</magnitude>
<region>le</region>
</location>
<phase_info>
<network>CI</network>
<station>WMF</station>
<channel>EHZ</channel>
<latitude>36.117740</latitude>
<longitude>-117.854840</longitude>
<elevation>1513.000000</elevation>
<phase_type>P</phase_type>
<first_motion>c.</first_motion>
<signal_onset>i</signal_onset>
<quality_pick>0.800000</quality_pick>
<epicen_dist>3.673922</epicen_dist>
<after_o_time>1.016790</after_o_time>
</phase_info>
<phase_info>
<network>CI</network>
<station>WRV</station>
[...]
</phase_info>
</event>
</event_begin>
This is the same query displayed in the NORM output in STP:
STP> phase -e 14095628
14095628 le 2004/09/29,22:54:54.240 35.3898 -118.6235 3.55 5.04 l 1.0
CI WOF EHZ 35.5354 -118.7135 1306.0 P d. i 1.0 18.12 3.248
CI TEJ EHZ 35.2311 -118.6888 844.0 P c. i 1.0 18.60 3.199
[...]
Please send any questions, comments and suggestions about this project to Vikki Appel:
|