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

Home » Public Forums » archive » Re: reading large multicolumn data file
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: reading large multicolumn data file [message #72135 is a reply to message #72133] Fri, 06 August 2010 07:23 Go to previous messageGo to previous message
bio_amateur is currently offline  bio_amateur
Messages: 7
Registered: August 2010
Junior Member
On Aug 5, 11:05 pm, Paulo Penteado <pp.pente...@gmail.com> wrote:
> On Aug 5, 8:54 pm, bio_amateur <hoangtrongminht...@gmail.com> wrote:
>
>
>
>> I have a data file (a few hundreds MB). This is a text file in the
>> format X Y1 Y2 Y3 (first column is the common x-axis data, next
>> columns are data). I can read the data and plot easily with xmgrace
>> using
>
>> xmgrace -nxy data.dat
>
>> which take a few seconds to plot. Now, I want to use IDL to read this
>> file and display using iTool. What I did was
>
>>  data = read_ascii(filename)
>>  myPlotData = data.(0)
>>  rows = (size(myPlotData, /dimension))[0]
>>  for ii=1, rows do begin
>>        iPlot, myPlotData[0,*], myPlotData[ii,*], /overplot
>>  end
>
>> This method takes so long. Could someone good at this can point out a
>> solution for me.
>
> The iTools, as any use of object graphics, can get heavy in memory
> when the number of vertices is large (typically, from several hundred
> thousand). This may be alleviated if change your IDL preferences to
> use hardware rendering, in case it is not already in hardware. Other
> than that, only using direct graphics will solve it, as in
>
> minx=min(myplotdata[0,*],max=maxx)
> miny=min(myplotdata[1:*,*],max=maxy)
>
> plot,[minx,maxx],[miny,maxy],/nodata
> for ii=1,rows-1 do oplot,myplotdata[0,*],myplotdata[ii,*]

Now, plotting is pretty fast. However, data reading is still slow,
compared to xmgrace. Is there a better way than using the 2 steps:
read the data into a structure, and convert a structure to an array as
the way I did.

The second question is xmgrace autoamtically choose one color for each
data field (Y1, Y2, ...). However, with direct graphics in IDL, I only
get one single color. How could we resolve this in IDL.

Thanks,
Tuan
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: quick question to get me started on mapping
Next Topic: concatenate by columns

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

Current Time: Thu Oct 09 22:05:11 PDT 2025

Total time taken to generate the page: 0.08272 seconds