Re: More Kriging Problems [message #86187 is a reply to message #86185] |
Wed, 16 October 2013 21:25   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Chris Torrence writes:
> I think I see the problem. In my latest krig2d.pro code, I am incorrectly calculating the X and Y arrays for the /REGULAR grid case. Near the end of the code are the following lines:
> xx = (SIZE(x, /N_DIM) eq 2) ? x : REBIN(TRANSPOSE(x), nx, n)
> yy = (SIZE(y, /N_DIM) eq 2) ? y : REBIN(TRANSPOSE(y), nx, n)
>
> They should be:
> xx = REBIN(REFORM(x, 1, n), nx, n)
> yy = REBIN(REFORM(y, 1, n), nx, n)
>
> Do you want to make the changes to the code, and see what kind of results you get? Also, I would be curious as to your speed test results. I tried your cgkrig2d code, and it seemed about the same or maybe slightly slower. Finally, the cgkrig2d results didn't quite match what I was expecting. Here is the code I used:
> values = Dist(11)
> smdims = Size(values, /Dimension)
> sampled2 = cgKrig2d(values, findgen(smdims[0]), $
> findgen(smdims[1]), /Regular, Spherical=[5.0, 0.0])
> sampled3 = Krig2d(values, findgen(smdims[0]), $
> findgen(smdims[1]), /Regular, Spherical=[5.0, 0.0])
> s2 = surface(sampled2, window_title='cgKrig2D')
> s3 = surface(sampled3, window_title='new Krig2D')
>
> Note that the call to Krig2D is my latest fast code with the 2-line fix mentioned above.
Thanks, Chris. I'm bushed, but I'm notorious for not being a multi-
tasker. I'm sure I'll be back at this first thing in the morning. I'll
let you know what I find out. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|