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
str
or file-likeobject
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
.
- fname
- Returns:
- grid
xarray.Dataset
An
xarray.Dataset
with the data from the file. The header of the gdf file is available through theattr
attribute of thexarray.Dataset
.
- grid