[Kst] reading in NetCDF matrix (2-dim vector)

Brisset, Nicolas Nicolas.Brisset at eurocopter.com
Thu Apr 22 16:17:59 CEST 2010

Hi Tom,


the netcdf datasource for kst currently does not support reading in
matrices. It should however be fairly easy to add if you feel so
inclined, knowing that matrices are less well supported than vectors as
far as I know. I myself have only worked with vectors up to now, so I
may not be aware of everything. But I fear there is no easy way to slice
matrices into vectors (). Plus it makes little sense to me, as each
variable may have metadata and such attached to it and you would lose
all that by grouping vectors into a matrix. That said, I don't know your
constraints well enough. Maybe you have a good reason indeed to do it
that way.

Another path you may want to go is making some changes to the netcdf
datasource so that when it finds matrices it provides their lines and
columns as extra vectors. In that case all the work should be done at
datasource level, but that definitely sounds feasible. You could query
the dimensions of your 2-dimensional variables and add to the field list
vectors like Matrix1/Column1, Matrix1/Column2, Matrix1/Line1, etc...

Note: in the current code, it seems that the dimensions of netcdf vars
are not checked, that is *bad*. For cdf, it is done better.


Then, the other question you may ask yourself is whether to use kst
1.9.x or 2.x for that work. Kst 2.x is still beta quality, but starting
to work and there have been quite a few changes (among others wrt
datasources) so that what you do for one version of the netcdf
datasource may require substantial porting to the other one. FYI, kst2
also works under Windows but nobody has yet tried netcdf under Windows.
So it is still definitely experimental.







Von: Tom Downes [mailto:tpdownes at caltech.edu] 
Gesendet: Montag, 19. April 2010 20:46
An: kst at kde.org
Betreff: [Kst] reading in NetCDF matrix (2-dim vector)




I'm reasonably familiar with KST but am having a lot of trouble parsing
a NetCDF file in the fashion I intend.  I am working on an instrument
that will have have around 100 independent detectors measured at 100
samples per second each (i.e., around 10,000 total measurements per
second).  From the perspective of data acquisition it is much easier to
write to a NetCDF variable with dimensions n_detectors x n_samples,
where n_detectors would be this number around 100 (126 in example below)
and n_samples would equal 100 for 1 seconds worth of data.


But trying to get KST to read this data in the way I intend seems to be
difficult.  I want it to be able to split the matrix into 126 separate
vectors so that I can plot a timestream for each - realistically I would
take a representative sample.  The "sample" and "frame" terminology
doesn't seem to quite match up to what I am doing - frames seem to be
more about bookkeeping than actually combining many timestream vectors
into a matrix.


Anyhow, I would like to solve this in a relatively simple way, with a
preference toward avoiding re-writing how the data is originally written
to disk as it is much simpler this way.  Can I do what I need to do
within KST or with a simple plug-in?  I am quite comfortable working in
C/C++/Java and shell scripting environments.  Suggestions?


This is what the file looks like:


netcdf test-udp {


          time = UNLIMITED ; // (3960037 currently)

          nkids = 126 ;


          int kids(time, nkids) ;

                      kids:scale_factor = 1 ;

                      kids:add_offset = 0 ;

                      kids:units = "bits" ;

          int timestamp(time) ;

                      timestamp:scale_factor = 1 ;

                      timestamp:add_offset = 0 ;

                      timestamp:units = "bits" ;



I am running KST 1.9.1 compiled manually after checking out the release
source.  I don't think it matters, but I am running the kde3 libraries
alongside the kde4 libraries while logged into a KDE 3.5 WM session in
OpenSUSE 11.2.



Eurocopter Deutschland GmbH
Sitz der Gesellschaft/Registered Office: Donauwoerth
Registergericht/Registration Court: Amtsgericht Augsburg HRB 16508
Vorsitzender des Aufsichtsrates/Chairman of the Supervisory Board: Dr. Lutz Bertling
Geschaeftsfuehrung/Board of Management:
Dr. Wolfgang Schoder, Vorsitzender/CEO; Friedrich-Wilhelm Hormel; Ralf Barnscheidt


This communication and the information it contains is intended for the addressee(s) named above and for no other persons or organizations. It is confidential and may be legally privileged and protected by law. The unauthorized use, copying or disclosure of this communication or any part of it is prohibited and may be unlawful. 
If you have received this communication in error, kindly notify us by return e-mail and discard and/or delete the communication. Thank you very much. 
It is possible for e-mails to be intercepted or affected by viruses. Whilst we maintain virus checks on our e-mails, we accept no liability for viruses or other material which might be introduced with this message. 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kst/attachments/20100422/e1e522eb/attachment.htm 

More information about the Kst mailing list