Hi All,
I am a new user to IDL.I have to read data from given ASCII files and store it in a new structure,with the following elements:
NumROI-vector
Name-String
Color- 3 element vector
NumPoints-integer
Records-integer
Points- Two dimensional vector.
This is the program I have written, but unfortunately an error pops up saying,'READF: Input conversion error. Unit: 103,'
Is there anything I can do to handle this..?I am very new to IDL..Please do help me out.
PRO ROI_GraH
p =MAKE_ARRAY(5,198,value=1)
ROIs = CREATE_STRUCT('NumROI',[1],'Name','a','Color','1,1,1','NumPo ints',[1],'Records',[1],'Points',p[*,*])
OPENR, lun1,'C:\Users\PRSIV1\IDLWorkspace84\Trial\2013_IEEE_GRSS_DF _Contest_Samples_TR(1).txt', /GET_LUN
header = STRARR(12)
READF, lun1, header
ROIs.NumROI=STRMID(header(3),18)
ROIs.Name=STRMID(header(9),12)
ROIs.NumPoints=STRMID(header(11),13)
ROIs.Color=STRMID(header(10),17)
pt = []
id=1;
points = [id , x, y, lat, lon]
WHILE ~EOF(lun1) DO BEGIN
READF, lun1, id, x, y, lat, lon
pt = [id,x,y,lat,lon]
;print, pt
points = [points , pt]
ENDWHILE
points=REFORM(points , [ 5 , 198 ] , /OVERWRITE)
coords=points(1:2,*)
PRINT, coords
END
|