__init__.py 2.33 KB
Newer Older
1
# This file is part of pymagglobal
2
#
3
# Copyright (C) 2020 Helmholtz Centre Potsdam
4
# GFZ German Research Centre for Geosciences, Potsdam, Germany
5
# (https://www.gfz-potsdam.de)
6
#
7
# pymagglobal is free software: you can redistribute it and/or modify
8
# it under the terms of the GNU General Public License as published by
9
10
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
11
#
12
# pymagglobal is distributed in the hope that it will be useful,
13
14
15
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
16
#
17
18
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <https://www.gnu.org/licenses/>.
19

20
21
22
23
24
25
26
'''
=========================================================================
python interface for global geomagnetic field models (:mod:`pymagglobal`)
=========================================================================

.. currentmodule:: pymagglobal

Maximilian Schanner's avatar
Maximilian Schanner committed
27
`pymagglobal` serves the purpose of replacing some Fortran scripts, which are
28
29
30
used in the geomagnetism community to evaluate global field models. It can be
applied to all cubic-spline based geomagnetic field models stored in the same
file format as gufm1 or the CALSxk model series.
31

32
33
34
35
36
The package exposes several methods that can be applied to models or splines
representing a model. To acces the models, use the `Model` class or its
attribute `Model.splines`. With the `models` dictionary, several built-in
models can be accessed, see also the `list of included models
<overview.html#included-models>`__.
Maximilian Schanner's avatar
Maximilian Schanner committed
37
38
'''

39
# expose only utilities and core members
40
__all__ = ['local_curve', 'dipole_series', 'file2splines', 'field',
41
42
           'built_in_models', 'coefficients', 'utils', 'secular_variation',
           'power_spectrum', 'Model']
Maximilian Schanner's avatar
Maximilian Schanner committed
43

44
from pymagglobal.core import local_curve, dipole_series, file2splines, \
45
46
    field, coefficients, secular_variation, power_spectrum, built_in_models, \
    Model
47
from pymagglobal import utils
Maximilian Schanner's avatar
Maximilian Schanner committed
48

49
50
51
52
53
54
55
import warnings

# Monkey-patch the line away from warnings, as it is rather irritating.
formatwarning_orig = warnings.formatwarning
warnings.formatwarning = lambda msg, cat, fname, lineno, line=None: \
    formatwarning_orig(msg, cat, fname, lineno, line='')

Maximilian Schanner's avatar
Maximilian Schanner committed
56
__version__ = '1.0.1'