Commit cdaf7b7a authored by Stefan Mauerberger's avatar Stefan Mauerberger
Browse files

Merge branch 'master' into FieldTools

parents 9f37cf9e afba915c
# CORBASS # CORBASS
### CORrelation Based Archeomagnetic SnapShot model ### CORrelation Based Archeomagnetic SnapShot model
# License
GNU General Public License, Version 3, 29 June 2007
Copyright (C) 2019 Helmholtz Centre Potsdam GFZ, German Research Centre for Geosciences, Potsdam, Germany
CORBASS is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
CORBASS is distributed in the hope that it will be useful,
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.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
# Citation
> Schanner, Maximilian Arthus and Mauerberger, Stefan (2019)
> CORBASS: CORrelation Based Archeomagnetic SnapShot model. V. 1.0.
> GFZ Data Services. http://doi.org/10.5880/GFZ.2.3.2019.008
[![DOI](https://img.shields.io/badge/DOI-10.5880%2FGFZ.2.3.2019.008-blue.svg)](http://doi.org/10.5880/GFZ.2.3.2019.008)
# Documentation # Documentation
The `CORBASS` model is described in TODO: #12. In a way this The `CORBASS` model is described in TODO: #12. In a way this
repository can be seen as supplementary material to this publication. Below this repository can be seen as supplementary material to this publication. Below this
...@@ -35,18 +60,11 @@ probability mass is concentrated, is found and can be accessed by the ...@@ -35,18 +60,11 @@ probability mass is concentrated, is found and can be accessed by the
`integration` module. The output can then be used to calculate further results, `integration` module. The output can then be used to calculate further results,
using the `evaluation` module. using the `evaluation` module.
If you want to use the individual models, you can find Jupyter notebooks for If you want to use the individual modules, you can find Jupyter notebooks for
each model in the [*examples* section]. each module in the [*examples* section].
[*examples* section]: (examples) [*examples* section]: (examples)
Cite as
> Schanner, M. and Mauerberger, S. (2019)
> CORBASS: CORrelation Based Archeomagnetic SnapShot model. V. 1.0.
> GFZ Data Services. http://doi.org/XXX
TODO: #10
# Installation # Installation
0. Clone the repository 0. Clone the repository
```console ```console
...@@ -61,9 +79,9 @@ TODO: #10 ...@@ -61,9 +79,9 @@ TODO: #10
2. Build and install [FieldTools] 2. Build and install [FieldTools]
1. Install `conda-build` and `numpy` (to base) 1. Install `conda-build` (to base)
```console ```console
$ <conda>/bin/conda install conda-build numpy $ <conda>/bin/conda install conda-build
``` ```
2. Navigate to `<corbass>` and build [FieldTools] 2. Navigate to `<corbass>` and build [FieldTools]
...@@ -100,25 +118,6 @@ TODO: #10 ...@@ -100,25 +118,6 @@ TODO: #10
[FieldTools]: https://gitup.uni-potsdam.de/matusche/fieldtools [FieldTools]: https://gitup.uni-potsdam.de/matusche/fieldtools
# License
GNU General Public License, Version 3, 29 June 2007
Copyright (C) 2019 Maximilian Schanner, GFZ Potsdam
Copyright (C) 2019 Stefan Mauerberger, University of Potsdam
CORBASS is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
CORBASS is distributed in the hope that it will be useful,
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.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
# Contact # Contact
* [Maximilian Schanner](mailto:arthus@gfz-potsdam.de) * [Maximilian Schanner](mailto:arthus@gfz-potsdam.de)
Helmholtz Centre Potsdam German Research Centre for Geoscienes GFZ Helmholtz Centre Potsdam German Research Centre for Geoscienes GFZ
......
""" """
Copyright (C) 2019 Maximilian Schanner, GFZ Potsdam Copyright (C) 2019 Helmholtz Centre Potsdam GFZ,
Copyright (C) 2019 Stefan Mauerberger, University of Potsdam German Research Centre for Geosciences, Potsdam, Germany
Cite as: Cite as:
Schanner, M. and Mauerberger, S. (2019) Schanner, Maximilian Arthus and Mauerberger, Stefan (2019)
CORBASS: CORrelation Based Archeomagnetic SnapShot model. V. 1.0. CORBASS: CORrelation Based Archeomagnetic SnapShot model. V. 1.0.
GFZ Data Services. http://doi.org/XXX TODO XXX GFZ Data Services. http://doi.org/10.5880/GFZ.2.3.2019.008
This file is part of CORBASS. This file is part of CORBASS.
......
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
proxys of these) for quantities of interest, such as the power spectrum, proxys of these) for quantities of interest, such as the power spectrum,
the dipole intensity, the dipole location etc. the dipole intensity, the dipole location etc.
Copyright (C) 2019 Maximilian Schanner, GFZ Potsdam Copyright (C) 2019 Helmholtz Centre Potsdam GFZ,
Copyright (C) 2019 Stefan Mauerberger, University of Potsdam German Research Centre for Geosciences, Potsdam, Germany
Cite as: Cite as:
Schanner, M. and Mauerberger, S. (2019) Schanner, Maximilian Arthus and Mauerberger, Stefan (2019)
CORBASS: CORrelation Based Archeomagnetic SnapShot model. V. 1.0. CORBASS: CORrelation Based Archeomagnetic SnapShot model. V. 1.0.
GFZ Data Services. http://doi.org/XXX TODO XXX GFZ Data Services. http://doi.org/10.5880/GFZ.2.3.2019.008
This file is part of CORBASS. This file is part of CORBASS.
......
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
This module is part of the CORBASS algorithm. It provides a routine for the This module is part of the CORBASS algorithm. It provides a routine for the
first step, the exploration of the parameter space. first step, the exploration of the parameter space.
Copyright (C) 2019 Maximilian Schanner, GFZ Potsdam Copyright (C) 2019 Helmholtz Centre Potsdam GFZ,
Copyright (C) 2019 Stefan Mauerberger, University of Potsdam German Research Centre for Geosciences, Potsdam, Germany
Cite as: Cite as:
Schanner, M. and Mauerberger, S. (2019) Schanner, Maximilian Arthus and Mauerberger, Stefan (2019)
CORBASS: CORrelation Based Archeomagnetic SnapShot model. V. 1.0. CORBASS: CORrelation Based Archeomagnetic SnapShot model. V. 1.0.
GFZ Data Services. http://doi.org/XXX TODO XXX GFZ Data Services. http://doi.org/10.5880/GFZ.2.3.2019.008
This file is part of CORBASS. This file is part of CORBASS.
......
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
assisting routine for finding a region of high probability mass, given assisting routine for finding a region of high probability mass, given
output from the previous exploration step. output from the previous exploration step.
Copyright (C) 2019 Maximilian Schanner, GFZ Potsdam Copyright (C) 2019 Helmholtz Centre Potsdam GFZ,
Copyright (C) 2019 Stefan Mauerberger, University of Potsdam German Research Centre for Geosciences, Potsdam, Germany
Cite as: Cite as:
Schanner, M. and Mauerberger, S. (2019) Schanner, Maximilian Arthus and Mauerberger, Stefan (2019)
CORBASS: CORrelation Based Archeomagnetic SnapShot model. V. 1.0. CORBASS: CORrelation Based Archeomagnetic SnapShot model. V. 1.0.
GFZ Data Services. http://doi.org/XXX TODO XXX GFZ Data Services. http://doi.org/10.5880/GFZ.2.3.2019.008
This file is part of CORBASS. This file is part of CORBASS.
...@@ -352,9 +352,9 @@ def integrate(name, data, N, bounds, r_ref=3200., ...@@ -352,9 +352,9 @@ def integrate(name, data, N, bounds, r_ref=3200.,
mu_f_cmb += res['zf_mean'][1] * weight mu_f_cmb += res['zf_mean'][1] * weight
var_z_cmb += res['zf_var'][0] * weight var_z_cmb += res['zf_var'][0] * weight
var_z_cmb += res['zf_var'][0]**2 * weight var_z_cmb += res['zf_mean'][0]**2 * weight
var_f_cmb += res['zf_var'][1] * weight var_f_cmb += res['zf_var'][1] * weight
var_f_cmb += res['zf_var'][1]**2 * weight var_f_cmb += res['zf_mean'][1]**2 * weight
pbar.update(pbar.value + 1) pbar.update(pbar.value + 1)
# close progressbarr # close progressbarr
......
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
This module is part of the CORBASS algorithm. It can be seen as the core This module is part of the CORBASS algorithm. It can be seen as the core
module, where the actual inversion code is defined. module, where the actual inversion code is defined.
Copyright (C) 2019 Maximilian Schanner, GFZ Potsdam Copyright (C) 2019 Helmholtz Centre Potsdam GFZ,
Copyright (C) 2019 Stefan Mauerberger, University of Potsdam German Research Centre for Geosciences, Potsdam, Germany
Cite as: Cite as:
Schanner, M. and Mauerberger, S. (2019) Schanner, Maximilian Arthus and Mauerberger, Stefan (2019)
CORBASS: CORrelation Based Archeomagnetic SnapShot model. V. 1.0. CORBASS: CORrelation Based Archeomagnetic SnapShot model. V. 1.0.
GFZ Data Services. http://doi.org/XXX TODO XXX GFZ Data Services. http://doi.org/10.5880/GFZ.2.3.2019.008
This file is part of CORBASS. This file is part of CORBASS.
...@@ -1019,11 +1019,6 @@ class Inversion: ...@@ -1019,11 +1019,6 @@ class Inversion:
epsilons = np.dot(jac, jac.T) epsilons = np.dot(jac, jac.T)
"""
lap_appr = np.linalg.inv(np.linalg.multi_dot((jac.T,
np.linalg.inv(errs),
jac)))
"""
trans_grad[3*it:3*it+3, 3*it:3*it+3] = jac trans_grad[3*it:3*it+3, 3*it:3*it+3] = jac
epsilon[3*it:3*it+3, 3*it:3*it+3] = errs epsilon[3*it:3*it+3, 3*it:3*it+3] = errs
rho[3*it:3*it+3, 3*it:3*it+3] = epsilons rho[3*it:3*it+3, 3*it:3*it+3] = epsilons
...@@ -1159,7 +1154,7 @@ if __name__ == '__main__': ...@@ -1159,7 +1154,7 @@ if __name__ == '__main__':
ax[0, 0].set_title('Z @ CMB') ax[0, 0].set_title('Z @ CMB')
ax[1, 0].tripcolor(lat, lon, var_z, ax[1, 0].tripcolor(lat, lon, var_z,
cmap=plt.cm.plasma) cmap=plt.cm.binary)
ax[1, 0].coastlines(zorder=4) ax[1, 0].coastlines(zorder=4)
ax[0, 1].tripcolor(lat, lon, f) ax[0, 1].tripcolor(lat, lon, f)
...@@ -1167,7 +1162,7 @@ if __name__ == '__main__': ...@@ -1167,7 +1162,7 @@ if __name__ == '__main__':
ax[0, 1].set_title('F @ CMB') ax[0, 1].set_title('F @ CMB')
ax[1, 1].tripcolor(lat, lon, var_f, ax[1, 1].tripcolor(lat, lon, var_f,
cmap=plt.cm.plasma) cmap=plt.cm.binary)
ax[1, 1].coastlines(zorder=4) ax[1, 1].coastlines(zorder=4)
plt.show() plt.show()
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
that are used throughut the algorithm, e.g. a routine to load a parameter that are used throughut the algorithm, e.g. a routine to load a parameter
file or scaling routines for coefficicients and covariances. file or scaling routines for coefficicients and covariances.
Copyright (C) 2019 Maximilian Schanner, GFZ Potsdam Copyright (C) 2019 Helmholtz Centre Potsdam GFZ,
Copyright (C) 2019 Stefan Mauerberger, University of Potsdam German Research Centre for Geosciences, Potsdam, Germany
Cite as: Cite as:
Schanner, M. and Mauerberger, S. (2019) Schanner, Maximilian Arthus and Mauerberger, Stefan (2019)
CORBASS: CORrelation Based Archeomagnetic SnapShot model. V. 1.0. CORBASS: CORrelation Based Archeomagnetic SnapShot model. V. 1.0.
GFZ Data Services. http://doi.org/XXX TODO XXX GFZ Data Services. http://doi.org/10.5880/GFZ.2.3.2019.008
This file is part of CORBASS. This file is part of CORBASS.
......
This diff is collapsed.
...@@ -104,14 +104,10 @@ ...@@ -104,14 +104,10 @@
"for it in range(3):\n", "for it in range(3):\n",
" ax[0, it].tripcolor(lat, lon, means[it])\n", " ax[0, it].tripcolor(lat, lon, means[it])\n",
" ax[0, it].coastlines(zorder=4)\n", " ax[0, it].coastlines(zorder=4)\n",
" ax[0, it].set_title(names[it])\n", " ax[0, it].set_title(names[it])\n",
" \n", " \n",
" ax[1, it].tripcolor(lat, lon, np.sqrt(varis[it]),\n",
" cmap='Greys')\n",
" ax[1, it].coastlines(zorder=4)"
]
" ax[1, it].tripcolor(lat, lon, np.sqrt(varis[it]),\n", " ax[1, it].tripcolor(lat, lon, np.sqrt(varis[it]),\n",
" cmap='Greys')\n", " cmap='Greys')\n",
" ax[1, it].coastlines(zorder=4)" " ax[1, it].coastlines(zorder=4)"
] ]
}, },
......
This diff is collapsed.
...@@ -18,55 +18,10 @@ ...@@ -18,55 +18,10 @@
``` python ``` python
run -i run.py examples/Example_Parfile.py run -i run.py examples/Example_Parfile.py
``` ```
%%%% Output: error
---------------------------------------------------------------------------
OutOfDateError Traceback (most recent call last)
~/Documents/CORBASS/run.py in <module>
59 if newer(par_file, expl_fname):
---> 60 raise OutOfDateError
61 # if there is no output or it is out of date, run explore and write the
OutOfDateError:
During handling of the above exception, another exception occurred:
KeyboardInterrupt Traceback (most recent call last)
~/Documents/CORBASS/run.py in <module>
64 print(f"\nExploring {bin_name}, this may take a while...")
65 rslt = explore(pars.bin_fname(bin_name), data, pars.n_ex, pars.bounds,
---> 66 r_ref=pars.r_ref)
67 rslt.write()
68
~/Documents/CORBASS/corbass/exploration.py in explore(name, data, N, bounds, r_ref)
128 # iterate
129 for lam, eps, rho, posterior in it:
--> 130 posterior[...] = inv.log_pst(r_ref, lam, eps, rho)
131
132 pbar.update(pbar.value + 1)
~/Documents/CORBASS/corbass/inversion.py in log_pst(self, r_Ref, lamb, epsilon, rho, log_pri)
899 The log-posterior value for the kernel-parameters.
900 """
--> 901 self._prep_calc(r_Ref, lamb, epsilon, rho)
902 return self._log_pst(lamb, epsilon, rho, log_pri=log_pri)
903
~/Documents/CORBASS/corbass/inversion.py in _prep_calc(self, r_Ref, lamb, epsilon, rho)
227 # Invert covariance using Cholesky
228 self.L = np.linalg.cholesky(self.cov_NEZ_full)
--> 229 self.L_inv = np.linalg.inv(self.L)
230
231 self.prc_NEZ_full = np.dot(self.L_inv.T, self.L_inv)
<__array_function__ internals> in inv(*args, **kwargs)
~/miniconda3/envs/CORBASS/lib/python3.7/site-packages/numpy/linalg/linalg.py in inv(a)
549 signature = 'D->D' if isComplexType(t) else 'd->d'
550 extobj = get_linalg_error_extobj(_raise_linalgerror_singular)
--> 551 ainv = _umath_linalg.inv(a, signature=signature, extobj=extobj)
552 return wrap(ainv.astype(result_t, copy=False))
553
KeyboardInterrupt:
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
Changing to the output directory, we see that the results have been saved to the disk: Changing to the output directory, we see that the results have been saved to the disk:
%% Cell type:code id: tags: %% Cell type:code id: tags:
......
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
This script runs the CORBASS algorithm for a parameter file that is This script runs the CORBASS algorithm for a parameter file that is
passed via the command line. passed via the command line.
Copyright (C) 2019 Maximilian Schanner, GFZ Potsdam Copyright (C) 2019 Helmholtz Centre Potsdam GFZ,
Copyright (C) 2019 Stefan Mauerberger, University of Potsdam German Research Centre for Geosciences, Potsdam, Germany
Cite as: Cite as:
Schanner, M. and Mauerberger, S. (2019) Schanner, Maximilian Arthus and Mauerberger, Stefan (2019)
CORBASS: CORrelation Based Archeomagnetic SnapShot model. V. 1.0. CORBASS: CORrelation Based Archeomagnetic SnapShot model. V. 1.0.
GFZ Data Services. http://doi.org/XXX TODO XXX GFZ Data Services. http://doi.org/10.5880/GFZ.2.3.2019.008
This file is part of CORBASS. This file is part of CORBASS.
......
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