Hello,
I'm a new user of gri and though I've been able to
successfully run many of the examples I continue to be
unable to do the one thing that I must do in the next
few days prior to getting aboard an oceanographic
research ship for two weeks. I've been trying to use
gri to generate grayscale or color images of
bathymetric data that is stored in an asci file
(attached). I've inserted some header information at
the top of the file (such things as number of rows,
number of columns, etc.) which gri seems to read fine.
However I cannot get the plot I'm after in spite of
numerous attempts. When I attempt to view the output
file (map.ps) using "gv" I can see some elements of the
plot, including a histogram, but the bulk of the image
is covered with a (nearly) opaque dark rectangle. If I
look carefully (tilt laptop screen just right) I can
see a set of axes underneath the covering rectangle.
One specific thing that continues to baffle me is why
the axis run from 1 to 10 (which are the lengths, in
cm, that I specify) as opposed to in user units. I
apologize in advance if I'm really doing something
really stupid. Any help is MUCH appreciated.
The script I'm using is below and is invoked as follows:
gri map.gri
I've also attached the data file that I'm using for
testing. Ideally it would show up as a color bathymetry
map of Monterey Bay, CA.
Thanks!
Jim
**********************Script************************
# Create image from ascii bathy data (226 rows by 196
columns)
# Enter a "skip" to skip ONE line of ascii input file
# Set up all header variables so that each is on a
separate line. This facilitates
# them being read into unique variables in the script
# Define variables for postscript
#.xleft. = 0
#.ybottom. = 0
#.xright. = 10
#.ytop. = 10
#set bounding box .xleft. .ybottom. .xright. .ytop. cm
open testHead.dat
# Note: Strings in file must be delimited by " " marks
# Read header variables
read line \plotTitle
read .nRows.
read .nCols.
read .xMin.
read .xMax.
read .xInc.
read .yMin.
read .yMax.
read .yInc.
read .minColorScale.
read .maxColorScale.
# Now read the asci image data
read grid data .nRows. .nCols.
close
# Set axis to have user units
set x axis .xMin. .xMax. .xInc.
set y axis .yMin. .yMax. .yInc.
# Set intensity scale IN USER UNITS
set image range .minColorScale. .maxColorScale.
set page size letter
set page landscape
set x grid 1 .nCols. 1
set y grid 1 .nRows. 1
set x name "Frequency (Hz)"
set y name "Time (sec)"
set y axis name horizontal
set x size 10
set y size 10
set x format %.1f
set y format %.lf
set x margin 1
set y margin 1
..xleft.. = 0
..xright.. = 10
..xinc.. = 1
..ybottom.. = 0
..ytop.. = 10
..yinc.. = 1
#set clip postscript on
convert grid to image
#draw image palette
#convert grid to image size 640 480
draw image
draw image histogram
show all
ASCI test file (11 line header followed by 226 rows each containing 196 data points (column width)