Go to the list of seismic processes.           Go to SIOSEIS introduction.           Go to SIOSEIS examples.

                      PROCESS GRDOUT
                      ------- ------

Parameters, alphabetically:
command   comment   hdrpad    lprint    opath     set
title     xinc      xmax      xmin      xunits    yinv
ymax      ymin      yunits    zmax      zmin      zscale
zunits

Document Date: 14 January 2004
Modifications:
Jan. 2004 - Add parameter HDRPAD
Feb. 2005 - Make HDRPAD automatic on PC (need on Mac only)


     Process GRDOUT writes a GMT grid file (grdfile) format 1.
GRDOUT collects all the traces on disk and then transposes them
so that all like times are in a row.

     GRDOUT is an "offline process" or "fork process"; it does
not write it's output for the next process in the procs list.  
The input trace is not modified and is passed to the next
process in the PROCS list.

     The data are time reversed because the GMT Y-axis and the
seismic reflection time axis are reversed.


PARAMETER DICTIONARY
--------- ----------

OPATH  - The output grdfile.  When using this filename for GMT,
         append "=1" to it since it is in GMT format 1.  e.g.
         grdimage grdfil=1
         REQUIRED.           e.g. grdfil

SET    - Start and End Time to output.
         Preset = delay to end of first trace.

XMIN   - The x_min value to insert into the grdfile header.
         Preset = 0

XMAX   - The x_max value to insert into the grdfile header.
         Preset = the number of traces - 1

XINC   - The x_inc value to insert into the grdfile header.
         Preset = 1

YMIN   - The y_min value to insert into the grdfile header.
         Preset = 0

YMAX   - The y_max value to insert into the grdfile header.
         Preset = the number of time samples - 1

YINC   - The y_inc value to insert into the grdfile header.
         Preset = 1

ZMIN   - The z_min value to insert into the grdfile header.
         Preset = most negative trace amplitude of all traces.

ZMAX   - The z_max value to insert into the grdfile header.
         Preset = most positive trace amplitude of all traces.

ZSCALE - The z_scale value to insert into the grdfile header.
         Preset = 1

XUNITS - The ASCII x_units to insert into the grdfile header.
         Preset = km

YUNITS - The ASCII y_units to insert into the grdfile header.
         Preset = secs

ZUNITS - The ASCII x_units to insert into the grdfile header.
         Preset = amplitude

TITLE  - The ASCII title to insert into the grdfile header.
         Preset = 

COMMAND - The ASCII command to insert into the grdfile header.
         Preset = 

COMMENT - The ASCII comment to insert into the grdfile header.
          Preset = Processed by SIOSEIS

HDRPAD - A YES/NO swicth indicating whether to pad the GMT header
         with an extra 4 bytes or not.  SUN/SGI/HP need the pad.
         OSX and PC do not.  The need of the pad depends on how GMT
         was compiled and is due to the byte alignment of the C
         DOUBLE.  Must be set to NO on Mac OSX.
         Preset = yes, except on PC            e.g.   hdrpad no

LPRINT - SIOSEIS debug print switch.
       = 4, Print the grdfile header, similar to grdinfo 
         Preset 4

Written by:
Paul Henkart, Scripps Institution of Oceanography, January 2001
Copyright (C) The Regents of The University of California
All Rights Reserved.


more gmt_grd.h
/*--------------------------------------------------------------------
 *    The GMT-system:	@(#)gmt_grd.h	3.17  02/06/99
 *
 *	Copyright (c) 1991-1999 by P. Wessel and W. H. F. Smith
 *	See COPYING file for copying and redistribution conditions.
 *
 *	This program is free software; you can redistribute it and/or modify
 *	it under the terms of the GNU General Public License as published by
 *	the Free Software Foundation; version 2 of the License.
 *
 *	This program is distributed in the hope that it will be useful,
 *	but WITHOUT ANY WARRANTY; without even the implied warranty of
 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *	GNU General Public License for more details.
 *
 *	Contact info: www.soest.hawaii.edu/gmt
 *--------------------------------------------------------------------*/
/*
 * grd.h contains the definition for a GMT-SYSTEM Version >= 2 grd file
 *
 * grd is stored in rows going from west (xmin) to east (xmax)
 * first row in file has yvalue = north (ymax).  
 * This is SCANLINE orientation.
 *
 * Author:	Paul Wessel
 * Date:	26-MAY-1990
 * Revised:	21-OCT-1998
 */
 
#include "netcdf.h"

/* Nodes that are unconstrained are assumed to be set to NaN */

#define GRD_COMMAND_LEN	320
#define GRD_REMARK_LEN	160
#define GRD_TITLE_LEN	 80
#define GRD_UNIT_LEN	 80

struct GRD_HEADER {
	int nx;				/* Number of columns */
	int ny;				/* Number of rows */
	int node_offset;		/* 0 for node grids, 1 for pixel grids */
	double x_min;			/* Minimum x coordinate */
	double x_max;			/* Maximum x coordinate */
	double y_min;			/* Minimum y coordinate */
	double y_max;			/* Maximum y coordinate */
	double z_min;			/* Minimum z value */
	double z_max;			/* Maximum z value */
	double x_inc;			/* x increment */
	double y_inc;			/* y increment */
	double z_scale_factor;		/* grd values must be multiplied by this */
	double z_add_offset;		/* After scaling, add this */
	char x_units[GRD_UNIT_LEN];	/* units in x-direction */
	char y_units[GRD_UNIT_LEN];	/* units in y-direction */
	char z_units[GRD_UNIT_LEN];	/* grid value units */
	char title[GRD_TITLE_LEN];	/* name of data set */
	char command[GRD_COMMAND_LEN];	/* name of generating command */
	char remark[GRD_REMARK_LEN];	/* comments re this data set */
};

/*-----------------------------------------------------------------------------------------
 *	Notes on node_offset:

	Assume x_min = y_min = 0 and x_max = y_max = 10 and x_inc = y_inc = 1.
	For a normal node grid we have:
		(1) nx = (x_max - x_min) / x_inc + 1 = 11
		    ny = (y_max - y_min) / y_inc + 1 = 1
		(2) node # 0 is at (x,y) = (x_min, y_max) = (0,10) and represents the surface
		    value in a box with dimensions (1,1) centered on the node.
	For a pixel grid we have:
		(1) nx = (x_max - x_min) / x_inc = 10
		    ny = (y_max - y_min) / y_inc = 10
		(2) node # 0 is at (x,y) = (x_min + 0.5*x_inc, y_max - 0.5*y_inc) = (0.5, 9.5)
		    and represents the surface value in a box with dimensions (1,1)
		    centered on the node.
-------------------------------------------------------------------------------------------*/

Go to the list of seismic processes.      Go to SIOSEIS introduction.