PRO lines, file_in, file_out
; by
; Lars C
; modified by
; Bo, May 21, 1994
if n_params() eq (0) then begin
print
print, 'Procedure lines'
print
print, 'Usage:'
print, 'lines, file_in, file_out'
print
print, 'Description:'
print, 'This procedure converts an data file to a binary file in a format'
print, 'suitable for the Explorer module Line2Geo'
print
print, 'file_in : name of data ascii input file - example:'
print, '(NB: you should probably not include comments)'
print
print, '2 # number of points to be connected with a line'
print, '0.0 # x-coordinate of the first point'
print, '0.0 # y-coordinate of the first point'
print, '0.0 # z-coordinate of the first point'
print, '1.0 # x-coordinate of the second point'
print, '0.0 # y-coordinate of the second point'
print, '0.0 # z-coordinate of the second point'
print, '0.99 # R - color of first object'
print, '0.0 # G - color of first object'
print, '0.00 # B - color of first object'
print, '2 # number of points to be connected with a line'
print, '1.0 # x-coordinate of the first point'
print, '1.0 # y-coordinate of the first point'
print, '1.0 # z-coordinate of the first point'
print, '2.0 # x-coordinate of the second point'
print, '2.0 # y-coordinate of the second point'
print, '2.0 # z-coordinate of the second point'
print, '0.99 # R - color of second object'
print, '0.0 # G - color of second object'
print, '0.00 # B - color of second object'
print, '-1 # no more data marker'
print
print, 'file_out: name of binary output file'
print
return
end
n = 0L
data = 0.0
openr, lun1, file_in, /get_lun ; ascii input file
openw, lun2, file_out, /get_lun ; binary output file
while (n ne -1) do begin
readf, lun1, n
writeu, lun2, n
for i=0, (n+1)*3-1 do begin
readf, lun1, data
writeu, lun2, data
endfor
endwhile
close, lun1
close, lun2
free_lun, lun1
free_lun, lun2
end