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

Home » Public Forums » archive » data criteria
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
data criteria [message #67740] Mon, 24 August 2009 07:33
anil is currently offline  anil
Messages: 34
Registered: August 2009
Member
Hi all,
I do not have much information about programming or algorithms
(actually IDL is my first programming language), so my question may
rather be simple but i could not figure it out , so here we go:

I have lots of data such as:
7.200000 23.789000 18.014000 23.788000 10.895200
9.300000 23.786000 18.025000 23.784000 10.904400
14.700000 23.284000 18.156000 23.281000 11.138100
19.800000 16.863000 18.145000 16.860000 12.654200
24.600000 9.811000 18.199000 9.809000 13.895200
29.700000 9.041000 18.234000 9.039000 14.020000
34.700000 8.627000 18.258000 8.624000 14.088300
39.700000 8.575000 18.378000 8.572000 14.188100
44.800000 8.063000 18.638000 8.060000 14.449600
49.700000 7.925000 19.161000 7.921000 14.873900
54.700000 7.987000 19.425000 7.983000 15.073500
59.900000 8.037000 19.755000 8.032000 15.325900
64.600000 8.079000 19.985000 8.074000 15.501000
69.500000 8.119000 20.130000 8.114000 15.609800
74.400000 8.174000 20.265000 8.168000 15.709000
79.700000 8.214000 20.402000 8.208000 15.811400
84.400000 8.248000 20.509000 8.241000 15.891100
89.600000 8.269000 20.599000 8.262000 15.958900
94.300000 8.289000 20.689000 8.281000 16.026900
99.600000 8.310000 20.763000 8.302000 16.082300
109.000000 8.370000 20.893000 8.361000 16.176800
119.200000 8.439000 21.022000 8.429000 16.269300
129.500000 8.502000 21.138000 8.491000 16.352300
139.400000 8.548000 21.222000 8.536000 16.412300
149.500000 8.587000 21.294000 8.574000 16.463800
159.100000 8.625000 21.360000 8.611000 16.510800
169.400000 8.654000 21.413000 8.639000 16.548600
179.000000 8.679000 21.460000 8.664000 16.582300
189.200000 8.700000 21.505000 8.684000 16.614900
199.200000 8.719000 21.543000 8.702000 16.642300
208.900000 8.732000 21.571000 8.714000 16.662600
219.200000 8.747000 21.606000 8.728000 16.688100
229.400000 8.760000 21.638000 8.740000 16.711600
239.400000 8.771000 21.666000 8.750000 16.732100
249.400000 8.782000 21.693000 8.760000 16.751900
259.400000 8.792000 21.719000 8.769000 16.771100
269.300000 8.802000 21.748000 8.778000 16.792500
279.100000 8.810000 21.768000 8.785000 16.807200
289.200000 8.817000 21.791000 8.791000 16.824400
298.800000 8.823000 21.809000 8.797000 16.837800
323.800000 8.836000 21.854000 8.807000 16.871500
349.600000 8.848000 21.894000 8.817000 16.901500
374.200000 8.856000 21.926000 8.823000 16.925800
399.000000 8.863000 21.957000 8.827000 16.949300
424.300000 8.870000 21.987000 8.832000 16.972200
449.400000 8.875000 22.013000 8.834000 16.992100
474.200000 8.879000 22.036000 8.836000 17.009800
499.400000 8.883000 22.061000 8.838000 17.029100
524.300000 8.886000 22.081000 8.838000 17.044700
549.000000 8.889000 22.103000 8.839000 17.061700
574.200000 8.892000 22.121000 8.840000 17.075700
599.100000 8.895000 22.138000 8.840000 17.088900
648.900000 8.901000 22.166000 8.841000 17.110600
699.500000 8.907000 22.190000 8.842000 17.129200
749.000000 8.914000 22.214000 8.845000 17.147600
799.200000 8.922000 22.233000 8.848000 17.162100
849.100000 8.930000 22.248000 8.851000 17.173400
899.400000 8.940000 22.263000 8.855000 17.184400
949.000000 8.948000 22.274000 8.858000 17.192600
999.100000 8.957000 22.284000 8.862000 17.199900
1048.900000 8.965000 22.291000 8.865000 17.205000
1099.200000 8.973000 22.297000 8.868000 17.209400
1149.200000 8.982000 22.302000 8.872000 17.212800
1199.400000 8.989000 22.306000 8.873000 17.215700
1249.400000 8.997000 22.309000 8.876000 17.217700
1299.200000 9.005000 22.312000 8.879000 17.219700
1349.100000 9.012000 22.314000 8.880000 17.221000
1399.200000 9.020000 22.316000 8.883000 17.222200
1449.000000 9.027000 22.318000 8.884000 17.223600
1499.200000 9.034000 22.319000 8.886000 17.224200
1542.300000 9.040000 22.320000 8.887000 17.224800
1549.700000 9.041000 22.320000 8.887000 17.224800

The 5th column of this data is my area of interest. I want to take the
data(with all 5 columns of corresponding to the line) where the
difference between consecutive lines is smaller than 0.3 . For example
for this data, i have
10.895200
10.904400
11.138100
12.654200
.......
So I want to take the lines from the first line up to 12.654200(since
the difference is more than 0.3)
What i have done so far is :

pro a
;window, 0, retain=2

file_array=file_search('/home/......../0587', '0587.*.txt',
count=num_file)
for i=0,num_file-1 do begin
file=file_array(i)

nrows = File_Lines(file)

data=fltarr(5,nrows)

OpenR, lun, file, /GET_LUN
ReadF, lun, data
Free_Lun, lun

p=data(0,*)
t=data(1,*)
s=data(2,*)
q=data(3,*)
d=data(4,*)
close,lun
free_lun, lun

1st try
;for k=1,nrows-2 do begin k=k+1
;ml=where((d(k+1)-d(k)) gt 0.3,ss)
;endfor

2nd try
;k=1
;repeat begin ml=(d(k)-d(k-1))
;k=k+1
;endrep until (ml gt 0.3)
;print,d(0:k)

free_lun,lun
endfor

close,/All
end

Neither of them work ! I used an if-then-else statement too but could
not solve my problem.
I would really appreciate any help. Thanks in advance,
ANIL
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: SKIP the window "press click to continue" using the VIRTUAL MACHINE
Next Topic: netCDF Browser Update

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

Current Time: Fri Oct 10 09:09:31 PDT 2025

Total time taken to generate the page: 0.96296 seconds