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

Home » Public Forums » archive » structure
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
structure [message #15151] Fri, 23 April 1999 00:00 Go to next message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Hi

How can I fast reform a structure?

If a structure like b is given

b=create_struct('A',findgen(10000),'B',findgen(10000))

I like to have as result,

b[10000].a
b[10000].b


Twice For next is too slow.

R.Bauer
Re: Structure [message #68043 is a reply to message #15151] Tue, 22 September 2009 09:10 Go to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Sep 22, 10:48 am, woods1 <merria...@yahoo.fr> wrote:
> Hi,
> I have a problem.
>  i do this:
>        file6 = 'E:\DeMarine-DEKO\SARscape-Images
> \TSX1_SAR__GEC_SE___SM_S_SRA_20071122T034336_20071122T034345 \IMAGE_W_SRA_strip_011_W_geo.h6'
>
>       openw, lun, file6, /Get_lun
>
>       for k = 0, n_elements(xpt)-1 do begin
>           if ((xpt[k,0] ge 1 and xpt[k,0] le 15751) and (ypt[k,0] ge 1
> and ypt[k,0] le 12826)) then begin
>           printf, lun, 'A:', xpt[k,0], ypt[k,0], format = '(A3, x,
> 7I)'
>           endif
>           if ((xpt[k,0] ge 15751 and xpt[k,0] le 22501 ) and (ypt[k,0]
> ge 1 and ypt[k,0] le 12826)) then begin
>           printf, lun, 'B:', xpt[k,0], ypt[k,0], format = '(A3, x,
> 7I)'
>           endif
>           if ((xpt[k,0] ge 22501 and xpt[k,0] le 36800 ) and (ypt[k,0]
> ge 1 and ypt[k,0] le 12826)) then begin
>           printf, lun, 'C:', xpt[k,0], ypt[k,0], format = '(A3, x,
> 7I)'
>           endif
>           if ((xpt[k,0] ge 1 and xpt[k,0] le 6076 ) and (ypt[k,0] ge
> 12826 and ypt[k,0] le 57600)) then begin
>           printf, lun, 'D:', xpt[k,0], ypt[k,0], format = '(A3, x,
> 7I)'
>           endif
>           if ((xpt[k,0] ge 6076 and xpt[k,0] le 36800 ) and (ypt[k,0]
> ge 12826 and ypt[k,0] le 17326)) then begin
>           printf, lun, 'E:', xpt[k,0], ypt[k,0], format = '(A3, x,
> 7I)'
>           endif
>           if ((xpt[k,0] ge 6076 and xpt[k,0] le 36800 ) and (ypt[k,0]
> ge 17326 and ypt[k,0] le 23626)) then begin
>           printf, lun, 'F:', xpt[k,0], ypt[k,0], format = '(A3, x,
> 7I)'
>           endif
>           if ((xpt[k,0] ge 6076 and xpt[k,0] le 36800 ) and (ypt[k,0]
> ge 23626 and ypt[k,0] le 57600)) then begin
>           printf, lun, 'G:', xpt[k,0], ypt[k,0], format = '(A3, x,
> 7I)'
>           endif
>
>       endfor
>
>       free_lun, lun
>
>       nrows1 = File_lines(file6)
>
>       EckStruct = {ind:' ', x1: 0L, y1: 0L}
>       data1 = Replicate(EckStruct, nrows1)
>       openr, lun, file6, /get_lun
>       readf, lun, data1
>       free_lun, lun
>
> I have tihs error message : 'READF: Input conversion error. Unit:104'
> where are the problem?
> Can somebody help me?
>
> thank you in advance
> Woods

I think you need a format for readf, to specify how wide the string in
the first field is. The default, which is being used above, is to
assume that the string goes to the end of the line, so it is
incorporating what should be x1 and y1 into ind. Or you could change
the way the file is written and read so that the string field comes
last in the line.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: subset an image by coordinates
Next Topic: 3D data to IDLgrImage

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

Current Time: Wed Oct 08 17:02:42 PDT 2025

Total time taken to generate the page: 0.00411 seconds