.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/plot_stations.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_plot_stations.py: Evaluate CHAOS at a Ground Observatory ====================================== Compute a time series of the first time-derivative of the field components (SV) given by CHAOS. In this example the location of the ground observatory in Niemegk (Germany) is used. Also, the spherical harmonic coefficients of the SV are truncated at degree 16. .. GENERATED FROM PYTHON SOURCE LINES 13-58 .. image-sg:: /gallery/images/sphx_glr_plot_stations_001.png :alt: SV components at Niemegk given by CHAOS-7, d$B_r$/d$t$, d$B_t$/d$t$, d$B_p$/d$t$ :srcset: /gallery/images/sphx_glr_plot_stations_001.png :class: sphx-glr-single-img .. code-block:: default import chaosmagpy as cp import matplotlib.pyplot as plt import numpy as np model = cp.CHAOS.from_mat('CHAOS-7.mat') # load the mat-file of CHAOS-7 data = { 'Time': np.linspace(cp.data_utils.mjd2000(1998, 1, 1), cp.data_utils.mjd2000(2018, 1, 1), 500), 'Radius': 6371.2, # mean radius of Earth's surface in km 'Theta': 37.93, # colatitude in degrees 'Phi': 12.68 # longitude in degrees } # compute SV components with CHAOS up to degree 16 dBr, dBt, dBp = model.synth_values_tdep( data['Time'], data['Radius'], data['Theta'], data['Phi'], nmax=16, deriv=1) fig, axes = plt.subplots(1, 3, figsize=(12, 5)) fig.subplots_adjust( top=0.874, bottom=0.117, left=0.061, right=0.985, hspace=0.2, wspace=0.242 ) fig.suptitle(f'SV components at Niemegk given by {model.name}', fontsize=14) axes[0].plot(cp.data_utils.timestamp(data['Time']), dBr) axes[1].plot(cp.data_utils.timestamp(data['Time']), dBt) axes[2].plot(cp.data_utils.timestamp(data['Time']), dBp) axes[0].set_title('d$B_r$/d$t$') axes[1].set_title('d$B_t$/d$t$') axes[2].set_title('d$B_p$/d$t$') for ax in axes: ax.grid() ax.set_xlabel('Year') ax.set_ylabel('nT/yr') plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.217 seconds) .. _sphx_glr_download_gallery_plot_stations.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_stations.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_stations.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_