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

*Subject*: Re: summation problem*From*: "Manish" <mrmanish(at)bigfoot.com>*Date*: Thu, 5 Apr 2001 13:32:30 +0100*Newsgroups*: comp.lang.idl-pvwave*Organization*: The Open Univeristy*References*: <9ahj10$8sg$1@yarrow.open.ac.uk> <3ACC53E1.A396D87C@fz-juelich.de>*Xref*: news.doit.wisc.edu comp.lang.idl-pvwave:24374

Nice one mate, worked a treat. Thanks, Manish "Jaco van Gorkom" <j.c.van.gorkom@fz-juelich.de> wrote in message 3ACC53E1.A396D87C@fz-juelich.de">news:3ACC53E1.A396D87C@fz-juelich.de... > Manish wrote: > ... > > I have a program which produces an array of values of sunlight flux during > > the day. Unfortunately, it produces crazy numbers before the sunrises and > > after it sets(as expected). I'm summing the values throughout the day to > > get a total integrated day flux, but here's the problem - is there a way of > > telling the TOTAL function to ignore negative numbers and NaN numbers? > > Yes, there is a way: > IDL> test = [0,-1,3,4,!values.f_nan] > IDL> print, total(test>0,/nan) > 7.00000 > % Program caused arithmetic error: Floating illegal operand > > The 'illegal operand' error appears to be harmless, caused by comparing test>0: > IDL> print, test>0 > 0.00000 0.00000 3.00000 4.00000 NaN > % Program caused arithmetic error: Floating illegal operand > > > I guess this is a simple problem, but would appreciate any help > It is simple enough, but only once you know the solution. > > cheers, > Jaco

**References**:**summation problem***From:*Manish

**Re: summation problem***From:*Jaco van Gorkom

- Prev by Date:
**Re: Cant find functions in lib** - Next by Date:
**Re: Cant find functions in lib** - Prev by thread:
**Re: summation problem** - Next by thread:
**Re: summation problem** - Index(es):