[Kst] [Bug 116461] getdata borks when the first field in the format file isn't (ASCII) alphabetically the first field.
tskisner.public at gmail.com
Wed Nov 16 04:18:25 CET 2005
On Tuesday 15 November 2005 18:42, Barth Netterfield wrote:
> And I don't understand why the Wright Brothers didn't just go buy a Cesna.
> I guess they just wanted to re-invent the airplane.
hmmm, well I apologize if my suggestions were "too late to be useful" in kst
I originally brought up the GetNFrames-first-field-in-format problem in early
2003 (see email below). Anyway, enough bickering from me as it's not really
getting us any closer to fixing the issue.
I looked through the dirfile datasource, and it seems like the main issue with
querying each field separately is update(). I'm guessing that for
performance reasons, we want to just be able to check whether a single binary
file has changed? I'm guessing it would be super slow if we had a dirfile
directory with hundreds of binary files and had to stat each one? If this is
"not too slow", then we could just keep track of the number of samples in
every field and see if they have changed.
Alternatively, maybe there is a system call we could use (equivalent to "du -s
-k .") that could check the size of the entire dirfile directory and see if
it has changed. This is probably much faster than stat'ing each file
If we can get around this problem, then we should be able to call GetNFrames
for the desired field rather than just the first field in the format list.
| Content-Type: text/plain;
| From: Ted Kisner <kisner at physics.ucsb.edu>
| Reply-To: kisner at physics.ucsb.edu
| Organization: Department of Physics, UCSB
| To: "C. Barth Netterfield" <cbn at omega.astro.utoronto.ca>
| Subject: lame getdata.c bug
| Date: Mon, 24 Feb 2003 14:23:33 -0800
| X-Mailer: KMail [version 1.3.2]
| Cc: Tom Montroy <tom at cmb.phys.cwru.edu>
| MIME-Version: 1.0
| Content-Transfer-Encoding: 8bit
| Status: RO
| X-Status: S
| I have spent nearly all day tracking down a bug in getdata that affects kst
| and d2asc.
| On my desktop machine, I have the full dataset. kst works fine. On my
| laptop, I have only a few of the field files and the format file. I also
| have all the necessary stuff in /data/etc.
| kst and d2asc call GetNFrames to find out whether the requested data file is
| in dirfile format. GetNFrames stupidly checks the first field in the sorted
| list of rawfields (which happens to be Acs0_0) to see how many frames there
| are. OK, I guess I'm stupid for not commenting out all the fields in format
| that I don't actually have. HOWEVER, I also have some fields listed in
| format that I've written to that have a different number frames than the raw
| boom data. If one of these fields happened to be first in the alphabetical
| list, then GetNFrames would return one number of frames which would be
| different than the number of frames in various other files.
| 1. Change GetNFrames. Add variable in function call to specify which field
| to check for the number of frames.
| 2. Change kstfile.cpp to check the number of frames in the ACTUAL FIELD
| is being read.
| I can obviously change this in my own source, but I think it should be fixed
| in the main source tree...
| Sorry I'm a little bitter, I've wasted 5 hours tracking this down...
More information about the Kst