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

Home » Public Forums » archive » Comparing tabulated functions
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Comparing tabulated functions [message #57841] Thu, 03 January 2008 07:47 Go to previous message
jameskuyper is currently offline  jameskuyper
Messages: 79
Registered: October 2007
Member
I've got two functions of time, each of which is tabulated at
thousands of different monotonically increasing time values; in the
worst case, there may be as many as 14,400 time values. I want to
estimate the difference between these functions. Unfortunately, the
two functions will not, in general, be tabulated at the same time
values. A simple approach that works fairly well is to use spline
interpolation to interpolate both of them to a common grid, and then
difference the interpolated the values. However, occasionally one or
the other of the two functions have data gaps. For any time value that
is more than 1 second away from the nearest tabulated time for either
function, I want to fill in the difference array with !VALUES.D_NAN. I
believe this will cause the PLOT command to skip that point - if not,
I need to find some other approach that will have this effect.

I can write simple, highly efficient C code that does exactly what I
want; translating that code into IDL would make heavy use of loops,
and therefore wouldn't be very efficient. I can write simple IDL code
that takes no advantage of the fact that the arrays are monotonically
increasing, calculating the difference of every point on the output
grid from every point on either of the two input tables, and finding
the minimum, but that seems extremely inefficient (and a memory hog!).
Is there a simpler way to do this?
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: How to clean the memory?
Next Topic: FILE_SEARCH bug ?

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

Current Time: Fri Oct 10 15:54:23 PDT 2025

Total time taken to generate the page: 1.51951 seconds