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

Home » Public Forums » archive » Help with data gaps and interpolation
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Help with data gaps and interpolation [message #90653] Fri, 20 March 2015 07:18 Go to previous message
zolile mtumela is currently offline  zolile mtumela
Messages: 50
Registered: September 2011
Member
Dear All,
I would to get help, sugestions on the ff program. i have tried many ways but I did not succed, any help will be highly appreciated.

1. I want to plot with data gaps which are represented by values such as 9999.99.

2. I would like to interpolate the data again to fill the data gaps.

the data look like this


06-10-2006 19:01:00.000 1.45000 -2.15000 0.120000
06-10-2006 19:02:00.000 1.36000 -2.31000 0.120000
06-10-2006 19:03:00.000 1.39000 -1.76000 0.140000
06-10-2006 19:04:00.000 9999.99 9999.99 9999.99
06-10-2006 19:05:00.000 9999.99 9999.99 9999.99
06-10-2006 19:06:00.000 1.20000 -1.91000 0.220000
06-10-2006 19:07:00.000 1.23000 -1.87000 0.230000
06-10-2006 19:08:00.000 1.22000 -1.84000 0.230000
06-10-2006 19:09:00.000 1.14000 -1.86000 0.310000
06-10-2006 19:10:00.000 1.05000 -1.86000 0.440000
06-10-2006 19:11:00.000 0.920000 -1.87000 0.660000
06-10-2006 19:12:00.000 0.790000 -1.60000 0.420000
06-10-2006 19:13:00.000 0.180000 -1.38000 0.810000
06-10-2006 19:14:00.000 0.900000 -0.970000 0.310000
06-10-2006 19:15:00.000 1.64000 -0.680000 -0.270000
06-10-2006 19:16:00.000 1.73000 -0.680000 -0.210000
06-10-2006 19:17:00.000 1.83000 -0.710000 0.0500000

The program looks like this

File = Dialog_PickFile(Filter='*.txt')

Date_array = 0
time_array = 0
Bx_array = 0
By_array = 0
Bz_array = 0

str = ''

openR, Lun, File,/Get_Lun
readf, Lun, str
while~eof(lun) do begin

readf,lun,date,time,Bx,By,Bz
;print,date,time,Bx,By,Bz

Bx_array = [Bx_array, Bx]
By_array = [By_array, By]
Bz_array = [Bz_array, Bz]
endwhile
free_lun,lun
Bx_array=Bx_array[1:*]
By_array=By_array[1:*]
Bz_array=Bz_array[1:*]

index = where(Bx_array eq 9999.99, count)
if (count gt 9999.99) then Bx_array[index] = !values.f_nan

; interpolate
if Bx_array lt 9999.99 then begin
temp=(Bx_array, count)
result=interpol(Bx_array[temp],temp, time[temp])
endif

Nx = n_elements(Bx_array)
time = findgen(Nx)
time = time/60

; plot with data gaps
plot, time, Bx_array[index];

plot,time, Result

end

Thank in advance for your time.
Zolile
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Overlay Point Source Data on a Map -- http://www.idlcoyote.com/map_tips/ptsource.html
Next Topic: 3d polygon mesh for 3 indpendent variables, x,y,z

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

Current Time: Wed Oct 08 13:55:25 PDT 2025

Total time taken to generate the page: 0.00463 seconds