This module provides routines for reading and writing spherical harmonic coefficients to and from files, and for converting spherical harmonic coefficients to different normalization conventions.

Spherical harmonic I/O

Function name Description
shread Read shtools-formatted spherical harmonic coefficients from a text file.
shwrite Write shtools-formatted spherical harmonic coefficients to a text file.
read_dov Read spherical harmonic coefficients from a text file formatted as [degree, order, value].
write_dov Write spherical harmonic coefficients to a text file formatted as [degree, order, value].
read_bshc Read real spherical harmonic coefficients from a binary bshc-formatted file.
write_bshc Write real spherical harmonic coefficients to a binary bshc-formatted file.
read_icgem_gfc Read real spherical harmonic gravitational potential coefficients and associated errors from an ICGEM GFC formatted file.
write_icgem_gfc Write real spherical harmonic gravitational potential coefficients and associated errors to an ICGEM GFC formatted file.
read_igrf Read IGRF real spherical harmonic coefficients, and return the magnetic potential coefficients for the specified year.
SHRead2 Read spherical harmonic coefficients from a CHAMP or GRACE-like ascii-formatted file.
SHRead2Error Read spherical harmonic coefficients and associated errors from a CHAMP or GRACE-like ascii-formatted file.
SHReadJPL Read spherical harmonic coefficients from a JPL ascii-formatted file.
SHReadJPLError Read spherical harmonic coefficients and associated errors from a JPL ascii-formatted file.

Spherical harmonic storage

Function name Description
SHCilmToCindex Convert a three-dimensional array of complex spherical harmonic coefficients to a two-dimensional indexed array.
SHCindexToCilm Convert a two-dimensional indexed array of complex spherical harmonic coefficients to a three-dimensional array.
SHCilmToVector Convert a 3-dimensional array of real spherical harmonic coefficients to a 1-dimensional ordered array.
SHVectorToCilm Convert a 1-dimensional indexed vector of real spherical harmonic coefficients to a 3-dimensional array.
YilmIndexVector Determine the index of a 1-dimensional ordered vector of spherical harmonic coefficients corresponding to i, l, and m.

Spherical harmonic conversions

Function name Description
convert Convert an array of spherical harmonic coefficients to a different normalization convention.
SHrtoc Convert real spherical harmonics to complex form.
SHctor Convert complex spherical harmonics to real form.
Edit me