gdi-trigger Atom extensions


  1. Introduction
  2. Structure with example
  3. XSLT files

Introduction

The gdi-trigger subsystem of the Platinum firmware will record events in response to a trigger signal (such as a waveform value exceeding a threshold). A CGI program present in the firmware can be used to generate an Atom feed that presents a list of these events to a compatible reader. This can be an off-the-shelf RSS reader, for example:

Screenshot of RSS reader displaying gdi-trigger Atom feed

The Atom feed is further extended with XML elements that allow a program to reliably extract information from the feed. This uses the built-in extension features of Atom (see RFC 4287 section 6 for full details). These are explained below.


Structure with example

Within the Atom feed entries a simple set of elements is embedded using the namespace http://www.guralp.com/platinum/xmlns/gdi-trig-atom.cgi/1.0 . In this truncated example, these elements are highlighted in red:



  Station ruthenium Trigger group 1
  
    ruthenium
    http://ruthenium/
  
  gdi-trig-atom.cgi
  urn:X-com.guralp.gdi-trigger.atom:d51806c543534878a316c64bfc983655/1
  
  2014-08-14T11:57:16Z

  
    Event at 20140814T115716Z
    urn:X-com.guralp.gdi-trigger.atom:d51806c543534878a316c64bfc983655/1/2014-08-14T11:57:16Z
    2014-08-14T11:57:16Z
    
    
      
]]><gt:event> Timestamp ]]><gt:timestamp>2014-08-14T11:57:16Z</gt:timestamp> Description ]]><gt:reason>Manual trigger</gt:reason> Duration ]]><gt:duration>0</gt:duration>
Parameter Instrument Component
E N Z
PFREQ.1 LW.CAD.1 ]]><gt:parameter instrument='LW.CAD.1' parameter='PFREQ.1' component='E'>34.800000</gt:parameter> ]]><gt:parameter instrument='LW.CAD.1' parameter='PFREQ.1' component='N'>34.800000</gt:parameter> ]]><gt:parameter instrument='LW.CAD.1' parameter='PFREQ.1' component='Z'>75.400000</gt:parameter>
]]></gt:event> ]]>

The structure is as follows:


XSLT files

To aid development of an automatic processing system, some example XSLT stylesheets are provided.

Extract to plain XML

When run on the Atom feed document, this stylesheet will return a very simple XML document which just has the raw event data. It basically just extracts the highlighted structures as shown above, but extracts the parameter attributes into XML elements for consistency.

Example output:



  
    2014-08-14T11:57:16Z
    0
    Manual trigger
    
      LW.CAD.1
      PFREQ.1
      E
      34.800000
    
    
      LW.CAD.1
      PFREQ.1
      N
      34.800000
    
    
  
  
    2014-08-14T11:52:20Z
    0
    Manual trigger
    
      LW.CAD.1
      PFREQ.1
      E
      37.700000
    
    
      LW.CAD.1
      PFREQ.1
      N
      37.700000
    
    
  

]]>

Build plain-text table

When run on the Atom feed document, this simple stylesheet builds a plain text table of the results. It can be modified to pull out different parameters with relative ease. Example output:

Timestamp               Duration        LW.CAD.1 PGA.1 (Z, N, E)
2014-08-14T11:57:16Z    0               75.400000, 34.800000, 34.800000
2014-08-14T11:52:20Z    0               75.400000, 37.700000, 37.700000
2014-08-14T11:51:21Z    0               75.400000, 37.700000, 37.700000
2014-08-14T11:48:28Z    0               88.200000, 37.700000, 75.300000
2014-08-14T11:43:11Z    0               75.200000, 42.600000, 37.600000
2014-08-14T11:00:28Z    0               75.400000, 85.200000, 37.700000
2014-08-14T10:24:38Z    0               36.000000, 84.400000, 36.000000