READCOL compilation error [message #41790] |
Tue, 07 December 2004 10:54 |
newbie16
Messages: 11 Registered: December 2004
|
Junior Member |
|
|
Hi there,
I hope someone can help me out here. First off, I am an IDL virgin,
and making my first plots as of today...So I apologize if my question
is trivial, but there doesn;t seem to be an answer posted for the
compliation error i get.
Presently, I am trying to contour up some data [x,y,z] and have it
stored in an ASCII file xyz.dat.
I am intend to use the READCOL function to open and read the data, but
I can't seem to compile the READCOL program. (I assumed I have to
compile READCOL first before i can call it in my own procedure.)
Anyways, I get the following error:
================================ SNIP
====================================
[thayes@somemachine ~virIDL]$ idl
IDL Version 6.0 (linux x86 m32). (c) 2003, Research Systems, Inc.
IDL> .compile READCOL
tst = strnumber(var[i],val,hex=hex[i]) ;Valid
number?
^
% Syntax error.
At: /home/thayes/virIDL/READCOL.pro, Line 244
% 1 Compilation error(s) in module READCOL.
IDL>
================================ SNIP
====================================
I have absolutely NO IDEA what is wrong here....Have I downloaded the
wrong version? The one I have was last modified in May 2002.
Cheers and thanks in advance for any help or advice you may have.
Tyler
PS - My actual procedure to create the contoured data set, which calls
READCOL is also given at the end of the posting. Any suggestions are
greatly appreciated!
---===<<0>>===---
pro grvcontour
; This is a preliminary attempt at creating a contoured data set
; of the gravity values from GRAV.f. The data output was formatted
; by a simple shell script called datacut.sh.
; DATACUT.SH produces output as a ".dat" file:
;------------------------------------
;col 1 |col 2 | col 3 |
;------------------------------------
; <x[km]> <y[km]> <grav[microGal]>|
;------------------------------------
; Moreover, the data output by DATACUT is space delimited with varying
; number lengths. As such it is not totally "formatted" in a regular
; way. Therefore use READCOL
;----------------------------------------------------------- ----------
; Set the printing device to "ps" output
set_plot,'PS'
device,/color,bits=8
device, filename='xyz.ps'
; First we must open and read the data file using the READCOL.pro
; program. See the notes in the READCOL comments for usage
; READCOL is from
; http://www.astro.washington.edu/deutsch-bin/ $
; getpro/library01.html?READCOL
FMT = 'F,F,F'
READCOL, 'xyz.dat',F=FMT,xlong,ylat,grav
; Now we must smooth the data using an interpolation scheme.
; There is some documentation (old) which suggests that triangulate
; doesn't work well with large datasets and thus congrid should be
; used instead, which effectively resamples the data set...but let's
; try this anyways.
triangulate,xlong,ylat,grvtri
; Below are some extra vectors which may be used to make a finer mesh
; for the resampling of the gravity data. Uncomment later
;spacing = [1.0, 1.0]
;limits = [0.0, 0.0, 600.0, 600.0]
grvgrid = trigrid(xlong,ylat,grav,grvtri,xgrid=xgrid, $
ygrid=ygrid,/quintic)
; Below is the contour plot of the data with filled spaces between the
; contours.
contour,grvgrid,xgrid,ygrid,/cell_fill
; Alternatively, uncomment to make a surface plot of the data
;surface,grvgrid,xgrid,ygrid
; Must close the "PS" file to get proper output
device,/close_file
end
|
|
|