doubt in IDL Smooth in 2D with NaN values and /edge [message #49525] |
Fri, 28 July 2006 16:19 |
Alain
Messages: 3 Registered: July 2006
|
Junior Member |
|
|
Smooth is currently not available in GDL. I am using Smooth quiet
frequently. So I decided to rewrite it for GDL. The problem was to
write a test suite to check how good was my draft
(hope to submit it soon to GDL team !).
One nice test is to check whether the SMOOTH operation is invariant by
"rotation"
(if fact a transposition). If A is the test signal, a square matrix,
smooth(a,3) and transpose(smooth(transpose(a),3)) should be equal.
With IDL, in 2D case, when we have NaN, I thinks somethings goes wrong
when /Edge is set. It was reproduce on several computers at my lab.
(IDL 5.5, 6.0, 6.1 and 6.2)
a=REPLICATE(0.,9,9)
a(4,4)=20.
a(3,4)=!value.f_nan
b=transpose(a)
print, total(smooth(a,3,/nan)-transpose(smooth(b,3,/nan)))
(should be Zero, OK !)
print, total(smooth(a,3,/nan,/edge)-transpose(smooth(b,3,/nan,/edge )))
I was expecting Zero, Not OK !
What is your opinion ?
Thank You
Alain
PS: I founded nothing about that in this newsgroup archive
|
|
|