SeisComP3 / seiscomp3

SeisComP is a seismological software for data acquisition, processing, distribution and interactive analysis.
Other
111 stars 88 forks source link

Incorrect event type in SC3ML to QuakeML 1.2 XSLT #140

Closed gclitheroe closed 6 years ago

gclitheroe commented 7 years ago

This bug affects the XSLT transformation from SC3ML to QuakeML XSLT transformations. I couldn't find the files to raise a PR against so I'm raising an issue instead (sorry).

When the event type in the XSLT is mapped to other it should be other event. This is the allowed type in QuakeML 1.2.

e.g., instead of:

<!-- event type, enumeration differs slightly -->
    <xsl:template match="scs:event/scs:type">
        <xsl:element name="{local-name()}">
            <xsl:variable name="v" select="current()"/>
            <xsl:choose>
                <xsl:when test="$v='induced earthquake'">induced or triggered event</xsl:when>
                <xsl:when test="$v='meteor impact'">meteorite</xsl:when>
                <xsl:when test="$v='not locatable'">other</xsl:when>
                <xsl:when test="$v='outside of network interest'">other</xsl:when>
                <xsl:when test="$v='duplicate'">other</xsl:when>
                <xsl:otherwise><xsl:value-of select="$v"/></xsl:otherwise>
            </xsl:choose>
        </xsl:element>
    </xsl:template>

the mapping should be like:

<!-- event type, enumeration differs slightly -->
    <xsl:template match="scs:event/scs:type">
        <xsl:element name="{local-name()}">
            <xsl:variable name="v" select="current()"/>
            <xsl:choose>
                <xsl:when test="$v='induced earthquake'">induced or triggered event</xsl:when>
                <xsl:when test="$v='meteor impact'">meteorite</xsl:when>
                <xsl:when test="$v='not locatable'">other event</xsl:when>
                <xsl:when test="$v='outside of network interest'">other event</xsl:when>
                <xsl:when test="$v='duplicate'">other event</xsl:when>
                <xsl:otherwise><xsl:value-of select="$v"/></xsl:otherwise>
            </xsl:choose>
        </xsl:element>
    </xsl:template>

This affects all the XSLT:

http://geofon.gfz-potsdam.de/ns/seiscomp3-schema/0.7/sc3ml_0.7__quakeml_1.2.xsl http://geofon.gfz-potsdam.de/ns/seiscomp3-schema/0.8/sc3ml_0.8__quakeml_1.2.xsl http://geofon.gfz-potsdam.de/ns/seiscomp3-schema/0.9/sc3ml_0.9__quakeml_1.2.xsl

gempa-stephan commented 7 years ago

Thanks for reporting this error. We just uploaded new versions of the XSLT scripts which include additional improvements reported at https://github.com/obspy/obspy/pull/1873