Commit 2c9b1262 authored by Maximilian Schanner's avatar Maximilian Schanner Committed by Maximilian Schanner
Browse files

Update README.md [skip ci]

parent 1f4f8a2a
......@@ -26,6 +26,23 @@ Once installed, `pymagglobal` can be imported and its routines used to access th
## Citation
TODO
## Installation
> **Note:** pymagglobal depends on [cartopy](https://scitools.org.uk/cartopy). You have to install it, before running the install command.
> This should also help if you receive `ImportError: NumPy 1.10+ is required to install cartopy.`
`pymagglobal` is distributed via the PyPI registry of this repository. It can be installed using
```console
$ pip install pymagglobal --extra-index-url https://public:5mz_iyigu-WE3HySBH1J@gitext.gfz-potsdam.de/api/v4/projects/1055/packages/pypi/simple
```
Since [conda](https://docs.conda.io/) version 4.6, conda and pip get along well. So you can also run `pip install ...` from inside your conda environment.
Another way to use `pymagglobal` is via nix-shell. With [nix](https://nixos.org/download.html) installed, simply run
```console
$ nix-shell
```
from within the `pymagglobal` root directory. You may also use the nix-expression [pymagglobal.nix] to include `pymagglobal` in your own environments.
## Documentation
Check out the extended documention [here](http://arthus.gitext-pages.gfz-potsdam.de/pymagglobal). From the command line, you can use `pymagglobal` to get various results from the models. For example,
```console
......@@ -53,9 +70,13 @@ When using `python` you can import the pymagglobal package and access the models
```python
import pymagglobal
```
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(pymagglobal.models['gufm1'])
gufm1_splines = pymagglobal.file2splines(models['gufm1'])
```
This object can be evaluated to get the coefficients for a specific epoch
```python
......@@ -70,7 +91,7 @@ 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', pymagglobal.models['gufm1'])
gufm1 = pymagglobal.Model('gufm1', models['gufm1'])
```
The object now contains several quantities of interest, for example the minimal and maximal time for which the model is valid
```python
......@@ -80,21 +101,6 @@ The object now contains several quantities of interest, for example the minimal
1990.0
```
## Installation
> **Note:** pymagglobal depends on [cartopy](https://scitools.org.uk/cartopy). You have to install it, before running the install command.
> This should also help if you receive `ImportError: NumPy 1.10+ is required to install cartopy.`
`pymagglobal` is distributed via the PyPI registry of this repository. It can be installed using
```console
$ pip install pymagglobal --extra-index-url https://public:5mz_iyigu-WE3HySBH1J@gitext.gfz-potsdam.de/api/v4/projects/1055/packages/pypi/simple
```
Another way to use `pymagglobal` is via nix-shell. With [nix](https://nixos.org/download.html) installed, simply run
```console
$ nix-shell
```
from within the `pymagglobal` root directory. You may also use the nix-expression [pymagglobal.nix] to include `pymagglobal` in your own environments.
## Testing
To test your `pymagglobal` installation, run
......
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