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

*Subject*: Re: summation problem*From*: Jaco van Gorkom <j.c.van.gorkom(at)fz-juelich.de>*Date*: Thu, 05 Apr 2001 13:15:45 +0200*Newsgroups*: comp.lang.idl-pvwave*Organization*: FOM-Instituut voor Plasmafysica Rijnhuizen*References*: <9ahj10$8sg$1@yarrow.open.ac.uk>*Reply-To*: j.c.van.gorkom(at)fz-juelich.de*Xref*: news.doit.wisc.edu comp.lang.idl-pvwave:24373

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

**Follow-Ups**:**Re: summation problem***From:*Manish

**Re: summation problem***From:*Paul van Delst

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

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