In the products directory, run script make_area, contents of which are shown below.

	# Convert r4 to 8bit file, set low and high to reasonable limits.
	r4to8bit -low -30 -high 0 ../DTM/Letang$1	

	# mix colour and intensity (mix_ci), modulates depth data with intensity from sun illumination.
	# output is a .ppm file with colourcoded, sun illuminated depth with chart background.
	mix_ci \
	        -mask ../DTM/Letang$1.sun_315 \
	        -ignore 255 \
	        -c ../DTM/Letang$1.8bit \
	        -i temp.sun \
	        -urgb ../Chart/Letang$1 \
	        -ppm \
	        -m Letang$1_dep_chart.ppm
	xv Letang$1_dep_chart.ppm &

	# Stretch histogram of sidescan mosaic.  Output is mosaiced sidescan with chart backdrop.	
	stretchacres -low 120 -high 180 -in ../MOS/Letang$1.mos -out temp.mos

	stencil \
	        -mask ../MOS/Letang$1.mos \
	        -ignore 255 \
	        -in temp.mos \
	        -under ../Chart/Letang$1.band1 \
	        -out temp.band1
	stencil \
	        -mask ../MOS/Letang$1.mos \
	        -ignore 255 \
	        -in temp.mos \
	        -under ../Chart/Letang$1.band2 \
	        -out temp.band2
	stencil \
	        -mask ../MOS/Letang$1.mos \
	        -ignore 255 \
	        -in temp.mos \
	        -under ../Chart/Letang$1.band3 \
	        -out temp.band3
	mix_ci \
	        -urgb temp \
	        -ppm \
	        -m Letang$1_mos_chart.ppm \
	        -i temp.band1 \
	        -c temp.band1 \
	        -mask temp.mos \
	        -ignore 0 \
	xv Letang$1_mos_chart.ppm &
This script is run (in DFO data) in following manner:

	make_area 3

This script creates two .ppm files (one for depth, one for sidescan).  These are converted to GIF using XV.

Next Step is to make contours.  In order to keep them smooth, the resolution of the r4 data is reduced:

	decr4 -count 4 -in ../DTM/Letang3.r4 -out temp.dec.r4

The count flag is the reduction factor (in this case, 4x4 pixel region becomes one pixel in the output).  The temporary output file is used in the next step to produce contours:

	contgrid temp.dec.r4 Letang3.cont

contgrid asks for input (min, max and interval...followed by labelling interval).  Min is the deepest depth...WITH A NEGATIVE SIGN PRECEDING IT!!!!  Max is the shallowest depth (usually 0???), interval is the contouring interval.  They are labelled at the labelling interval. 

One can then jview the contours overlaid on the image using the following command:

	jview ../DTM/Letang3.8bit -vectbin Letang3.cont

A grid (based on the image coordinates) is created using the following command:

	lineplot -area ../DTM/Letang3.8bit -grid 2 2 -vectbin Letang3.cont 6 1

The grid flag sets the grid size and labelling interval (2 2 in this case specifies grids every 2/10 of a nautical mile, with labelling at the same interval).  The vectbin flag includes the contours in the plot and colours them and their labels according to the last two values (6 1,...6 is colour of contour lines, red in this case while 1 is black and the colour of the contour labels).  

The output file is named plot.meta and can be viewed with: 

	viewmeta plot.meta

Finally, the plot.meta file is converted into a .plt file:
	hpgl plot.meta Letang3.plt

The three resulting files are then brought into Corel Draw...done!

Useful tips:
- get the contours, grid and contour labels into separate .plt files, this makes life much easier in Corel Draw, i.e.:

	Do contgrid with the contour labelling interval set to an unreasonably high number such that the contours are not labelled.

	Do lineplot with the grid tick interval set at an unreasonably high number and use -vectbin to get a border with contours only.

Last modified: February 21st, 2001