Metadata-Version: 2.4
Name: sola-base
Version: 0.1.0
Summary: Multi-purpose modular SOLA tomography package
Author: Franck Latallerie, Christophe Zaroli, Sophie Lambotte, Alessia Maggi, Sixtine Dromigny, Andrew Walker
License-Expression: MIT
Project-URL: Documentation, https://sola-base.readthedocs.io/en/latest/
Project-URL: Repository, https://gitlab.com/FranckLatallerie/sola-base
Project-URL: Issues, https://gitlab.com/FranckLatallerie/sola-base/-/issues
Project-URL: Citation, https://doi.org/10.1093/gji/ggw315
Keywords: tomography,inverse problems,Backus-Gilbert,SOLA,seismology
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=2.4.4
Requires-Dist: pandas>=3.0.3
Requires-Dist: scipy>=1.17.1
Requires-Dist: joblib
Requires-Dist: matplotlib
Provides-Extra: docs
Requires-Dist: sphinx; extra == "docs"
Requires-Dist: myst-parser; extra == "docs"
Requires-Dist: furo; extra == "docs"
Requires-Dist: sphinx-autoapi; extra == "docs"
Provides-Extra: test
Requires-Dist: pytest>=9.0.3; extra == "test"
Dynamic: license-file

# SOLA-base

## Introduction

SOLA-base solves linear inverse problems of the form d = G m + n for given target
resolution, tradeoff parameter, and data uncertainty using the Backus-Gilbert-based
SOLA method. For a given model parameter, it produces model estimate, model uncertainty 
and model resolution. It comes with tools to handle a given parameterisation, 
design target resolution, and to produce some plots.

## Links

- [Documentation](https://sola-base.readthedocs.io/en/latest/)
- [Repository](https://gitlab.com/FranckLatallerie/sola-base)
- [Issues](https://gitlab.com/FranckLatallerie/sola-base/-/issues)

## Installation

```bash
pip install sola-base
```

## Usage

Each routine reads its settings from a parameter file (template below). ksfile is a text file listing the indices of the model parameters to solve for, one per line.

```python
from sola_base.sola_preproc import sola_preproc
from sola_base.sola_lsqr import sola_lsqr
from sola_base.sola_postproc import sola_postproc
from sola_base.sola_ak import sola_ak

sola_preproc( 'path_to_parameterfile')
sola_lsqr( 'path_to_parameterfile', 'path_to_ksfile')
sola_postproc( 'path_to_parameterfile')
sola_ak( 'path_to_parameterfile', 'path_to_ksfile')
```

- `sola_preproc`: From the data, data uncertainty, sensitivity matrix, tradeoff parameter, 
and cell volumes, builds secondary inputs necessary for inversion.
- `sola_lsqr`: For parameters specified by their indices in ksfile, computes the
associated rows of the generalised inverse of G.
- `sola_postproc`: Computes the model estimates and model uncertainty of parameters for which
the generalised inverse rows are available.
- `sola_ak`: For parameters specified by their indices in ksfile, computes the averaging kernels using the associated rows of the generalised inverse of G.

### Parameter file

Folder paths are relative to the directory Python is run from. The grid
sections are only needed by the corresponding grid classes in
`sola_base.parameterizations`.

```ini
# Parameter file for the whole package.
# Parameters required are in the [inversion] section. 
# Parameters for the grid are grid type dependent and only needed for grid classes.

[inversion]
solver = scipy
eta = 100
iters = 100
dumpiter = 50
# LSQR convergence criteria, passed to the scipy solver. Zero disables a
# criterion, so 0/0/0 runs exactly 'iters' iterations.
atol = 0
btol = 0
conlim = 0

[folders]
input=./sola_inputs
output=./sola_outputs

[xy_grid]
xll = 0
yll = 0
xur = 32
yur = 32
xstep = 1
ystep = 1

[latlon_grid]
latstep = 2
lonstep = 2
radius = 6371

[latlonrad_grid]
latstep = 2
lonstep = 2
radstep = 25
radmin  = 3471
radmax  = 6371
```

## Citing and license

- Zaroli 2016, (https://doi.org/10.1093/gji/ggw315)
- A software paper is in preparation and will be added once published.
- License: MIT, see LICENSE
