harmonica.load_icgem_gdf
harmonica.load_icgem_gdf¶
- harmonica.load_icgem_gdf(fname, **kwargs)[source]¶
Reads data from an ICGEM .gdf file.
The ICGEM Calculation Service [BarthelmesKohler2016] generates gravity field grids from spherical harmonic models. They use a custom ASCII grid format with information in the header. This function can read the format and parse information from the header. It returns the data in a
xarray.Dataset
for convenience and reduced storage requirements.- Parameters
fname (string or file-like object) – Name of the ICGEM
.gdf
file or an open file object to read from.kwargs – Extra keyword arguments to this function will be passed to
numpy.loadtxt
.
- Returns
grid (
xarray.Dataset
) – Anxarray.Dataset
with the data from the file. The header of the gdf file is available through theattr
attribute of thexarray.Dataset
.