Import ASCII Grid

Use the Grid and Image > Utilities > Import ASCII Grid menu option (READASCIIGRID GX) to read an ASCII formatted grid into a Geosoft grid file.

Import ASCII Grid dialog options

ASCII grid file

The name of the ASCII grid file.

Script Parameter: READASCIIGRID.ASCII

Output grid file

The name of the grid file to create.

Script Parameter: READASCIIGRID.GRID

Number of ASCII lines to skip

This parameter allows for ASCII header lines in the ASCII grid file. Enter the number of ASCII text lines that precede the start of the grid data.

Script Parameter: READASCIIGRID.SKIP

Number of points in each row

The number of grid points to read for each grid row.

Script Parameter: READASCIIGRID.POINTS

Number of rows

The number of grid rows.

Script Parameter: READASCIIGRID.ROWS

Row orientation

Select the grid row orientation from the list.

Script Parameter: READASCIIGRID.KX
1: bottom left to right
-1: left bottom to top
2: left top to bottom
-2: top left to right

Dummy value

The value used to indicate null parts of the grid. The value must be entered exactly as it appears in the ASCII file.

Script Parameter: READASCIIGRID.DUMMY

X grid point separation

The separation between grid points in the X direction.

Script Parameter: READASCIIGRID.DX

Y grid point separation

The separation between grid points in the Y direction.

Script Parameter: READASCIIGRID.DY

X location of bottom left point

The X location of the bottom left point of the grid.

Script Parameter: READASCIIGRID.X0

Y location of bottom left point

The Y location of the bottom left point of the grid.

Script Parameter: READASCIIGRID.Y0

Grid rotation angle, CCW degrees

Rotation of the grid counter-clockwise relative to the ground coordinate system.

Script Parameter: READASCIIGRID.ROT

Application Notes

ASCII formatted grids are commonly produced by other processing systems. Such grids may have a multi-line header that contains information about the grid. The header is followed by the grid node numeric data. Node values are delimited by spaces, tabs or commas . Often a grid row will span over more than one line in the ASCII file. However, a new grid row will always start on a new line. If you can determine the dimensions of the grid and its location relative to your working coordinate system, you can use this GX to import an ASCII grid into a Geosoft grid file.

For example, below is the start of a standard Geological Survey of Canada (GSC) grid, followed by a description of the header:

[GSC.ASC]

Canada - Residual Total Field Magnetics - Public Domain Data
-92.00000 49.00000 77.00000 LAM 2000.00 4 0 0.000 nT
41.00000 -141.00000 89.50000 -141.00000 89.50000 -10.00000 41.00000 -10.00000
63.00000 -92.00000
-1936 2672 -1217 1567 2785 4609

-9999.000 -9999.000 -9999.000 -9999.000 -9999.000 -9999.000 -9999.000 -9999.000 -9999.000 -9999.000 -9999.000
-9999.000 -9999.000 -9999.000 -9999.000 -9999.000 -9999.000 -9999.000 -9999.000 -9999.000 -9999.000 -9999.000
-9999.000 -9999.000 -9999.000 -9999.000 -9999.000 -9999.000 -9999.000 -9999.000 -9999.000 -9999.000 -9999.000
-9999.000 -9999.000 -9999.000 -9999.000 -9999.000 -9999.000 -9999.000 -9999.000 -9999.000 -9999.000 -9999.000
-9999.000 -9999.000 -9999.000 -9999.000 -9999.000 -9999.000 -9999.000 -9999.000 -9999.000 -9999.000 -9999.000

.........................

The GSC describes the grid content as follows: each file must have (i) a (multi-line) header (see below), and (ii) the gridded data.

Record No.1: area identification by area name, NTS map sheet number if applicable, geophysical series number, survey year, flight altitude. Format (A80)

Record No.2 : central meridian (decimal degrees), southern parallel (decimal degrees), northern parallel (decimal degrees), projection (UTM_NAD83), grid cell size in metres, number of coordinate pairs defining area, predominant flight line direction in degrees from north, rotation angle of grid if applicable (usually 0), data unit (e.g. nT). Format (3F10.5, A10, F10.2, 2I5, F10.3, A10)

Record No.3: sequence of latitudes and longitude pairs (decimal degrees) for coordinates defining area beginning with the south-western corner, proceeding clockwise. Format (8F10.5)

Record No.4 : equatorial radius, eccentricity of ellipsoid, latitude of projection origin (decimal degrees) 0 for UTM, scaling factor along a parallel, geoid select NAD27 or NAD83 (for this area use NAD83). Format (F10.2, F10.8, 2F10.5, A5).

Record No.5 : grid origin described by the number of grid cell columns in east direction with respect to projection origin, grid limits described by number of grid cell columns in east direction with respect to projection origin, grid origin described by the number of grid cell rows in north direction with respect to projection origin, grid limits described by number of grid cell rows in north direction with respect to projection origin, number of grid cell rows, number of grid cell columns. Format (6I10). From this we can see that the grid has 2785 points in 4609 rows of data.

The grid rows are organized from the left bottom to the top, and the grid cell size is 2000 metres. We also see that the location of map coordinate origin is at –92, 41 (longitude, latitude), which is 1936 grid points East of the grid origin. This places the grid origin at (–3872000,0) metres, on a Lambert Conformal projection with a central meridian –92 degrees, South standard parallel 49 degrees, North standard parallel 77 degrees, and origin at (-92,41) degrees longitude, latitude.

To read this grid to a new grid file, the following entries would be used:

ASCII grid file

GSC.ASC

Output grid file (*.grd)

GSC.GRD (GRD)

Number of ASCII lines to skip

5

Number of points in each row

2785

Number of rows

4609

Row orientation

"Left bottom to top"

Dummy value

-9999.000

X grid point separation

2000

Y grid point separation

2000

X location of bottom left point

-3872000

Y location of bottom left point

0

Grid rotation angle, CCW degrees

0.0