epix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ePiX-devel] Proposed data pruning function


From: Andrew D. Hwang
Subject: Re: [ePiX-devel] Proposed data pruning function
Date: Sun, 20 May 2007 20:21:04 -0400 (EDT)

On Sun, 13 May 2007, Marcus D. Hanwell wrote:

Andrew D. Hwang wrote:
On Fri, 6 Apr 2007, Marcus D. Hanwell wrote:

I have been working on a data pruning function today and have come up
with a prototype. [snip]

I'd also like to change some of the warning messages, so they print
the function that called them, or the name of the file that contains
errors.
That sounds like a great idea. I will remember to update things as I see
them and work on the code.

Hi Marcus,

First, congratulations on the Summer of Code fellowship!

I've been working with dataplot.* today, and propose the following changes:

* Introduce an "interval" class, modeling an interval of real numbers, and
  constructable either from two doubles, or from a string of the form
  "[0,1]", "[-0.5, 0.5)", etc. (I have string-parsing code that works, but
  it's pretty kludgey.)

* To modularize, split dataplots.cc and dataplots.h into four files each:

  (data_file.*) The data_file class and global plot/histogram functions.
  (data_bins.*) The d_bin and data_bins classes.
  (dataplot.*)  The deprecated FILEDATA-style plotting code.
  (data_mask.*) A new class that plugs into your prune() function.

* A data_mask will contain the following data:

    interval m_range;
    double (*m_filter)(double);
    bool m_reverse;


  Pruning would work like this:

  data_file DF("myfile.dat");
  data_mask DM("[-0.5, 1.5)"); // Half-open interval; optional second
                               // argument supplies a "filter" function
  data_mask DM2(-0.5, 1.5);    // Alternative form for closed intervals

  DF.prune(1, DM).prune(2, DM.reverse());
  DF.prune(-0.5, 1.5, 1); // alternative form of DF.prune(1, DM2);

Eventually, it might make sense to implement data_bins in terms of intervals; currently, data bins are half-open, of the form [a, b).

If this seems reasonable (and is compatible with changes you've made), I'll upload the code to savannah.

Best,
Andy

Andrew D. Hwang                 address@hidden
Department of Math and CS       http://mathcs.holycross.edu/~ahwang
College of the Holy Cross       (508) 793-2458 (Office: 320 Swords)
Worcester, MA, 01610-2395       (508) 793-3530 (fax)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]