Bug 142895

Summary: Over sampling of data gives misleading information
Product: [Applications] kst Reporter: Andrew Walker <arwalker>
Component: generalAssignee: Netterfield <netterfield>
Status: RESOLVED FIXED    
Severity: normal CC: kst
Priority: NOR    
Version: 1.x   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Data and screenshor demonstrating nature of problem...
Proposed fix

Description Andrew Walker 2007-03-13 01:51:55 UTC
Version:           HEAD (using KDE KDE 3.5.1)
Installed from:    Compiled From Sources
OS:                Linux

PROBLEM:

In cases where two vectors of different lengths are plotted one against the other the data may not be interpolated correctly. Ideally the user should be given the option of down-sampling or up-sampling.

STEPS TO REPRODUCE:

Start Kst
Select a datasource that has (for example) temperature values at 0.1 intervals sampled at 1 Hz and voltage values sampled at 5Hz. 
Plot voltage against temperature

ACTUAL RESULTS:

The temperature values are up-sampled to those of the voltage values.

EXPECTED RESULTS:

The voltage values are down-sampled to those of the temperature values.
Comment 1 Andrew Walker 2007-03-13 02:05:15 UTC
*** Bug 142896 has been marked as a duplicate of this bug. ***
Comment 2 Andrew Walker 2007-03-13 21:23:03 UTC
Created attachment 19963 [details]
Data and screenshor demonstrating nature of problem...

The attachment gives datasets and screenshot. The upper plot is what is
generated by default when the temperature is plotted against voltage. The lower
plot is what might be expected to be generated (and was created via an equation
to generate the correct interpolation).

At a minimum the user should have the option to simply create the lower plot by
overriding the default interpolation behaviour.
Comment 3 Netterfield 2007-03-13 22:32:12 UTC
Good catch. This should be fixed in the 1.4 series, if not in 1.4.0.

So: Fixing this involves the addition of a string.
Technical question: if, in the curve dialog, we use the exact string as is currently used in the equation dialog for the same purpose, will this result in a change for the translators?
Comment 4 George Staikos 2007-03-13 23:16:59 UTC
I believe it will not be a problem.

--
George Staikos
KDE Developer				http://www.kde.org/
Staikos Computing Services Inc.		http://www.staikos.net/
Comment 5 Nicolas Brisset 2007-03-14 16:04:03 UTC
This automatic interpolation with addition of non-physical points is something we also had problems with. I'm glad to see it's being worked on :-)
I have not tested the patch, but I'd like to ask some questions:
1) does a window pop up to ask what to do or is there a default and a place in a dialog where it can be changed ?
2) is the default configurable in the settings ?
3) does this apply to (slave vectors from) equations as well ? That's where we got into trouble: in spite of what the "do not interpolate" checkbox seemed to imply, kst did still interpolate in some cases...
Comment 6 Netterfield 2007-03-14 17:12:29 UTC
I hope to have a patch today or tomorrow (subway seating dependant...)
Comment 7 Netterfield 2007-03-16 15:29:12 UTC
Created attachment 19996 [details]
Proposed fix

Here is a patch: most of the invasiveness is UI.

-It adds to the curve dialog a combobox to set the interpolation policy:
Y axis, X axis, highest resolution, and lowest resolution.  A combo box was
used because radio buttons don't have a tri-state option.

-The default in the UI is now 'Y axis' rather than highest resolutions: this
alone would have 'fixed' the behavior reported in the bug. Older .kst files get
read as highest resolution, which was the old method.

No stickyness has been added to the new curve dialog.

Some questionable points:
-kstvcurve uses an enum for the mode.  The UI casts the enum value from the
order in the combo box - so... if someone changes the order of options in the
combo, things will break.  Alternatives are messy.
Comment 8 Andrew Walker 2007-03-16 22:34:09 UTC
Looks good to me. 

My only (rather pedantic) suggestion would be that the choices should be
Higher Resolution Vector and Lower Resolution Vector (as there are only two of them).
Comment 9 Andrew Walker 2007-03-22 18:39:03 UTC
Is this going to be checked in for the upcoming release?
Comment 10 Netterfield 2007-03-22 19:15:54 UTC
right... I forgot... I'll commit (with Andrew's recomended change).

cbn

On Thursday 22 March 2007 1:39:05 pm Andrew Walker wrote:
[bugs.kde.org quoted mail]
Comment 11 Netterfield 2007-03-27 03:23:27 UTC
SVN commit 646988 by netterfield:

BUG: 142895

fix: reviewed by Andrew.



 M  +195 -108  libkstapp/curvedialogwidget.ui  
 M  +19 -2     libkstapp/kstcurvedialog_i.cpp  
 M  +1 -0      libkstapp/kstcurvedialog_i.h  
 M  +31 -1     libkstmath/kstvcurve.cpp  
 M  +10 -3     libkstmath/kstvcurve.h