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

Home » Public Forums » archive » IDL QUESTIONS (INTERPOLATION)
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
IDL QUESTIONS (INTERPOLATION) [message #78366] Mon, 21 November 2011 05:59 Go to next message
zolile mtumela is currently offline  zolile mtumela
Messages: 50
Registered: September 2011
Member
Hi all,
I have interpolated some data, which I think I did well, the data
looks like this
time (s) velocity
24785555 -8.90000
24785675 -6.90000
24785795 -5.00000
24785915 -15.4000
24786035 -1.80000
24786155 21.5000
24786275 -2.70000
24786395 1326.90
24786515 0.100000
24786635 69.6000
24786755 -624.900
24786875 263.700
24786995 30.3000
24787115 157.000
24787235 488.300
24787355 25.6000
24787475 40.6000
24787595 32.5000
24787715 21.2000
24787835 13.6000
24787955 92.4000
24788075 37.0000
24788195 7.50000
24788315 4.80000
24788435 8.30000
24788555 43.4000
24788675 26.2000
24788795 36.7000
24788915 17.6000
24789035 -39.2000
24789155 -76.5000
24789275 -31.7000
24789395 -31.3000
24789515 -20.0000
24789635 1.10000
I want to create time axis in hours, I need help on time convetion, I
wrote a program like this
File = Dialog_pickfile(Filter = '*.txt')

;read the data
rows = File_lines(file)
data = Fltarr(2,rows)
openr,Lun,file,/Get_lun
ReadF,lun, data
b =floor(min(data[0,*])); start time
e = ceil(max(data[0,*])); end time
x = Scale_vector(Findgen(e-b+1),b,e)
y = interpol(data[1,*], data[0,*],x); interpolating data
;draw the plots
plot,data[0,*],data[1,*],linestyle=2 ; for original data
oplot,x,y,color=120 ; newly interpolated velocity data

end
I want to covert that time in two hour in the plot.

Thank you in advance for ur time
Zolile
Re: IDL QUESTIONS (INTERPOLATION) [message #78466 is a reply to message #78366] Wed, 23 November 2011 09:58 Go to previous message
Brian Wolven is currently offline  Brian Wolven
Messages: 94
Registered: May 2011
Member
And make sure that the "outlier" is not your DC/zero frequency component - or remove it before doing the FFT. ;)
Re: IDL QUESTIONS (INTERPOLATION) [message #78479 is a reply to message #78366] Wed, 23 November 2011 06:27 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
zolile mtumela writes:

> I was doing FFT on this data, but I am getting fun spectrum. In the
> data there are some big values(they look like outliers). Could I try
> remove those big values in order to plot FFT.

You could try. Then you have the bigger problem of
having to justify why you did it. :-)

> Maybe I have to apply hanning window to get right spectrum, Any
> suggestions are much welcome.

There are any number of filters that allow you to smooth data,
if that is what you want to do. It is faster to try a couple
than it is to talk about them.

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: IDL QUESTIONS (INTERPOLATION) [message #78482 is a reply to message #78366] Wed, 23 November 2011 05:47 Go to previous message
zolile mtumela is currently offline  zolile mtumela
Messages: 50
Registered: September 2011
Member
On Nov 22, 4:13 pm, zolile mtumela <zolilemtum...@gmail.com> wrote:
> On Nov 22, 3:26 pm, David Fanning <n...@dfanning.com> wrote:
>
>
>
>
>
>> zolile mtumela writes:
>>> Actually the data suppose to take two hrs thats is 7200 seconds: From
>>> original data in fit format, It shows me the start-end
>>> time(2478520-2478906), in this two hrs data, sometimes there are
>>> nodata, thats why i got few data in other data of ascii data.
>>> I would like to plot 2 hr data even if I did get data, I think
>>> interpolation function is ok.
>>> 1.Could I resample data to  fill gaps
>
>> Yes, if you think this is necessary. It doesn't
>> seem to be with  the data you sent us.
>
>>> 2.How to accomodate the 2 hours in all plots even if I got few data
>
>> I am not sure what you are asking here.
>> Do you mean you want your X axis to always
>> represent two hours of time? Then set the
>> XRange to that span of time, and set the
>> XSTYLE keyword to 1 to tell IDL you really
>> mean it.
>
>> Cheers,
>
>> David
>
>> --
>> David Fanning, Ph.D.
>> Fanning Software Consulting, Inc.
>> Coyote's Guide to IDL Programming:http://www.idlcoyote.com/
>> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
>
> Thanks David
> Today, I was playing with these plots, looking to the one that have
> gaps. Mine looked different but  I have adjust the rangers. I  am bit
> convised  that these ones are interpolated correctly. Thank you again.
> Sometimes It becomes hard to differetiate  when u r not used in
> programming, But i am improving with ur assistance. Thank you!!- Hide quoted text -
>
> - Show quoted text -

HiDavid
I was doing FFT on this data, but I am getting fun spectrum. In the
data there are some big values(they look like outliers). Could I try
remove those big values in order to plot FFT.

Maybe I have to apply hanning window to get right spectrum, Any
suggestions are much welcome.
Many thanks
Zolile
Re: IDL QUESTIONS (INTERPOLATION) [message #78493 is a reply to message #78366] Tue, 22 November 2011 06:13 Go to previous message
zolile mtumela is currently offline  zolile mtumela
Messages: 50
Registered: September 2011
Member
On Nov 22, 3:26 pm, David Fanning <n...@dfanning.com> wrote:
> zolile mtumela writes:
>> Actually the data suppose to take two hrs thats is 7200 seconds: From
>> original data in fit format, It shows me the start-end
>> time(2478520-2478906), in this two hrs data, sometimes there are
>> nodata, thats why i got few data in other data of ascii data.
>> I would like to plot 2 hr data even if I did get data, I think
>> interpolation function is ok.
>> 1.Could I resample data to  fill gaps
>
> Yes, if you think this is necessary. It doesn't
> seem to be with  the data you sent us.
>
>> 2.How to accomodate the 2 hours in all plots even if I got few data
>
> I am not sure what you are asking here.
> Do you mean you want your X axis to always
> represent two hours of time? Then set the
> XRange to that span of time, and set the
> XSTYLE keyword to 1 to tell IDL you really
> mean it.
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.idlcoyote.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

Thanks David
Today, I was playing with these plots, looking to the one that have
gaps. Mine looked different but I have adjust the rangers. I am bit
convised that these ones are interpolated correctly. Thank you again.
Sometimes It becomes hard to differetiate when u r not used in
programming, But i am improving with ur assistance. Thank you!!
Re: IDL QUESTIONS (INTERPOLATION) [message #78494 is a reply to message #78366] Tue, 22 November 2011 05:26 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
zolile mtumela writes:

> Actually the data suppose to take two hrs thats is 7200 seconds: From
> original data in fit format, It shows me the start-end
> time(2478520-2478906), in this two hrs data, sometimes there are
> nodata, thats why i got few data in other data of ascii data.
> I would like to plot 2 hr data even if I did get data, I think
> interpolation function is ok.
> 1.Could I resample data to fill gaps

Yes, if you think this is necessary. It doesn't
seem to be with the data you sent us.

> 2.How to accomodate the 2 hours in all plots even if I got few data

I am not sure what you are asking here.
Do you mean you want your X axis to always
represent two hours of time? Then set the
XRange to that span of time, and set the
XSTYLE keyword to 1 to tell IDL you really
mean it.

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: IDL QUESTIONS (INTERPOLATION) [message #78495 is a reply to message #78366] Tue, 22 November 2011 05:21 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
zolile mtumela writes:

> The original data(fit format) of this data have plotted a plot with
> gaps, I wrote that data to ascii format.
> I thought I will get similar plot but with gaps and fill those gaps
> using interpolation function.
> Any help will be highly appreciated.

Help of what kind? Do you need reassurance that
it doesn't matter in this case?

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: IDL QUESTIONS (INTERPOLATION) [message #78499 is a reply to message #78366] Mon, 21 November 2011 23:12 Go to previous message
zolile mtumela is currently offline  zolile mtumela
Messages: 50
Registered: September 2011
Member
On Nov 22, 8:37 am, zolile mtumela <zolilemtum...@gmail.com> wrote:
> On Nov 21, 10:34 pm, zolile mtumela <zolilemtum...@gmail.com> wrote:
>
>
>
>
>
>> On Nov 21, 10:15 pm, David Fanning <n...@dfanning.com> wrote:
>
>>> zolile mtumela writes:
>>>> Thank so much David, for time axis it looks ok.
>>>> I am bit confused why at the y-axis(velocity), my program plot big
>>>> values which are not in the data. I got big values like(500)
>>>> After interpolation, Is it necessary to resample data? Are any better
>>>> way to use interpolation in this kind of data.
>
>>> I don't know. There were big values in the data you
>>> sent us. I don't think it is necessary to resample
>>> the data. It seems to track the real data exactly. :-)
>
>>>> Thank so much for ur tireless support and help.
>
>>> Yes, I was just having lunch with one of my
>>> sons, encouraging him to not follow in his
>>> father's footsteps. Rather, to find a job
>>> that he loves that actually pays a living
>>> wage. :-)
>
>>> --
>>> David Fanning, Ph.D.
>>> Fanning Software Consulting, Inc.
>>> Coyote's Guide to IDL Programming:http://www.idlcoyote.com/
>>> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
>
>> Thank very much David
>> Zolile- Hide quoted text -
>
>> - Show quoted text -
>
> The original data(fit format)  of this data have plotted  a plot with
> gaps, I wrote that data to ascii format.
> I thought I will get similar plot but with gaps and fill those gaps
> using interpolation function.
> Any help will be highly appreciated.
> Thanks
> Zolile- Hide quoted text -
> a
> - Show quoted text -
Actually the data suppose to take two hrs thats is 7200 seconds: From
original data in fit format, It shows me the start-end
time(2478520-2478906), in this two hrs data, sometimes there are
nodata, thats why i got few data in other data of ascii data.
I would like to plot 2 hr data even if I did get data, I think
interpolation function is ok.
1.Could I resample data to fill gaps
2.How to accomodate the 2 hours in all plots even if I got few data
Thank you
Zolile
Re: IDL QUESTIONS (INTERPOLATION) [message #78500 is a reply to message #78366] Mon, 21 November 2011 22:37 Go to previous message
zolile mtumela is currently offline  zolile mtumela
Messages: 50
Registered: September 2011
Member
On Nov 21, 10:34 pm, zolile mtumela <zolilemtum...@gmail.com> wrote:
> On Nov 21, 10:15 pm, David Fanning <n...@dfanning.com> wrote:
>
>
>
>
>
>> zolile mtumela writes:
>>> Thank so much David, for time axis it looks ok.
>>> I am bit confused why at the y-axis(velocity), my program plot big
>>> values which are not in the data. I got big values like(500)
>>> After interpolation, Is it necessary to resample data? Are any better
>>> way to use interpolation in this kind of data.
>
>> I don't know. There were big values in the data you
>> sent us. I don't think it is necessary to resample
>> the data. It seems to track the real data exactly. :-)
>
>>> Thank so much for ur tireless support and help.
>
>> Yes, I was just having lunch with one of my
>> sons, encouraging him to not follow in his
>> father's footsteps. Rather, to find a job
>> that he loves that actually pays a living
>> wage. :-)
>
>> --
>> David Fanning, Ph.D.
>> Fanning Software Consulting, Inc.
>> Coyote's Guide to IDL Programming:http://www.idlcoyote.com/
>> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
>
> Thank very much David
> Zolile- Hide quoted text -
>
> - Show quoted text -

The original data(fit format) of this data have plotted a plot with
gaps, I wrote that data to ascii format.
I thought I will get similar plot but with gaps and fill those gaps
using interpolation function.
Any help will be highly appreciated.
Thanks
Zolile
Re: IDL QUESTIONS (INTERPOLATION) [message #78507 is a reply to message #78366] Mon, 21 November 2011 12:34 Go to previous message
zolile mtumela is currently offline  zolile mtumela
Messages: 50
Registered: September 2011
Member
On Nov 21, 10:15 pm, David Fanning <n...@dfanning.com> wrote:
> zolile mtumela writes:
>> Thank so much David, for time axis it looks ok.
>> I am bit confused why at the y-axis(velocity), my program plot big
>> values which are not in the data. I got big values like(500)
>> After interpolation, Is it necessary to resample data? Are any better
>> way to use interpolation in this kind of data.
>
> I don't know. There were big values in the data you
> sent us. I don't think it is necessary to resample
> the data. It seems to track the real data exactly. :-)
>
>> Thank so much for ur tireless support and help.
>
> Yes, I was just having lunch with one of my
> sons, encouraging him to not follow in his
> father's footsteps. Rather, to find a job
> that he loves that actually pays a living
> wage. :-)
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.idlcoyote.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

Thank very much David
Zolile
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Plotting one ps file with different plots in separate pages
Next Topic: Faster way to search/split a string?

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

Current Time: Wed Oct 08 15:17:30 PDT 2025

Total time taken to generate the page: 0.00479 seconds