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

Home » Public Forums » archive » Fractional SHIFT
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Fractional SHIFT [message #28356] Mon, 03 December 2001 09:45
the_cacc is currently offline  the_cacc
Messages: 104
Registered: October 2001
Senior Member
Hi,

Does anyone have a method for doing non-integer shifts ? Interpolate
doesn't wrap in the way SHIFT does and my hack (based on MOD) is a bit
dodgy.

To shift orig by 1.5 pixels:


orig = FINDGEN(10)

index = FINDGEN(10)
delta = 1.5
index2 = (index+delta) MOD 10

new = INTERPOLATE(orig,index2,/GRID)

PRINT,new

1.50000 2.50000 3.50000 4.50000 5.50000
6.50000
7.50000 8.50000 9.00000 0.500000


The 2nd last element of new is wrong (should be 9.5).

Does anyone know a robust way ?

Ciao.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Setting history size in idlwave
Next Topic: LINUX / Keyboard echo during command execution

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

Current Time: Wed Oct 08 13:05:20 PDT 2025

Total time taken to generate the page: 0.00464 seconds