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

Home » Public Forums » archive » Smooth and /EDGE_TRUNCATE
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Smooth and /EDGE_TRUNCATE [message #88457] Tue, 29 April 2014 07:35 Go to previous message
Fabzi is currently offline  Fabzi
Messages: 305
Registered: July 2010
Senior Member
IDLers,

I've lost 3 hours of my life on this. Can someone explain me why the
/EDGE_TRUNCATE keyword has an incidence on the results WITHIN the image,
where the kernel meets no edge?

pro test_smooth

; make an array with a nan in the center
array = FINDGEN(5,5)
array[2,2] = !VALUES.F_NAN

print, ' Exp 1'
print, 'Expected', MEAN(array[1:3,1:3], /NAN)
print, 'No truncate', (smooth(array, 3, /NAN))[2,2]
print, 'Truncate', (smooth(array, 3, /NAN, /EDGE_TRUNCATE))[2,2]

; so far so good. Add a NaN somewhere else
array[1,1] = !VALUES.F_NAN
print, ' Exp 2'
print, 'Expected', MEAN(array[1:3,1:3], /NAN)
print, 'No truncate', (smooth(array, 3, /NAN))[2,2]
print, 'Truncate', (smooth(array, 3, /NAN, /EDGE_TRUNCATE))[2,2]

end

Thanks a lot!

Fabien
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Running this MATLAB code in IDL
Next Topic: Another "Array subscript for VECTOR must have same size as source expression." problem

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

Current Time: Wed Oct 08 19:19:28 PDT 2025

Total time taken to generate the page: 0.00410 seconds