Re: aggregating time steps

2007-08-24 Thread John W. Krahn
Kirk Wythers wrote: Sorry for the "not sure where to even begin" nature of this email, but I am stuck. I am trying to put together a aggregating script that takes daily climate data and produces monthly averages. For example, the input file has the form: year monthdoytmax tmin par

Re: aggregating time steps

2007-08-24 Thread Chas Owens
On 8/24/07, Kirk Wythers <[EMAIL PROTECTED]> wrote: snip > This is part of what was confusing me. I didn't see %totals declared > anywhere is the suggestion. snip Yeah, you can only tell it is a hash because of how it is used. I believe the person who posted the example expected you to know what

Re: aggregating time steps

2007-08-24 Thread Dr.Ruud
"Chas Owens" schreef: > Dr.Ruud: >> [my %totals;] >> Put >> print Dumper $totals; >> at the end of the code. > > Shouldn't that be >print Dumper \%totals; Yes, thanks for the correction. -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addition

Re: aggregating time steps

2007-08-24 Thread Kirk Wythers
Thank you very much for the explanation Chas. It is starting to make more sense. The reason I was attracted to the solution #! /usr/bin/perl -w use strict; use warnings; $, = ' '; # set output field separator $\ = "\n"; # set output record separator my ( $year, $month, $doy, $tmax, $tmin, $

Re: aggregating time steps

2007-08-24 Thread Chas Owens
On 8/24/07, Dr.Ruud <[EMAIL PROTECTED]> wrote: > Kirk Wythers schreef: > > Gunnar Hjalmarsson: > >> Kirk Wythers: > > >>> I don't see how $totals{$year}{$month}{count} ++; is holding the > >>> count. > >> > >> Read about the auto-increment operator in "perldoc perlop". > > > > OK. I'll try and be

Re: aggregating time steps

2007-08-24 Thread Dr.Ruud
Kirk Wythers schreef: > Gunnar Hjalmarsson: >> Kirk Wythers: >>> I don't see how $totals{$year}{$month}{count} ++; is holding the >>> count. >> >> Read about the auto-increment operator in "perldoc perlop". > > OK. I'll try and be more clear to the degree of my ignorance. First, > I do not unde

Re: aggregating time steps

2007-08-24 Thread Chas Owens
On 8/24/07, Kirk Wythers <[EMAIL PROTECTED]> wrote: > > On Aug 23, 2007, at 11:17 PM, Gunnar Hjalmarsson wrote: > > > Kirk Wythers wrote: > >> I don't see how $totals{$year}{$month}{count} ++; is holding the > >> count. > > > > Read about the auto-increment operator in "perldoc perlop". > > OK. I'

Re: aggregating time steps

2007-08-24 Thread Kirk Wythers
On Aug 23, 2007, at 11:17 PM, Gunnar Hjalmarsson wrote: Kirk Wythers wrote: I don't see how $totals{$year}{$month}{count} ++; is holding the count. Read about the auto-increment operator in "perldoc perlop". OK. I'll try and be more clear to the degree of my ignorance. First, I do not

Re: Fwd: aggregating time steps

2007-08-23 Thread Gunnar Hjalmarsson
Kirk Wythers wrote: I don't see how $totals{$year}{$month}{count} ++; is holding the count. Read about the auto-increment operator in "perldoc perlop". -- Gunnar Hjalmarsson Email: http://www.gunnar.cc/cgi-bin/contact.pl -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e

Fwd: aggregating time steps

2007-08-23 Thread Kirk Wythers
Begin forwarded message: On Aug 23, 2007, at 4:25 PM, Mr. Shawn H. Corey wrote: # How about? my ( $year, $month, $doy, $tmax, $tmin, $par, $precip, $NH4, $NO3, $O3, $CO2, $V1, $V2, $V3, $V4 ) = split; # You can now store your totals by month as: $totals{$year}{$month}{tmax} += $tmax; .

Re: aggregating time steps

2007-08-23 Thread Chas Owens
On 8/23/07, Kirk Wythers <[EMAIL PROTECTED]> wrote: > Sorry for the "not sure where to even begin" nature of this email, > but I am stuck. I am trying to put together a aggregating script that > takes daily climate data and produces monthly averages. For example, > the input file has the form: > >

Re: aggregating time steps

2007-08-23 Thread Mr. Shawn H. Corey
Kirk Wythers wrote: Sorry for the "not sure where to even begin" nature of this email, but I am stuck. I am trying to put together a aggregating script that takes daily climate data and produces monthly averages. For example, the input file has the form: ---8<--- snip I need to step through

aggregating time steps

2007-08-23 Thread Kirk Wythers
Sorry for the "not sure where to even begin" nature of this email, but I am stuck. I am trying to put together a aggregating script that takes daily climate data and produces monthly averages. For example, the input file has the form: year month doy tmax tmin par precip NH4