Ben:
Sorry, got my languages mixed. Probably should say " for k in g: "
Looking at other routines in the library, though, I see most of them opt to
treat "g" explilcitly as a list -- so to follow that pattern you would say:
sum = 0.0
for k in xrange(len(g)):
sum = g[k] + sum;
Based on Don's note, though, it looks like there might be some
sampling issues because of the different angles, though.....
tom
On Dec 6, 2007 10:44 AM, Ben Kamen <bkamen@xxxxxxxxxxxxx> wrote:
> Tom Whittaker wrote:
> >
> > def makeAverage(g):
> > sum = 0.0
> > for (k in g):
> > sum = k + sum
> > sum = sum / len(g)
> > return sum
>
> Ahh the fun of being new to jython:
>
> When I enter that in I get:
>
> "There was an error in the Python library:Traceback (innermost last)
> (no code object) at line 0
> SyntaxError: ('invalid syntax', ('<string>',9,16,' for (k in g):'))
>
>
> HUH??
>
> Hahah
>
>
> -Ben
>
> _______________________________________________
> idvusers mailing list
> idvusers@xxxxxxxxxxxxxxxx
> For list information, to unsubscribe, visit:
> http://www.unidata.ucar.edu/mailing_lists/
>
--
Tom Whittaker
University of Wisconsin-Madison
Space Science & Engineering Center (SSEC)
Cooperative Institute for Meteorological Satellite Studies (CIMSS)
1225 W. Dayton Street
Madison, WI 53706 USA
ph: +1 608 262 2759