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

Home » Public Forums » archive » Data Handling
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
Data Handling [message #11548] Tue, 21 April 1998 00:00 Go to next message
Neil Winrow is currently offline  Neil Winrow
Messages: 18
Registered: July 1997
Junior Member
Can anyone please offer me any advice. I have a file containing several
blocks of data. Each block of data contains the same amount of data.

indata = fltarr(5,100)
readf,10, indata
;define array size and read first block of data into array

Header info from each block of data seperates the data, so I need to
skip over the header and read the next block of data, the number of data
blocks cannot be determinded from any header info. So the problem
involves having X number of blocks that need to be accessed at any
time. If I use pointers to point to each data block then I can retrieve
the data later, but I'm a little unsure how to go about this.

Many Thanks

Neil
Re: Data Handling [message #11621 is a reply to message #11548] Fri, 24 April 1998 00:00 Go to previous message
Harald Jeszenszky is currently offline  Harald Jeszenszky
Messages: 9
Registered: January 1997
Junior Member
Hello Neil,

I've tried to send you an E-mail several times but it has been returned by
your server
every time, so I answer you in the newsgroup:


> Harald
>
> Thanks for the help, it has been very useful. However, as I'm relatively
> new to IDL, some of the ideas have been hard to follow:
>
> IF (blocks EQ 1) THEN $ ; save block position
> pos = (FSTAT(unit)).CUR_PTR $
> ELSE $
> pos = [TEMPORARY(pos), (FSTAT(unit)).CUR_PTR]
>
> In the above piece of code I can't understand what "pos" does and where
> it is defined in the function.
>
> Many Thanks for your help
>
> Neil


I'm sorry for this rather complicated code but I'll try to explain it
to you:

- The variable "pos" contains the positions of the data blocks within
the data file.

- The function FSTAT(unit) returns an IDL structure containing status
information of the file associated with the logical unit and the
field CUR_POS reflects the current position of the file pointer. To
get access to a field of a structure variable you have to use the
'.' to reference the field.

The statement

pos = (FSTAT(unit)).CUR_POS

is a shorthand for:

info = FSTAT(unit)
pos = info.CUR_POS

- In IDL arrays can be concatenated by the "c=[a, b]" statement. The
statement

pos = [pos, value]

adds one element to the variable "pos". If the initial value of
"pos" is a scalar, the result is a 2-dimensional vector. The
"TEMPORARY()" function is used to speed up the concatenation
procedure and is useful for extending long arrays (see IDL
Reference Guide or Online Help).


After reading the 1st data header (blocks = 1), the variable "pos" is
initialized to a scalar containing the first data block position.
Each new data block (blocks > 1) extends the variable "pos" by one
element. If the data file contains "n" data blocks the variable "pos"
results to an "n"-dimensional vector.


With kind regards
Harald
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Getting graphics output to Windows clipboard
Next Topic: idl process id

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

Current Time: Wed Oct 08 20:11:17 PDT 2025

Total time taken to generate the page: 0.00326 seconds