Bug 118602

Summary: d2asc isn't precise enough
Product: [Applications] kst Reporter: D. V. Wiebe <dvw>
Component: generalAssignee: kst
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 1.x   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

Description D. V. Wiebe 2005-12-18 23:22:33 UTC
Version:           1.2.0_dr1 (using KDE KDE 3.4.2)
Installed from:    Compiled From Sources
Compiler:          gcc (GCC) 3.4.4 
OS:                Linux

d2asc only prints 12 digits of precision when outputing timestreams in non-hex mode.  IEEE-754 double precision specification has 52 bits = 15.4 digits of mantissa. d2asc should output 16 digits of precision.
Comment 1 Netterfield 2005-12-19 00:41:31 UTC
SVN commit 489519 by netterfield:

BUG: 118602

16 digits for d2asc.  Eventually, it could be nice to have a command
line setting for this.
In the meantime, make sure we print out all the precision that could
possibly be there.



 M  +1 -1      d2asc.cpp  


--- trunk/extragear/graphics/kst/kst/d2asc.cpp #489518:489519
@@ -130,7 +130,7 @@
       if (do_hex[i]) {
         printf("%4x ",  (int)vlist.at(i)->interpolate(i_S, NS));
       } else {
-        printf("%.12g ", vlist.at(i)->interpolate(i_S, NS));
+        printf("%.16g ", vlist.at(i)->interpolate(i_S, NS));
       }
     }
     printf("\n");
Comment 2 Nicolas Brisset 2005-12-19 11:41:10 UTC
What's the purpose of d2asc actually ? It is not really documented (or I have not found it at least)... I understand it takes some sort of input (but what exactly is not clear) and outputs an ASCII file. Is that correct ?
Comment 3 Matthew Truch 2005-12-20 00:40:52 UTC
I'm quite surprized that d2asc isn't documented (at least with a man page).

d2asc is short for data-to-ascii.  It can read any datafile that kst can read, and outputs it as ascii (to stdout), honoring the frame range given on the command line, just like the change data sample range dialog.  

It doesn't make much sense for reading ascii data.  Not much for some formats like netCDF either, but for formats like dirfile, where there aren't many (any?) ways to read the data outside of kst, it allows you to export the data so any program can read it.
Comment 4 Nicolas Brisset 2005-12-20 10:07:55 UTC
Well, maybe it's my installation ? Actually, while looking for some information before I posted the above comment, I think I came across a man page written by someone for Debian. However, it contained only the text you get with "d2asc --help", which is not really enough to understand that it uses the underlying kst datasource infrastructure to transform any format kst can read into ASCII. I didn't actually know this existed, but I'm glad I asked because I can think of quite a few cases where this would come in handy :-)

Definitely worth a small manpage, or more explicit help text !