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

Home » Public Forums » archive » Re: unwrap modulo 2pi
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: unwrap modulo 2pi [message #23723 is a reply to message #23642] Thu, 08 February 2001 01:13 Go to previous message
Wim Bouwman is currently offline  Wim Bouwman
Messages: 8
Registered: September 1997
Junior Member
In the following bit of code the measured phase P is unwrapped onto
CALCPhi.
This is done by doing a 2nd order extrapolation of the three previous
points. It works when the jumps are not too extreme.

;Correct Phi and PhiOne for 2Pi jumps. The calculated Phi is compared to
;the experimentally obtained Phi. Extrapolation with least squares fit.
NPhi=N_ELEMENTS(P)
CALCphi=DBLARR(NPhi)
FOR i=3,(NPhi-1) DO BEGIN
CALCphi(i)=(-2*P(i-3)+P(i-2)+4*P(i-1))/3
Njumps=NINT((CALCphi(i)-P(i))/(2*!DPi), /Long)
P(i)=P(i)+Njumps*2*!DPi
ENDFOR

graham_wilson@my-deja.com wrote:

> IDL> a=[2,4,6,8,10,12]
> IDL> a=[2.,4.,6.,8.,10.,12.]
> IDL> b=2*!PI
> IDL> c=a mod b
> IDL> print, c
> 2.00000 4.00000 6.00000 1.71681 3.71681 5.71681
>
> What I mean by 'unwraping' is: Given I know 'c' and 'b' how do I
> explicitly find a?

--

Dr. Wim G. Bouwman phone (++31) (0)15 2786775
Interfacultair Reactor Instituut fax (++31) (0)15 2788303
Technische universiteit Delft w.g.bouwman@iri.tudelft.nl
Mekelweg 15 http://www.iri.tudelft.nl/~bouwman
2629 JB Delft The Netherlands
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL programmers wanted
Next Topic: Re: True Color, but !d.table_size eq 64?

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

Current Time: Sat Oct 11 06:02:00 PDT 2025

Total time taken to generate the page: 0.80719 seconds