MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Controlling program flow across cells

Here is the problem:

I import a large data file - 20 years of hourly observations, which is
used to populate a raw data list of approximately 176,000 rows with
the following structure:
{year, day, hour, validity_Flag, data_Item1, ... ,data_Item5}

The list is then parsed, filtered and operated upon in several
different ways. In particular I calculate statistical properties of a
specified 5 year period. The process is encapsulated in a number of

Cell_1 : Parse[ Import and filter raw data ];

Cell_2a: Parse[ Chip out and sort period of interest ];
Cell_2b: Calculate[ statistical properties of validity_Flag ];
Cell_2c: Calculate[ statistical properties of data_Item ];
Cell_2d: Calculate[ distribution of data_Item ];

This is done for most data_Items, additionally calculations are made
for hourly statistics and quartely statistics. Now what I would like
to be able to do is loop over the four 5 year periods within the
complete 20 year span. Here are two questions:

1. I would like to set up a For[] loop across Cell_2a-Cell_2d to loop
through the four periods of interest. How can I do this, or should I
actually have built the program in a different way?

2. How can I get output from within a For[] loop as it is executing?
For example, I might like to watch some value of a given variable
within the loop as it is calculated (in C I would use a printf). 


semiclassical at

  • Prev by Date: Re: Re: Apply on MultipleListPlot using pure functions
  • Next by Date: Leading Zeros? (question rephrased)
  • Previous by thread: Re: Memory Leak in Mathematica?
  • Next by thread: Re: Controlling program flow across cells