From: Daniel J S. <dan...@ie...> - 2004-08-15 01:55:38
|
Ethan Merritt wrote: >On Saturday 14 August 2004 03:50 pm, you wrote: > > >>OK, let me back up here. I think I see now the more important issue >>here is that the data to be plotted, the imigration.dat file for >>example, won't work because it has more columns than allowed by max_cols >>passed into the df_readline routine. >> >> > >No, that's completely wrong. The data is being plotted 1 column at >a time. Sure there are lots of columns in the data file, but there's >nothing special about that. > OK, got it. >Hint: In the current code every requested column is returned >twice, once as a number and once as a string. The caller can >choose whether it wants the string value or the numeric value. >I don't know how this fits in with your binary data files, but I >assure you it is fully generic. The histogram code doesn't use >this anyhow; histogramming is not about strings, it's about >columns of numbers. You are, I am guessing, thinking about >my *other* new plotting mode - 'with labels'. > Inside df_readline() is the if statement: if (use_spec[output].expected_type >= CT_XTICLABEL) { and inside of that case is an instruction: if (df_current_plot) xpos += df_current_plot->histogram->start; and inside of graphics.h is the definition of histogram for curve_points: struct histogram_style *histogram; /* Only used if plot_style == HISTOGRAM */ If I follow, only the histogram plot style, then, can make use of that particular block of code inside df_readline(). That, or one needs to realize that the histogram->start can be used in a generic fashion. I guess it isn't that big of a deal, but it just seems like the use_spec[] portion of df_readline() is growing very large and doing lot's of specific stuff. >>Does this get around some problems? Am I understanding the big issue >>now, that there are more columns now than max_cols? >> >> > >No. Nothing at all like that. I want to get rid of max_cols not because >I want lots of columns, but just because it is not used for anything that >really has to do with columns. It is only used to try to deduce back to >what the plot type is - which I think is nuts. If you need to know the plot >type then just pass the plot type. > Oh, well yeah guessing the structure from the max cols is kind of silly. >>Well, here is the thing. There is a certain element of this that can't >>be disentangled (if that's a word). A lot of the parameters for reading >>from a file are set up by df_open() because it is there that the >>keywords from the command line are processed. So, at the point of >>df_open() it isn't known yet whethere the file is ascii or binary. That >>could be fixed by first, at the start of df_open, checking all the >>keywords to see if one is "binary", but that's not graceful. >> >> > >Hunh? Now I'm the one who is confused. I really have not been >looking at that part of your patch because I have no use for binary >input. But I assumed you told the program *somehow* that this >was a binary data file. How does this work at all if there isn't a >keyword on the command line? > What I'm saying is if all the parameters that are controlled by the command line keywords are to have there own "local instance" in a different file, say "binfile.c" that will mean there has to be a variant of df_open() just for binary files, which resides inside "binfile.c". It will look extremely similar to the current df_open(). I'd like to avoid that sort of thing, i.e., code repetition. Dan |