Utilities to read/write extended and legacy GSLIB files in Julia.
The GSLIB file format was introduced a long time ago for storing geospatial data over Cartesian grids or point sets in text files that are easy to read. Unfortantely, the format specification is incomplete:
- it doesn't contain the size of the grid (i.e.
(nx, ny, nz))
- it doesn't specify the origin and spacing (i.e.
(ox, oy, oz),
(sx, sy, sz))
- it doesn't specify the special symbol for inactive cells (e.g.
- it doesn't specify which variable names are geospatial coordinates
This package introduces an extended GSLIB format that addresses these issues. It also provides helper functions to load data in legacy format.
Get the latest stable release with Julia's package manager:
] add GslibIO
load for the extended GSLIB file format and
load_legacy for the legacy GSLIB file format.
Consult the docstring of each function for more information.
An usual workflow consists of loading a legacy file with
by setting the options manually, and then saving the data back to disk
in extended format with
save. The new extended format can then be
loaded without human intervention.
using GslibIO # load grid data stored in legacy format data = GslibIO.load_legacy("legacy.gslib", (100,100,50), na=-999) # save grid data in new extended format GslibIO.save("extended.gslib", data) # now it can be loaded without special options GslibIO.load("extended.gslib")