Metadata-Version: 2.4
Name: spar4das
Version: 0.0.1a1
Summary: An early SPAR4DAS component for computing source amplitude spectra
Author: Mariano Supino
License-Expression: GPL-3.0-only
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy<2,>=1.23
Dynamic: license-file

# SPAR4DAS — early source-spectrum component

SPAR4DAS is developed by Mariano Supino for seismic source parameter
estimation from distributed acoustic sensing (DAS) records. This small alpha
release provides one usable component: the generalized Brune source-spectrum
calculation used by SPAR. The full inversion software is still in development
and is not included in this distribution.

## Install and use

```bash
python -m pip install --pre spar4das
```

```python
import numpy as np
from spar4das import log_moment_spectrum

frequencies_hz = np.array([0.0, 1.0, 4.0, 10.0])
log_amplitude = log_moment_spectrum(
    frequencies_hz, log_m0=12.7, fc_hz=4.0, gamma=2.0, t_star_s=0.02
)
amplitude_nm = 10.0 ** log_amplitude
```

The model returns

```text
log10 A(f) = log10 M0 - log10[1 + (f/fc)^gamma] - pi*f*t_star*log10(e)
```

Here `M0` is seismic moment in N m, `fc` is corner frequency in Hz,
`gamma` is the high-frequency decay exponent, and `t_star` is effective
attenuation time in seconds. For fixed Q it may be specified as travel time
divided by Q, plus any separately justified kappa term. All parameters except
frequency are scalars. Frequencies must be finite and nonnegative; corner
frequency and gamma must be positive; attenuation time must be nonnegative.

This is a moment-equivalent spectral model. It does not convert raw strain or
strain-rate measurements to moment, read waveform files, or estimate parameters.
The alpha API may change as the complete SPAR4DAS package is developed.

## License

GNU General Public License version 3 only; see `LICENSE`.
