In [1]:
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import pyshtools
import pyshtools.constant as shconstant

In [2]:
lmaxin = 2190
file = 'EGM2008_to2190_ZeroTide.shm'
coeffs,errors,lmax = pyshtools.shio.SHReadError(file, lmaxin)
coeffs[0,0,0] = 1.0

In [3]:
geoid = pyshtools.gravmag.MakeGeoidGridDH(coeffs,
                            r0pot = shconstant.r0_pot_earth,
                            GM = shconstant.wgs84_gm,
                            PotRef = shconstant.wgs84_u0,
                            omega=shconstant.wgs84_omega,
                            a = shconstant.wgs84_a,
                            f = shconstant.wgs84_f,
                            order=1, 
                            lmax_calc = 720)

In [4]:
g = pyshtools.SHGrid.from_array(geoid)

In [5]:
g.plot()


Out[5]:
(<matplotlib.figure.Figure at 0x104ff4c10>,
 <matplotlib.axes._subplots.AxesSubplot at 0x1055afc50>)

In [6]:
rad, theta, phi, total, pot = pyshtools.gravmag.MakeGravGridDH (coeffs, 
                                                  gm = shconstant.wgs84_gm, 
                                                  r0=shconstant.r0_pot_earth, 
                                                  a=shconstant.wgs84_a, 
                                                  f=shconstant.wgs84_f,
                                                  sampling=2,
                                                  normal_gravity=1,
                                                  omega=shconstant.wgs84_omega,
                                                  lmax_calc=720)

In [7]:
p = pyshtools.SHGrid.from_array(pot)

In [8]:
p.plot()


Out[8]:
(<matplotlib.figure.Figure at 0x103931810>,
 <matplotlib.axes._subplots.AxesSubplot at 0x153bdb990>)

In [9]:
pyshtools.SHGrid.from_array(rad).plot()


Out[9]:
(<matplotlib.figure.Figure at 0x13ccfce50>,
 <matplotlib.axes._subplots.AxesSubplot at 0x19dce3b90>)

In [10]:
pyshtools.SHGrid.from_array(theta).plot()


Out[10]:
(<matplotlib.figure.Figure at 0x19dfaf550>,
 <matplotlib.axes._subplots.AxesSubplot at 0x19dd36550>)

In [11]:
pyshtools.SHGrid.from_array(phi).plot()


Out[11]:
(<matplotlib.figure.Figure at 0x19e00ff50>,
 <matplotlib.axes._subplots.AxesSubplot at 0x19dfb93d0>)

In [12]:
pyshtools.SHGrid.from_array(total).plot()


Out[12]:
(<matplotlib.figure.Figure at 0x19e25ba10>,
 <matplotlib.axes._subplots.AxesSubplot at 0x19e164650>)

In [ ]: