[PATCH] Properly identify siblings on UDDF export

Miika Turkia miika.turkia at gmail.com
Tue Apr 29 08:24:38 PDT 2014


UDDF export used all samples in the export when detecting previous
sample. This resulted in a very slow processing as we had to go through
massive amount of data for each event that's time was to be
approximated. The detection of previous sample was also erroneous
resulting in incorrect depth samples for the events in some occasions.
This patch should address these issues. And along with patch that
included pressure data on import this will fix the bug #499.

Well, the performance after the patch is still not stellar, but still
quite a difference with such a small change. The sample set of 8 dives
(with one event each) takes now less than 5 seconds instead of the
original 36 seconds (measured by doing the conversion with xsltproc).

Fixes #499

Signed-off-by: Miika Turkia <miika.turkia at gmail.com>
---
 xslt/uddf-export.xslt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xslt/uddf-export.xslt b/xslt/uddf-export.xslt
index e82b29d..3ab59e7 100644
--- a/xslt/uddf-export.xslt
+++ b/xslt/uddf-export.xslt
@@ -197,7 +197,7 @@
           <xsl:variable name="timefirst">
             <xsl:call-template name="time2sec">
               <xsl:with-param name="time">
-                <xsl:value-of select="//sample[position() = $position]/@time"/>
+                <xsl:value-of select="../sample[position() = $position]/@time"/>
               </xsl:with-param>
             </xsl:call-template>
           </xsl:variable>
@@ -225,7 +225,7 @@
           <xsl:variable name="depthfirst">
             <xsl:call-template name="depth2mm">
               <xsl:with-param name="depth">
-                <xsl:value-of select="//sample[position() = $position]/@depth"/>
+                <xsl:value-of select="../sample[position() = $position]/@depth"/>
               </xsl:with-param>
             </xsl:call-template>
           </xsl:variable>
-- 
1.8.3.2



More information about the subsurface mailing list