[Kst] Strange problem with datasources

Brisset, Nicolas Nicolas.Brisset at eurocopter.com
Thu Apr 27 11:18:37 CEST 2006


> I have a strange problem with a CDF file being picked up by 
> the ASCII datasource, which can't read it of course... I have 
> tried increasing the value returned by understands_cdf to 100 
> instead of 76, but it did not help and I ended up putting 
> traces in both understands_cdf and understands_ascii 
> functions, and here is what I get:
> [...]
> Now, if someone could tell me why the data wizard recognizes 
> this file as ASCII instead of CDF even though the values returned by
> understands_xxx() Indicate the opposite, I'd be happy ! As it 
> stands, I just can't read that particular file, while other 
> CDF files work well.
> Note that understands_cdf() just looks at the file extension, 
> so difference in contents shouldn't even matter to it (while 
> it could change something for ASCII). I'm puzzled... 
OK, I have traced the problem and found the answer, and we are working
on a fix. The story is that this particular CDF was generated by Matlab,
which by default stores vectors as: vectors with as many elements as
there are values, and only one "record" (aka sample in kst terminology).
A vector in kst terminology (i.e. a series of double values
corresponding to a given variable) can be stored in 3 ways in CDF. Let's
assume we have a variable VAR with 10000 values, it can be stored as:
- a scalar (0 dimensions) with 10000 records
- a (scalar-as-)vector (1 dimension of size 1) with 10000 records
- a vector (1 dimension of size 10000) with 1 record

The first two cases were handled, the third not :-( As it is the default
behavior in Matlab, I suppose the best is to fix it at kst level, which
is what we are going to do. I will commit the changes when they are done
and tested a bit.

Nicolas


More information about the Kst mailing list