l3py.io

File I/O for gravity field representations and gridded data.

io.loadgfc(nmax=None)

Read a set of potential coefficients from a GFC file.

Parameters:
  • fname (str) – name of GFC file
  • nmax (int) – truncate PotentialCoefficients instance at degree nmax (Default: return the full field)
Returns:

gf – PotentialCoefficients instance

Return type:

PotentialCoefficients

io.savegrids(grids, reference_epoch=None)

Write a list of Grid instances to a netCDF file. In order to properly define the time coordinate, make sure the epoch member of each grid in the passed container is set.

Parameters:
  • fname (str) – name of netCDF file
  • grids (list of Grid instances) – list of grids to be written to file
  • reference_epoch (datetime) – reference epoch for time axis (Default: use January 1st of year of first grid)