Particle tracking using IDL -- John C. Crocker and
Eric R. Weeks
Download software |
These are simple routines to read & write text arrays. Both of
these are for 2D arrays only.
IDL> t = fltarr(2,100)
IDL> t(0,*) = findgen(100)*0.2
IDL> t(1,*) = sin(t(0,*))
IDL> t2 = readtext('sinewave.txt')
There are several keywords you can use:
- /COMMA; the default is to separate columns with tabs, this
option changes, that, to, commas,,,,
- /INT; assumes text file contains only integers. The default
is to read in the data as a floating point array.
- HEAD; assumes first line of text file is a header, and
returns it in this variable:
IDL> t2 = readtext('sinewave.txt',head)
- /QUIET; turns off printing of messages
These programs were written by John Crocker & David Grier. Eric
added /INT. This web page was written by Eric.