Commit 36cb830c authored by Maximilian Schanner's avatar Maximilian Schanner
Browse files

Doc rework for GUI.

parent 21d1d653
......@@ -55,7 +55,12 @@ $ pip3 install pymagglobal --extra-index-url https://public:5mz_iyigu-WE3HySBH1J
Since [conda](https://docs.conda.io/) version 4.6, conda and pip get along well. So you can also run `pip3 install ...` from inside your conda environment.
## Documentation
Check out the extended documention [here](https://sec23.git-pages.gfz-potsdam.de/korte/pymagglobal). From the command line, you can use `pymagglobal` to get various results from the models. For example,
Check out the extended documention [here](https://sec23.git-pages.gfz-potsdam.de/korte/pymagglobal).
pymagglobal comes with a GUI, that can be started from the command line via
```console
$ pymagglobal-gui
```
You can also use pymagglobal directly from the command line, to get various results from the models. For example,
```console
$ pymagglobal dipole gufm1
```
......@@ -85,26 +90,19 @@ We can first use `built_in_models`, to access a dictionary of available models:
```python
models = built_in_models()
```
Using the function `file2splines` you can get a spline object, representing the model. For example, to get a spline object for gufm1, use
```python
gufm1_splines = pymagglobal.file2splines(models['gufm1'])
```
This object can be evaluated to get the coefficients for a specific epoch
pymagglobal provides a `Model` class. Built-in models can be accessed directly, custom models are set up with a name and a path:
```python
gufm1_1600 = gufm1_splines(1600)
gufm1 = pymagglobal.Model('gufm1')
my_model = pymagglobal.Model('My model', '<path/to/my_model.dat>')
```
or passed to other routines in pymagglobal. For example, to get the dipole series from above use
The model can be passed to routines in pymagglobal. For example, to get the dipole series from above use
```python
import numpy as np
times = np.linspace(1590, 1990, 201)
gufm1_dipoles = pymagglobal.dipole_series(times, gufm1_splines)
```
Additionally, pymagglobal provides a `Model` class, which is set up with a path and a name:
```python
gufm1 = pymagglobal.Model('gufm1', models['gufm1'])
gufm1_dipoles = pymagglobal.dipole_series(times, gufm1)
```
The object now contains several quantities of interest, for example the minimal and maximal time for which the model is valid
Additionally, the object contains several quantities of interest, for example the minimal and maximal time for which the model is valid
```python
>>> gufm1.t_min
1590.0
......
......@@ -4,13 +4,11 @@ A python interface for global geomagnetic field models
`pymagglobal` serves the purpose of replacing some Fortran scripts, which are 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.
.. toctree::
:maxdepth: 2
`pymagglobal` comes with a GUI, that can be started from the command line via
package_documentation
command_line_interface
examples
CHANGELOG
.. code-block:: bash
$ pymagglobal-gui
Installation
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment