Spatial Power SpectraΒΆ

Compute and plot the spatial power spectrum of the time-dependent internal field given by CHAOS.

Spatial power spectra at Earth's surface
/home/docs/checkouts/ UserWarning: Missing calibration parameters: 'pp_CAL'
  warnings.warn(f'Missing calibration parameters: {err}')

import chaosmagpy as cp
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import numpy as np

model = cp.CHAOS.from_mat('CHAOS-6-x9.mat')  # load the mat-file of CHAOS-6-x9

nmax = 20
time = cp.data_utils.mjd2000(2018, 1, 1)
degrees = np.arange(1, nmax+1, dtype=int)

fig, ax = plt.subplots(1, 1, figsize=(12, 7))

for deriv, label in enumerate(['nT', 'nT/yr', 'nT/yr$^2$']):

    # get spatial power spectrum from time-dependent internal field in CHAOS
    spec = model.model_tdep.power_spectrum(time, nmax=nmax, deriv=deriv)
    ax.semilogy(degrees, spec, label=label)


ax.yaxis.set_major_locator(ticker.LogLocator(base=10.0, numticks=15))

ax.set_title("Spatial power spectra at Earth's surface", fontsize=14)
ax.set_xlabel('Spherical harmonic degree')


Total running time of the script: ( 0 minutes 0.465 seconds)

Gallery generated by Sphinx-Gallery