Commit cce95933 authored by Maximilian Schanner's avatar Maximilian Schanner
Browse files
parents 9a34d273 1de79b8e
......@@ -41,7 +41,7 @@ graph LR;
`CORBASS` uses parameter files, which include among other things a link to
datasets, in a format similar to the [GEOMAGIA](http://geomagia.gfz-potsdam.de/)
output. Thus a first step is to create such a file for your data. You can find
an [example](Example_Parfile.py)
an [example](examples/Example_Parfile.py)
in the [*examples* section].
Once you have a parameter file, the recommended way to run `CORBASS` is to use
......@@ -63,7 +63,7 @@ using the `evaluation` module.
If you want to use the individual modules, you can find Jupyter notebooks for
each module in the [*examples* section].
[*examples* section]: (examples)
[*examples* section]: examples
# Installation
0. Clone the repository
......
%% Cell type:markdown id: tags:
# Run
The final example uses `CORBASS` via the `run` module. As stated elsewhere, this is the recommended way, since all modules are run in the right order automatically. Furthermore, checks are applied wether quantities already exist and thus do not have to be evaluated again, to save computation time. If you run this example after having run the other examples, `run` will only calculate the coefficients and save them, since the results from the exploration and integration phase are already available.
Using `run` from within the notebook is slightly different than using a terminal, we hope this is still useful. First we change the directory one level up:
%% Cell type:code id: tags:
``` python
cd ../
```
%% Output
<corbass>/CORBASS
%% Cell type:markdown id: tags:
Then we run `CORBASS` for the example parameter file. From the terminal, we would change `run -i` to `python`.
%% Cell type:code id: tags:
``` python
run -i run.py examples/Example_Parfile.py
```
%% Output
Exploring 1450, this may take a while...
100% (15625 of 15625) |##################| Elapsed Time: 0:22:41 Time: 0:22:41
Integrating 1450, this may take a while...
100% (3375 of 3375) |####################| Elapsed Time: 1:02:05 Time: 1:02:05
<corbass>/CORBASS/corbass/evaluation.py:215: RuntimeWarning: covariance is not positive-semidefinite.
for it in par_samps]
Exploring 1550, this may take a while...
100% (15625 of 15625) |##################| Elapsed Time: 0:29:14 Time: 0:29:14
Integrating 1550, this may take a while...
100% (3375 of 3375) |####################| Elapsed Time: 1:08:58 Time: 1:08:58
%% Cell type:markdown id: tags:
Changing to the output directory, we see that the results have been saved to the disk:
%% Cell type:code id: tags:
``` python
cd out/
```
%% Output
<corbass>/CORBASS/out
%% Cell type:code id: tags:
``` python
ls
```
%% Output
example_1450_cmbfields.txt example_1450_inte.npz example_1550_fields.txt
example_1450_coeffs.txt example_1550_cmbfields.txt example_1550_inte.npz
example_1450_expl.npz example_1550_coeffs.txt
example_1450_fields.txt example_1550_expl.npz
example_1450_cmbfields.txt example_1450_inte.npz example_1550_fields.txt
example_1450_coeffs.txt example_1550_cmbfields.txt example_1550_inte.npz
example_1450_expl.npz example_1550_coeffs.txt
example_1450_fields.txt example_1550_expl.npz
%% Cell type:markdown id: tags:
As an example we show the field output for the interval 1400-1500 A.D.:
%% Cell type:code id: tags:
``` python
%matplotlib inline
import numpy as np
from pandas import read_csv
from matplotlib import pyplot as plt
import cartopy.crs as ccrs
data = read_csv('./example_1450_fields.txt', comment='#', sep=' ')
glob_proj = ccrs.Mollweide(central_longitude=0)
fig, ax = plt.subplots(2, 3, figsize=(13, 5), subplot_kw={'projection': glob_proj})
# get the field locations
lat, lon, _ = glob_proj.transform_points(ccrs.Geodetic(),
data['lon'].to_numpy(),
data['lat'].to_numpy()).T
names = ['N', 'E', 'Z']
for it in range(3):
ax[0, it].tripcolor(lat, lon, data[names[it]].to_numpy())
ax[0, it].coastlines(zorder=4)
ax[0, it].set_title(names[it])
ax[1, it].tripcolor(lat, lon, data['d'+names[it]].to_numpy(),
cmap='Greys')
ax[1, it].coastlines(zorder=4)
```
%% Output
......
......@@ -4,7 +4,7 @@ As stated in the repository's [main readme file](https://gitext.gfz-potsdam.de/a
To demonstrate the `CORBASS` workflow, we provide an [example parameter file](Example_Parfile.py).
The recommended way to evaluate this parameter file is to use
```console
(CORBASS)$ python run.py examples/Example_Parfile.py`.
(CORBASS)$ python run.py examples/Example_Parfile.py
```
Note that this may take a while. We also provide a [notebook](Example_4_Run.ipynb), illustrating this procedure.
......
Supports Markdown
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