Skip to content

Commit 24e2e79

Browse files
committed
Merge branch 'develop' into main
2 parents 68997c0 + 71a5397 commit 24e2e79

File tree

15 files changed

+1573
-43
lines changed

15 files changed

+1573
-43
lines changed

CHANGES.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
# Changelog
22

3+
## 0.5.4 — 6 April 2022
4+
5+
- Fixed small issue with the Klauder wavelet not working when `autocorrelation` was `False`.
6+
- Changed the names of the `convolve` arguments to `arr` and `v` to better match NumPy.
7+
- The version number is now correctly stored in the `__version__` attribute.
8+
- Added a User Guide notebook on [making wavelets](https://code.agilescientific.com/bruges/userguide/Making_wavelets.html).
9+
- Added a User Guide notebook on [seismic attributes](https://code.agilescientific.com/bruges/userguide/Seismic_attributes.html).
10+
311
## 0.5.3 — 21 February 2022
412

5-
- Fixed [issue #92](https://github.com/agile-geoscience/bruges/issues/92): the Ormsby, Ormsby FFT and Klauder wavelets now behave as expected when 2D arrays (lists of frequency parameters, essentially) are passed. A filter bank (array of wavelets) is returned.
6-
- Fixed [issue #93](https://github.com/agile-geoscience/bruges/issues/93): the Sinc, Cosine and Gabor wavelets now behave as expected when `sym` is passed.
13+
- Fixed [issue #92](https://github.com/agilescientific/bruges/issues/92): the Ormsby, Ormsby FFT and Klauder wavelets now behave as expected when 2D arrays (lists of frequency parameters, essentially) are passed. A filter bank (array of wavelets) is returned.
14+
- Fixed [issue #93](https://github.com/agilescientific/bruges/issues/93): the Sinc, Cosine and Gabor wavelets now behave as expected when `sym` is passed.
715
- `reflection.convolve()` now works properly when the axis is specified, and a verbose option was added to show the input and output array shapes (helps with troubleshooting).
816

917
## 0.5.2 — 18 February 2022
@@ -58,7 +66,7 @@
5866
- Moved `rotate_phase()` to `bruges.filters` and it now should handle 2D and 3D seismic correctly. You can also pass an array-like of phases to get a 'phase bank' of rotations, similar to how this works with frequencies and wavelet banks.
5967

6068
## v0.4 — 27 November 2020
61-
- **Breaking change:** fixed numerous minor issues with `attribute.energy()`, see [issue 78](https://github.com/agile-geoscience/bruges/issues/78). Note that it now expects time to be in the last dimension of the array. The function now runs on n-D data and is also about 15 times faster.
69+
- **Breaking change:** fixed numerous minor issues with `attribute.energy()`, see [issue 78](https://github.com/agilescientific/bruges/issues/78). Note that it now expects time to be in the last dimension of the array. The function now runs on n-D data and is also about 15 times faster.
6270
- Multiple fixes to the documentation, thanks especially to Jesper Dramsch and Adriana Gordon.
6371
- Added the `filters.berlage()` wavelet, a causal, minimum phase wavelet good for marine airgun sources.
6472
- Added the `filters.generalized()` wavelet, of which the Ricker is a special case, as defined by Wang 2015, Geophys J Int 203, p1172ff.

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44

55
There are several important ways you can help; here are some examples:
66

7-
- Submitting bug reports and feature requests: see [Issues](https://github.com/agile-geoscience/bruges/issues).
7+
- Submitting bug reports and feature requests: see [Issues](https://github.com/agilescientific/bruges/issues).
88
- Proposing code for bug fixes and new features, then [making a pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests).
99
- Fixing typos and generally improving the documentation.
1010
- Writing tutorials, examples, and how-to documents.
1111

1212

1313
## Code of conduct
1414

15-
We're fortunate to be part of a large professional community that conducts itself with mutual respect and consideration for others. Agile's [Code of Conduct](https://github.com/agile-geoscience/community/blob/main/CODE_OF_CONDUCT.md) is part of protecting these features for everyone, everywhere. Please read it.
15+
We're fortunate to be part of a large professional community that conducts itself with mutual respect and consideration for others. Agile's [Code of Conduct](https://github.com/agilescientific/community/blob/main/CODE_OF_CONDUCT.md) is part of protecting these features for everyone, everywhere. Please read it.
1616

1717

1818
## Authorship
1919

20-
If you contribute a pull request to the project, please add yourself to `AUTHORS.md`.
20+
If you contribute a pull request to the project, please add yourself to `AUTHORS.md`.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
In other words, it's just a load of functions that implement important equations in (mostly seismic) geophysics, from Aki-Richards to Zoeppritz.
66

7-
[![Run tests](https://github.com/agile-geoscience/bruges/actions/workflows/run-tests.yml/badge.svg)](https://github.com/agile-geoscience/bruges/actions/workflows/run-tests.yml)
8-
[![Build docs](https://github.com/agile-geoscience/bruges/actions/workflows/build-docs.yml/badge.svg)](https://github.com/agile-geoscience/bruges/actions/workflows/build-docs.yml)
7+
[![Run tests](https://github.com/agilescientific/bruges/actions/workflows/run-tests.yml/badge.svg)](https://github.com/agilescientific/bruges/actions/workflows/run-tests.yml)
8+
[![Build docs](https://github.com/agilescientific/bruges/actions/workflows/build-docs.yml/badge.svg)](https://github.com/agilescientific/bruges/actions/workflows/build-docs.yml)
99
[![PyPI version](https://img.shields.io/pypi/v/bruges.svg)](https://pypi.python.org/pypi/bruges/)
1010
[![PyPI versions](https://img.shields.io/pypi/pyversions/bruges.svg)](https://pypi.org/project/bruges//)
1111
[![PyPI license](https://img.shields.io/pypi/l/bruges.svg)](https://pypi.org/project/bruges/)
@@ -32,7 +32,7 @@ This produces two arrays: amplitude `w` and time `t`.
3232
## Links
3333

3434
- [Documentation](https://code.agilescientific.com/bruges)
35-
- [Issue Tracker](https://github.com/agile-geoscience/bruges/issues/)
35+
- [Issue Tracker](https://github.com/agilescientific/bruges/issues/)
3636
- [PyPi](http://pypi.python.org/pypi/bruges/)
3737
- [Agile's website](http://www.agilescientific.com)
3838

bruges/__init__.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,17 @@
1717
from .get_bruges import get_bruges
1818
from .bruges import BrugesError
1919

20-
__version__ = "unknown"
20+
from pkg_resources import get_distribution, DistributionNotFound
21+
2122
try:
22-
from ._version import __version__
23-
except ImportError:
24-
pass
23+
VERSION = get_distribution(__name__).version
24+
except DistributionNotFound:
25+
try:
26+
from ._version import version as VERSION
27+
except ImportError:
28+
raise ImportError(
29+
"Failed to find (autogenerated) _version.py. "
30+
"This might be because you are installing from GitHub's tarballs, "
31+
"use the PyPI ones."
32+
)
33+
__version__ = VERSION

bruges/filters/convolve.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,43 +8,43 @@
88
from bruges.util import apply_along_axis
99

1010

11-
def convolve(arr, wavelet, axis=-1, verbose=False):
11+
def convolve(arr, v, axis=-1, verbose=False):
1212
"""
1313
Convolve n-dimensional arr with a 1D wavelet or 2D wavelet bank.
1414
1515
Args:
1616
arr (ndarray): The trace, or 2D section, or volume.
17-
wavelet (ndarray): The wavelet, must be 1D function or a 2D wavelet 'bank'.
17+
v (ndarray): The wavelet, must be 1D function or a 2D wavelet 'bank'.
1818
If a wavelet bank, time should be on the last axis.
1919
axis (int): The time axis of the arr data. In other words, the axis
2020
corresponding to a single 'trace'. If you index into this axis,
2121
you will get a single 'trace'.
2222
verbose (bool): If True, print out the shapes of the inputs and output.
2323
2424
Returns:
25-
ndarray: Discrete, linear convolution of `arr` and `wavelet`.
25+
ndarray: Discrete, linear convolution of `arr` and `v`.
2626
"""
27-
if wavelet.shape[-1] > arr.shape[axis]:
28-
raise TypeError("Wavelet must shorter in time than the arr.")
27+
if v.shape[-1] > arr.shape[axis]:
28+
raise TypeError("v (e.g. wavelet) must be shorter in time than arr (e.g. reflectivity).")
2929

3030
arr_ = np.moveaxis(np.asanyarray(arr), axis, -1)
3131

3232
# Compute the target shape of the final synthetic.
33-
outshape = wavelet.shape[:-1] + arr_.shape
33+
outshape = v.shape[:-1] + arr_.shape
3434

35-
# Force wavelet and arr to both be 2D.
36-
bank = np.atleast_2d(wavelet)
35+
# Force v and arr to both be 2D.
36+
bank = np.atleast_2d(v)
3737
arr_2d = arr_.reshape((-1, arr_.shape[-1]))
3838

3939
# Compute synthetic.
4040
syn = np.array([apply_along_axis(np.convolve, arr_2d, w, mode='same') for w in bank])
4141

42-
pos = axis + wavelet.ndim - 1
42+
pos = axis + v.ndim - 1
4343

4444
out = np.moveaxis(syn.reshape(outshape), -1, pos)
4545

4646
# Show the shapes of the data we're handling.
4747
if verbose:
48-
print(arr.shape, ' * ', wavelet.shape, ' -> ', out.shape)
48+
print(arr.shape, ' * ', v.shape, ' -> ', out.shape)
4949

5050
return out

bruges/filters/wavelets.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,8 @@ def klauder(duration, dt, f,
368368

369369
if autocorrelate:
370370
w = [np.correlate(c_, c_, mode='same') for c_ in c]
371+
else:
372+
w = c
371373

372374
w = np.squeeze(w) / np.amax(w)
373375

37.5 KB
Loading

docs/_userguide/Making_wavelets.ipynb

Lines changed: 815 additions & 0 deletions
Large diffs are not rendered by default.

docs/_userguide/Quick_start_wedge.ipynb

Lines changed: 11 additions & 11 deletions
Large diffs are not rendered by default.

docs/_userguide/Seismic_attributes.ipynb

Lines changed: 603 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)