# [Kst] A use case for scripting?

Barth Netterfield netterfield at astro.utoronto.ca
Sat Jul 21 15:33:17 UTC 2012

```On Sat, Jul 21, 2012 at 7:25 AM, Nicolas Brisset <nicolas.brisset at free.fr>wrote:

> Hi,
>
> I've been using Kst lately to check the performance of some sensors
> against a known reference.
> Basically, what I do is: compute the error (difference between the 2
> signals), plot a histogram and compute the 2-sigma value of the error
> distribution.
> Where it hurts is that I have to do quite a few operations on each vetor.
> It's always the same, and quickly becomes tedious with the increasing
> number of vectors.
> What I'd dream of is being able to write a scripting function like
> checkAgainstReference(new_curve, reference_curve, new_column = true) which
> would:
> 1) check that x vectors and lengths are compatible
> 2) extract the y vectors from the curves
> 3) compute a new vector which is the difference of the previous y vectors
> 4) plot a histogram of the error
> 4) compute the absolute value of the error (without plotting)
> 5) compute a histogram of the absolute value of the error
> 6) compute a cumulative sum of the previous
> 7) create a new curve plotting the cumulative sum against the bin (x)
> vector of the histogram
> 8) create a new curve checking when the cumulative sum reaches 95%
> 9) use the 95% curve as a x-marker with a dotted red line in the
> cumulative sum plot
> 10) put all that either in a new column of a given tab (third arg at
> true), or create a new tab
>
> I can do all this manually and it works fine once you've figured out some
> of the details I left out here for the sake of brevity, so the question is
> not whether Kst can do it.
> I haven't really checked scripting yet, so the question is: could it solve
> my issue of having to repeat all those operations a large number of times?
> That would be totally awesome and make my colleague doing this in scilab
> pale with envy!
>
> Nicolas
> _______________________________________________
> Kst mailing list
> Kst at kde.org
> https://mail.kde.org/mailman/listinfo/kst
>

This is exactly the kind of thing that the scripting was made for.  If you
could try to implement this, it would be a huge step forward in debugging
it and looking for capability gaps.

I'm going to be tied up here in the field for another 3 weeks at least, but
can answer very brief questions like this though :-)

--
C. Barth Netterfield
University of Toronto
416-845-0946
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kst/attachments/20120721/5c648937/attachment-0001.html>
```