On 10/20/2010 11:12 AM, Ingo Schmid wrote:
>
> So you suggest something like
> 
> $all=readflex('data',[{Dims=>[32+2*$xsize,$records],Type=>'float'}])

Yes.  That reduces the number of file reads
by a factor of $records*2 (the number of calls
to readflex by a factor of $records).

> Then
> 
> $hdr=$all(:31,)
> $data=$all(32:,)->reshape(2,$xsize,$records)

You can use substr() and unpack with your
templates to extract the needed index offsets
from the $hdr.

The reduction in file IO and readflex calls should
improve performance significantly.  Even if the

  data(,x,header(field_y),header(field_z), ...)+=line

part is still done by perl loop.  I would still
expect it to run much faster.

Good luck,
Chris
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to