comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: INT_TABULATED Errors
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: INT_TABULATED Errors [message #18654] Sun, 23 January 2000 00:00
landsman is currently offline  landsman
Messages: 93
Registered: August 1991
Member
In article <3888997E.7EBB8BE1@fsl.noaa.gov>,
Andy Loughe <loughe@fsl.noaa.gov> wrote:
>
> ; Compute the area under the curve using INT_TABULATED
> ;
> ; Example 1
> x = [0.0, 0.3333, 0.985, 1.0]
> y = [0.0, 0.529, 0.894, 1.0]
> plot, x, y, psym=-2, title='Example 1'
> print, ' Too small ==> ', INT_TABULATED(x, y)
> ;
> ; Example 2
> x = [0.0, 0.10, 0.79, 1.0]
> y = [0.0, 0.67, 0.96, 1.0]
> plot, x, y, psym=-2, title='Example 2'
> print, ' Too large ==> ', INT_TABULATED(x, y)

Your example has two characteristics that make them unsuitable for
INT_TABULATED. First they have abrupt changes in slope, and so
INT_TABULATED, which uses cubic spline interpolation, will poorly
approximate the function. Second, they have a very irregularly spaced
grid, and INT_TABULATED computes the integral using a regular grid with
the same spacing. (I would have rewritten INT_TABULATED to make sure
the regular grid spacing is at least as fine as the smallest separation
in the irregular input grid.)

Anyway, for a non-smooth curve I recommend using a simple trapezoidal
integration, such as tsum.pro available at
http://idlastro.gsfc.nasa.gov/ftp/pro/math/tsum.pro

Wayne Landsman landsman@mpb.gsfc.nasa.gov


Sent via Deja.com http://www.deja.com/
Before you buy.
[Message index]
 
Read Message
Previous Topic: You can access Main Level Variables!!!
Next Topic: IDL Programming Odditites

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 15:19:39 PDT 2025

Total time taken to generate the page: 1.36036 seconds