Particle tracking using IDL -- John C. Crocker and
Eric R. Weeks
Home |
Download software |
Tutorial |
Extra software
readtext.pro
write_text.pro
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> write_text,t,'sinewave.txt'
IDL> t2 = readtext('sinewave.txt')
There are several keywords you can use:
write_text
- /COMMA; the default is to separate columns with tabs, this
option changes, that, to, commas,,,,
readtext
- /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)
IDL> print,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.
Contact us