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

Home » Public Forums » archive » Re: Help needed with reading ASCII data
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Help needed with reading ASCII data [message #18131] Fri, 03 December 1999 00:00 Go to previous message
Michael Asten is currently offline  Michael Asten
Messages: 53
Registered: March 1999
Member
Liam Gumley wrote:I'm assuming your data file looks something like this:

>
> 0, 0, 0.998
> 1, 0, 0.976
> 2, 0, 0.876
>
> It sounds like you're not really interested in the x and y coordinates,
> since they are probably the same for all 22 time phases. In this case,
> you can read the array in one hit:
>
> ;- Read the data file
> openr, lun, 'mri.dat', /get_lun
> data = fltarr(3, 38808)
> readf, lun, data
> free_lun, lun
>
> ;- Extract the magnitude array
> h = data[2, *]
> h = reform(h, 49, 36, 22)
>
> ;- Visualize the data as an image sequence
> mag = 5
> for index = 0, 21 do tvscl, rebin(h[*, *, index], mag*49, mag*36, 1,
> /sample)
>
> Cheers,
> Liam.
>

Or, if your data file is not always of identical length, try using the idl
routine READ_ASCII, which will read an arbitrary number of columns and rows
of any data type, into a structure.

Regards,
Michael Asten
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: do I really need to use loops on objects?
Next Topic: POLYFILLV for 3D to create volumes

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

Current Time: Fri Oct 10 14:27:48 PDT 2025

Total time taken to generate the page: 0.87535 seconds