Weird interpolation for vectors in different time base

Bug #1258878 reported by sdaau
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kst (Ubuntu)
New
Undecided
Unassigned

Bug Description

As I don't have the possibility right now to register an account at KDE Bug Tracking System, I'll try posting here. This is possibly not a bug, but a problem in my expectations - but I thought I'd report it anyway.

I generate some data using the following Perl script:

    $step = 0.01;

    open my $F1, '>/tmp/dat1.txt';
    open my $F2, '>/tmp/dat2.txt';

    for ($ix=0;$ix<100;$ix++) {
      $it = $ix * $step;
      if ($ix%3==0) {
        print {$F1} "$it $ix\n";
      } else {
        print {$F2} "$it\n";
      }
    }

    close $F1;
    close $F2;

`dat1.txt` represents some data with few samples, timestamps in column 1, and values in column 2; `dat2.txt` represents some different values in time I'd like to interpolate `dat1.txt` onto. As I had some problems with subtracting other data fitting this format, I originally thought that `kst` interpolates vectors sample by sample, as discussed in this post:

http://stackoverflow.com/questions/20448790/subtracting-two-interleaved-differently-based-time-series-arrays-with-numpy

... but actually it seems to be due to this "weird" result of interpolation. In the screenshot in the attachment below, you can see `dat1` with blue line/points; and the interpolation should be in red - I'd expect the interpolation to be the exact same blue line, just defined in different points - but you can see some distance between the lines; and further, the red line has a sort of a step behavior. In any case, I don't see why the red points should deviate from that line at all.

This is the procedure I used to generate the image: since due to

[https://bugs.launchpad.net/ubuntu/+source/kst/+bug/1258869 Bug #1258869 “KST cpu hog (100%) on Gnome natty/lucid " : Bugs : “kst” package : Ubuntu]

... I use Windows version of `kst`under `wine`, first I try to load up both data files:

    wine ~/.wine/dosdevices/c\:/Program\ Files/Kst\ 2.0.7/bin/kst2.exe /tmp/dat1.txt -x 1 -d -y 2 /tmp/dat2.txt -x 2

... this will only import dat1.txt and plot it (with points); so dat2.txt has to be imported manually, through the GUI:

# Click Create/Vector;
  # Name: uncheck Auto, name as "ts2"
  # Filename: /tmp/dat2.txt
  # Field or column: Column 1
  # Read to End + Ok
# Click Data Manager:
  # Double-click "Column 1" from dat1.txt, uncheck Auto for name, rename as "ts1"
  # Double-click "Column 2" from dat1.txt, uncheck Auto for name, rename as "val1"
  # Close Data Manager
# ts1, val1 should be 34 in length; ts2 should be 66 in length
# Click Create/Equation
  # Equation: type/choose [val1 (V2)]
  # X vector: ts2 (V3)
  # Check: Interpolate to highest resolution vector
  # From Appearance, choose Lines and Points; make color red
  # From Placement - place in existing plot
  # Click OK
# Right-click plot - Edit curve - val1 vs ts1
  # From Appearance - it's already on points, maybe choose another; add lines; make it blue
# File/Export as image(s)... (png)

Maybe I expect too much of the equation "[val1 (V2)]"/"ts2 (V3)" - but seeing "interpolate" there makes me think it would do a proper interpolation; and seemingly it doesn't. Please forgive (and explain) if it's not a bug :)
Cheers!

Revision history for this message
sdaau (sd-imi) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.