From 365ea43de064fc1503fa6aa0f4d1659ad3ca2c91 Mon Sep 17 00:00:00 2001 From: Santiago Soler Date: Wed, 20 Oct 2021 11:45:19 -0300 Subject: [PATCH 01/12] Change the shape of the coordinates fixture in tests --- harmonica/tests/test_eq_sources_cartesian.py | 29 +++++++++----------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/harmonica/tests/test_eq_sources_cartesian.py b/harmonica/tests/test_eq_sources_cartesian.py index 3bdd74a76..3049affad 100644 --- a/harmonica/tests/test_eq_sources_cartesian.py +++ b/harmonica/tests/test_eq_sources_cartesian.py @@ -137,31 +137,28 @@ def fixture_coordinates(): Return a set of sample coordinates intended to be used in tests """ region = (-3e3, -1e3, 5e3, 7e3) + shape = (9, 9) # Define a set of observation points with variable elevation coordinates - easting, northing = vd.grid_coordinates(region=region, shape=(8, 8)) - upward = np.arange(64, dtype=float).reshape((8, 8)) + easting, northing = vd.grid_coordinates(region=region, shape=shape) + upward = np.arange(shape[0] * shape[1], dtype=float).reshape(shape) coordinates = (easting, northing, upward) return coordinates -@pytest.mark.parametrize( - "depth_type, upward_expected", - [ - ("relative", np.arange(64, dtype=float).reshape((8, 8)) - 1.5e3), - ("constant", -1.5e3 * np.ones((8, 8))), - ], - ids=["relative", "constant"], -) -def test_equivalent_sources_build_points( - coordinates, - depth_type, - upward_expected, -): +@pytest.mark.parametrize("depth_type", ("relative", "constant")) +def test_equivalent_sources_build_points(coordinates, depth_type): """ Check if build_points method works as expected + + Test only with block-averaging disabled """ - eqs = EquivalentSources(depth=1.5e3, depth_type=depth_type) + depth = 1.5e3 + eqs = EquivalentSources(depth=depth, depth_type=depth_type) points = eqs._build_points(coordinates) + if depth_type == "constant": + upward_expected = -depth * np.ones_like(coordinates[0]) + else: + upward_expected = coordinates[-1] - depth expected = (*coordinates[:2], upward_expected) npt.assert_allclose(points, expected) From 21bd56fe8cd77d6e7582bc41f6bde1920f965516 Mon Sep 17 00:00:00 2001 From: Santiago Soler Date: Wed, 20 Oct 2021 11:59:36 -0300 Subject: [PATCH 02/12] Add Soler2021 to references --- doc/references.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/references.rst b/doc/references.rst index 9b1b9badf..a5df54f8a 100644 --- a/doc/references.rst +++ b/doc/references.rst @@ -12,5 +12,6 @@ References .. [Hofmann-WellenhofMoritz2006] Hofmann-Wellenhof, B., & Moritz, H. (2006). Physical Geodesy (2nd, corr. ed. 2006 edition ed.). Wien ; New York: Springer. .. [Nagy2000] Nagy, D., Papp, G. & Benedek, J.(2000). The gravitational potential and its derivatives for the prism. Journal of Geodesy 74: 552. doi:`10.1007/s001900000116 `__ .. [Nagy2002] Nagy, D., Papp, G. & Benedek, J.(2002). Corrections to "The gravitational potential and its derivatives for the prism". Journal of Geodesy. doi:`10.1007/s00190-002-0264-7 `__ +.. [Soler2021] Soler, S. R. and Uieda, L. (2021). Gradient-boosted equivalent sources, Geophysical Journal International. doi:`10.1093/gji/ggab297 `__ .. [Vajda2004] Vajda, P., Vaníček, P., Novák, P. and Meurers, B. (2004). On evaluation of Newton integrals in geodetic coordinates: Exact formulation and spherical approximation. Contributions to Geophysics and Geodesy, 34(4), 289-314. .. [TurcotteSchubert2014] Turcotte, D. L., & Schubert, G. (2014). Geodynamics (3 edition). Cambridge, United Kingdom: Cambridge University Press. From 0e18676c872515224d8a89228cfe2afbc1d6fd51 Mon Sep 17 00:00:00 2001 From: Santiago Soler Date: Wed, 20 Oct 2021 11:59:49 -0300 Subject: [PATCH 03/12] Add example for block-averaged equivalent sources --- .../block_averaged_sources.py | 124 ++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 examples/equivalent_sources/block_averaged_sources.py diff --git a/examples/equivalent_sources/block_averaged_sources.py b/examples/equivalent_sources/block_averaged_sources.py new file mode 100644 index 000000000..02f79374f --- /dev/null +++ b/examples/equivalent_sources/block_averaged_sources.py @@ -0,0 +1,124 @@ +# Copyright (c) 2018 The Harmonica Developers. +# Distributed under the terms of the BSD 3-Clause License. +# SPDX-License-Identifier: BSD-3-Clause +# +# This code is part of the Fatiando a Terra project (https://www.fatiando.org) +# +""" +Gridding with block-averaged equivalent sources +=============================================== + +By default, the ``EquivalentSources`` class locates one point source beneath +each data point during the fitting process. Alternatively, we can use another +strategy: the `block-averaged sources`, introduced in [Soler2021]_. + +This method divides the survey region (defined by the data) into square blocks +of equal size, computes the median coordinates of the data points that fall +inside each block and locates one source beneath every averaged position. This +way, we define one equivalent source per block, with the exception of empty +blocks that won't get any source. + +This method has two main benefits: + +- It lowers the amount of sources involved in the interpolation, therefore it +reduces the computer memory requirements and the computation time of the +fitting and prediction processes. +- It might avoid to produce aliasing on the output grids, specially for +anisotropic surveys, like airborne ones. + +We can make use of the block-averaged sources within the ``EquivalentSources`` +class by passing a value to the ``block_size`` parameter, which controls the +size of the blocks. We recommend using a ``block_size`` not larger than the +desired resolution of the interpolation grid. + +The depth of the sources can be set analogously to the regular equivalent +sources: we can use a ``constant`` depth (every source is located at the same +depth) or a ``relative`` depth (where each source is located at a constant +shift beneath the median location obtained during the block-averaging process). +The depth of the sources and which strategy to use can be set up through the +``depth`` and the ``depth_type`` parameters, respectively. +""" +import matplotlib.pyplot as plt +import numpy as np +import pyproj +import verde as vd +import harmonica as hm + + +# Fetch the sample total-field magnetic anomaly data from Great Britain +data = hm.datasets.fetch_britain_magnetic() + +# Slice a smaller portion of the survey data to speed-up calculations for this +# example +region = [-5.5, -4.7, 57.8, 58.5] +inside = vd.inside((data.longitude, data.latitude), region) +data = data[inside] +print("Number of data points:", data.shape[0]) +print("Mean height of observations:", data.altitude_m.mean()) + +# Since this is a small area, we'll project our data and use Cartesian +# coordinates +projection = pyproj.Proj(proj="merc", lat_ts=data.latitude.mean()) +easting, northing = projection(data.longitude.values, data.latitude.values) +coordinates = (easting, northing, data.altitude_m) + +# Create the equivalent sources. +# We'll use block-averaged sources at a constant depth beneath the observation +# points. We will interpolate on a grid with a resolution of 500m, so we will +# use blocks of the same size. The damping parameter helps smooth the predicted +# data and ensure stability. +eqs = hm.EquivalentSources(depth=1000, damping=1, block_size=500, depth_type="constant") + +# Fit the sources coefficients to the observed magnetic anomaly. +eqs.fit(coordinates, data.total_field_anomaly_nt) + +# Evaluate the data fit by calculating an R² score against the observed data. +# This is a measure of how well the sources fit the data, NOT how good the +# interpolation will be. +print("R² score:", eqs.score(coordinates, data.total_field_anomaly_nt)) + +# Interpolate data on a regular grid with 500 m spacing. The interpolation +# requires the height of the grid points (upward coordinate). By passing in +# 1500 m, we're effectively upward-continuing the data (mean flight height is +# 500 m). +grid = eqs.grid(upward=1500, spacing=500, data_names=["magnetic_anomaly"]) + +# The grid is a xarray.Dataset with values, coordinates, and metadata +print("\nGenerated grid:\n", grid) + +# Plot original magnetic anomaly and the gridded and upward-continued version +fig, (ax1, ax2) = plt.subplots(nrows=1, ncols=2, figsize=(12, 9), sharey=True) + +# Get the maximum absolute value between the original and gridded data so we +# can use the same color scale for both plots and have 0 centered at the white +# color. +maxabs = vd.maxabs(data.total_field_anomaly_nt, grid.magnetic_anomaly.values) + +ax1.set_title("Observed magnetic anomaly data") +tmp = ax1.scatter( + easting, + northing, + c=data.total_field_anomaly_nt, + s=20, + vmin=-maxabs, + vmax=maxabs, + cmap="seismic", +) +plt.colorbar(tmp, ax=ax1, label="nT", pad=0.05, aspect=40, orientation="horizontal") +ax1.set_xlim(easting.min(), easting.max()) +ax1.set_ylim(northing.min(), northing.max()) + +ax2.set_title("Gridded and upward-continued") +tmp = grid.magnetic_anomaly.plot.pcolormesh( + ax=ax2, + add_colorbar=False, + add_labels=False, + vmin=-maxabs, + vmax=maxabs, + cmap="seismic", +) +plt.colorbar(tmp, ax=ax2, label="nT", pad=0.05, aspect=40, orientation="horizontal") +ax2.set_xlim(easting.min(), easting.max()) +ax2.set_ylim(northing.min(), northing.max()) + +plt.show() From de731bcd6c0f16b44f0dde9d57711c1ef55bb8c5 Mon Sep 17 00:00:00 2001 From: Santiago Soler Date: Wed, 20 Oct 2021 12:00:07 -0300 Subject: [PATCH 04/12] Implement block-averages sources in EquivalentSources --- harmonica/equivalent_sources/cartesian.py | 54 ++++++++++++++++++++--- 1 file changed, 49 insertions(+), 5 deletions(-) diff --git a/harmonica/equivalent_sources/cartesian.py b/harmonica/equivalent_sources/cartesian.py index ab238b47d..fa8f40967 100644 --- a/harmonica/equivalent_sources/cartesian.py +++ b/harmonica/equivalent_sources/cartesian.py @@ -96,6 +96,14 @@ class EquivalentSources(vdb.BaseGridder): The two available strategies are ``"constant"`` and ``"relative"``. This parameter is ignored if *points* is specified. Defaults to ``"relative"``. + block_size: float, tuple = (s_north, s_east) or None + Size of the blocks used on block-averaged equivalent sources. + If a single value is passed, the blocks will have a square shape. + Alternatively, the dimensions of the blocks in the South-North and + West-East directions can be specified by passing a tuple. + If None, no block-averaging is applied. + This parameter is ignored if *points* are specified. + Default to None. parallel : bool If True any predictions and Jacobian building is carried out in parallel through Numba's ``jit.prange``, reducing the computation time. @@ -111,6 +119,10 @@ class EquivalentSources(vdb.BaseGridder): The boundaries (``[W, E, S, N]``) of the data used to fit the interpolator. Used as the default region for the :meth:`~harmonica.EQLHarmonic.grid` method. + + References + ---------- + [Soler2021]_ """ # Set the default dimension names for generated outputs @@ -130,6 +142,7 @@ def __init__( points=None, depth=500, depth_type="relative", + block_size=None, parallel=True, **kwargs, ): @@ -137,6 +150,7 @@ def __init__( self.points = points self.depth = depth self.depth_type = depth_type + self.block_size = block_size self.parallel = parallel # Define Green's function for Cartesian coordinates self.greens_function = greens_func_cartesian @@ -198,13 +212,14 @@ def _build_points(self, coordinates): """ Generate coordinates of point sources based on the data points - Locate the point sources following the chosen ``depth_type`` strategy. + Locate the point sources following the chosen ``depth_type`` strategy + and apply block-averaging if ``block_size`` is not None. If ``depth_type`` is equal to ``"relative"``, the point sources will be - placed beneath the observation points at a depth calculated as the - elevation of the data point minus the ``depth``. + placed beneath the (averaged) observation points at a depth calculated + as the elevation of the data point minus the ``depth``. If ``depth_type`` is equal to ``"constant"``, the point sources will be - placed beneath the observation points at the same height equal to minus - ``depth``. + placed beneath the (averaged) observation points at the same height + equal to minus ``depth``. Parameters ---------- @@ -220,6 +235,8 @@ def _build_points(self, coordinates): Tuple containing the coordinates of the equivalent point sources, in the following order: (``easting``, ``northing``, ``upward``). """ + if self.block_size is not None: + coordinates = self._block_average_coordinates(coordinates) if self.depth_type == "relative": return ( coordinates[0], @@ -234,6 +251,33 @@ def _build_points(self, coordinates): ) return None + def _block_average_coordinates(self, coordinates): + """ + Run a block-averaging process on observation points + + Apply a median as the reduction function. The blocks will have the size + specified through the ``block_size`` argument on the constructor. + + Parameters + ---------- + coordinates : tuple of arrays + Arrays with the coordinates of each data point. Should be in the + following order: (``easting``, ``northing``, ``upward``, ...). + + Returns + ------- + blocked_coords : tuple of arrays + Tuple containing the coordinates of the block-averaged observation + points. + """ + reducer = vd.BlockReduce( + spacing=self.block_size, reduction=np.median, drop_coords=False + ) + # Must pass a dummy data array to BlockReduce.filter(), we choose an + # array full of zeros. We will ignore the returned reduced dummy array. + blocked_coords, _ = reducer.filter(coordinates, np.zeros_like(coordinates[0])) + return blocked_coords + def predict(self, coordinates): """ Evaluate the estimated equivalent sources on the given set of points. From 8c8c7690d3d9182960e978ba6e5996b24eb0a212 Mon Sep 17 00:00:00 2001 From: Santiago Soler Date: Wed, 20 Oct 2021 12:00:22 -0300 Subject: [PATCH 05/12] Add test functions for the new feature --- harmonica/tests/test_eq_sources_cartesian.py | 45 ++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/harmonica/tests/test_eq_sources_cartesian.py b/harmonica/tests/test_eq_sources_cartesian.py index 3049affad..0d7e388a4 100644 --- a/harmonica/tests/test_eq_sources_cartesian.py +++ b/harmonica/tests/test_eq_sources_cartesian.py @@ -8,6 +8,7 @@ """ Test the EquivalentSources gridder """ +from collections.abc import Iterable import warnings import pytest import numpy as np @@ -187,6 +188,50 @@ def test_equivalent_sources_build_points_bacwkards(coordinates): npt.assert_allclose(points, expected) +@pytest.mark.parametrize( + "block_size", (750, (750, 1e3)), ids=["block_size as float", "block_size as tuple"] +) +def test_block_averaging_coordinates(coordinates, block_size): + """ + Test the _block_averaging_coordinates method + """ + depth = 1.5e3 + eqs = EquivalentSources(depth=depth, block_size=block_size) + if isinstance(block_size, Iterable): + expected = ( + [-2500.0, -1375.0, -2500.0, -1375.0, -2500.0, -1375.0], + [5250.0, 5250.0, 6000.0, 6000.0, 6750.0, 6750.0], + [11.0, 15.5, 38.0, 42.5, 65.0, 69.5], + ) + else: + expected = ( + [-2750, -2000, -1250, -2750, -2000, -1250, -2750, -2000, -1250], + [5250, 5250, 5250, 6000, 6000, 6000, 6750, 6750, 6750], + [10.0, 13.0, 16.0, 37.0, 40.0, 43.0, 64.0, 67.0, 70.0], + ) + npt.assert_allclose(expected, eqs._block_average_coordinates(coordinates)) + + +@pytest.mark.parametrize("depth_type", ("constant", "relative")) +def test_build_points_block_average(coordinates, depth_type): + """ + Test the _build_points method with block-averaging + """ + depth = 1.5e3 + block_size = 750 + eqs = EquivalentSources(depth=depth, depth_type=depth_type, block_size=block_size) + expected = [ + np.array([-2750, -2000, -1250, -2750, -2000, -1250, -2750, -2000, -1250]), + np.array([5250, 5250, 5250, 6000, 6000, 6000, 6750, 6750, 6750]), + np.array([10.0, 13.0, 16.0, 37.0, 40.0, 43.0, 64.0, 67.0, 70.0]), + ] + if depth_type == "relative": + expected[-1] -= depth + if depth_type == "constant": + expected[-1] = np.zeros_like(expected[0]) - depth + npt.assert_allclose(expected, eqs._build_points(coordinates)) + + def test_equivalent_sources_invalid_depth_type(): """ Check if ValueError is raised if invalid depth_type is passed From 0bb9a8f30374650b6fcb308caa9cbf4872b6a172 Mon Sep 17 00:00:00 2001 From: Santiago Soler Date: Wed, 27 Oct 2021 09:54:30 -0300 Subject: [PATCH 06/12] Improve text in the example Add missing :class: directive. Fix itemization format. Replace "anisotropic" for "oversampled in one direction". --- .../block_averaged_sources.py | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/examples/equivalent_sources/block_averaged_sources.py b/examples/equivalent_sources/block_averaged_sources.py index 02f79374f..a7797bedb 100644 --- a/examples/equivalent_sources/block_averaged_sources.py +++ b/examples/equivalent_sources/block_averaged_sources.py @@ -8,9 +8,10 @@ Gridding with block-averaged equivalent sources =============================================== -By default, the ``EquivalentSources`` class locates one point source beneath -each data point during the fitting process. Alternatively, we can use another -strategy: the `block-averaged sources`, introduced in [Soler2021]_. +By default, the :class:`harmonica.EquivalentSources` class locates one point +source beneath each data point during the fitting process. Alternatively, we +can use another strategy: the `block-averaged sources`, introduced in +[Soler2021]_. This method divides the survey region (defined by the data) into square blocks of equal size, computes the median coordinates of the data points that fall @@ -21,15 +22,16 @@ This method has two main benefits: - It lowers the amount of sources involved in the interpolation, therefore it -reduces the computer memory requirements and the computation time of the -fitting and prediction processes. + reduces the computer memory requirements and the computation time of the + fitting and prediction processes. - It might avoid to produce aliasing on the output grids, specially for -anisotropic surveys, like airborne ones. + surveys with oversampling along a particular direction, like airborne ones. -We can make use of the block-averaged sources within the ``EquivalentSources`` -class by passing a value to the ``block_size`` parameter, which controls the -size of the blocks. We recommend using a ``block_size`` not larger than the -desired resolution of the interpolation grid. +We can make use of the block-averaged sources within the +:class:`harmonica.EquivalentSources` class by passing a value to the +``block_size`` parameter, which controls the size of the blocks. We recommend +using a ``block_size`` not larger than the desired resolution of the +interpolation grid. The depth of the sources can be set analogously to the regular equivalent sources: we can use a ``constant`` depth (every source is located at the same From 86ed37da5cb16fc7e67ebaacb74712f2339a6c64 Mon Sep 17 00:00:00 2001 From: Santiago Soler Date: Wed, 27 Oct 2021 10:30:38 -0300 Subject: [PATCH 07/12] Improve docstring of EquivalentSources --- harmonica/equivalent_sources/cartesian.py | 53 +++++++++++++++-------- 1 file changed, 36 insertions(+), 17 deletions(-) diff --git a/harmonica/equivalent_sources/cartesian.py b/harmonica/equivalent_sources/cartesian.py index fa8f40967..c5892d0f1 100644 --- a/harmonica/equivalent_sources/cartesian.py +++ b/harmonica/equivalent_sources/cartesian.py @@ -46,14 +46,39 @@ class EquivalentSources(vdb.BaseGridder): * Reduction to the pole of magnetic total field anomaly data * Analytical derivative calculations - Point sources are located beneath the observed potential-field measurement - points by default [Cooper2000]_. Custom source locations can be used by - specifying the *points* argument. Coefficients associated with each point - source are estimated through linear least-squares with damping (Tikhonov - 0th order) regularization. + By default, the point sources are located beneath the observed + potential-field measurement points [Cooper2000]_ that are passed as + arguments to the :meth:`EquivalentSources.fit` method, producing the same + number of sources as data points. + Alternatively, we can reduce the number of sources by using block-averaged + sources [Soler2021]_: we divide the data region in blocks of equal size and + compute the median location of the observations points that fall under each + block. Then, we locate one point source beneath each one of these + locations. The size of the blocks, that indirectly controls how many + sources will be created, can be specified through the ``block_size`` + argument. + We recommend choosing a ``block_size`` no larger than the resolution of the + grid where interpolations will be carried out. + + The depth of the sources can be controlled by the ``depth`` argument. + If ``depth_type`` is set to ``"relative"``, then each source is located + beneath each data point or block-averaged location at a depth equal to its + elevation minus the value of the ``depth`` argument. + If ``depth_type`` is set to ``"constant"``, then every source is located at + a constant depth given by the ``depth`` argument. + In both cases a positive value of ``depth`` locates sources _beneath_ the + data points or the block-averaged locations, thus a negative ``depth`` will + put the sources _above_ them. + + Custom source locations can be chosen by specifying the ``points`` + argument, in which case the ``depth_type``, ``bloc_size`` and ``depth`` + arguments will be ignored. + + The corresponding coefficient for each point source is estimated through + linear least-squares with damping (Tikhonov 0th order) regularization. The Green's function for point mass effects used is the inverse Euclidean - distance between the grid coordinates and the point source: + distance between the observation points and the point sources: .. math:: @@ -78,17 +103,11 @@ class EquivalentSources(vdb.BaseGridder): depth : float Parameter used to control the depth at which the point sources will be located. - If ``depth_type`` is equal to ``"relative"``, the ``depth`` specifies - the relative depth at which the point sources are placed beneath the - observation points. Each source point will be set beneath each data - point at a depth calculated as the elevation of the data point minus - this *depth*. Use positive numbers (negative numbers would mean point - sources are above the data points). - If ``depth_type`` is equal to ``"constant"``, the ``depth`` specifies - the constant depth at which the point sources are placed beneath the - observation points. Every source point will be located at this *depth*. - Use positive numbers (negative numbers would mean point sources are - located above the zeroth level). + If ``depth_type`` is ``"constant"``, each source is located at the same + depth specified through the ``depth`` argument. + If ``depth_type`` is ``"relative"``, each source is located beneath + each data point (or block-averaged location) at a depth equal to its + elevation minus the ``depth`` value. This parameter is ignored if *points* is specified. Defaults to 500. depth_type : str From f9a3d1ca847ae8274312b26daf3b0e7ee003371f Mon Sep 17 00:00:00 2001 From: Santiago Soler Date: Wed, 27 Oct 2021 10:44:51 -0300 Subject: [PATCH 08/12] Add citation instructions for Soler2021 paper --- CITATION.rst | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/CITATION.rst b/CITATION.rst index 9d57935d2..476408a55 100644 --- a/CITATION.rst +++ b/CITATION.rst @@ -4,8 +4,42 @@ Citing Harmonica This is research software **made by scientists**. Citations help us justify the effort that goes into building and maintaining this project. +Citing the software +------------------- + If you used this software in your research, please consider citing the following source: https://doi.org/10.5281/zenodo.3628741 The link above includes full citation information and export formats (BibTeX, Mendeley, etc). + +Citing methods +-------------- + +Harmonica offers implementations of some methods that have been published in +scientific journals. We appreciate citations of these publications as well in +case you made use of them. + +If you used the **block-averaged sources** available in the +:class:`harmonica.EquivalentSources`, please cite [Soler2021]_ as: + + Soler, S.R. and Uieda, L. (2021). Gradient-boosted equivalent sources. + Geophysical Journal International. + doi:`10.1093/gji/ggab297 `__ + +Here is a BibTeX entry for LaTeX users:: + + @article{soler2021, + doi = {10.1093/gji/ggab297}, + url = {https://doi.org/10.1093/gji/ggab297}, + year = {2021}, + month = aug, + publisher = {Oxford University Press ({OUP})}, + volume = {227}, + number = {3}, + pages = {1768--1783}, + author = {Soler, Santiago R. and Uieda, Leonardo}, + title = {Gradient-boosted equivalent sources} + } + + From 0f9d0ecfe0ffabb0968d1f87f8fdd85661f437ef Mon Sep 17 00:00:00 2001 From: Santiago Soler Date: Wed, 27 Oct 2021 10:50:21 -0300 Subject: [PATCH 09/12] Small edit --- CITATION.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CITATION.rst b/CITATION.rst index 476408a55..86aa391c6 100644 --- a/CITATION.rst +++ b/CITATION.rst @@ -13,8 +13,8 @@ citing the following source: https://doi.org/10.5281/zenodo.3628741 The link above includes full citation information and export formats (BibTeX, Mendeley, etc). -Citing methods --------------- +Citing the methods +------------------ Harmonica offers implementations of some methods that have been published in scientific journals. We appreciate citations of these publications as well in From 094affab90b410520a2c77b5622b49905a33a27b Mon Sep 17 00:00:00 2001 From: Santiago Soler Date: Wed, 27 Oct 2021 12:49:49 -0300 Subject: [PATCH 10/12] Shorten citation instruction for Soler2021 Remove the BibTeX entry Co-authored-by: Leonardo Uieda --- CITATION.rst | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/CITATION.rst b/CITATION.rst index 86aa391c6..2d69158e4 100644 --- a/CITATION.rst +++ b/CITATION.rst @@ -20,26 +20,4 @@ Harmonica offers implementations of some methods that have been published in scientific journals. We appreciate citations of these publications as well in case you made use of them. -If you used the **block-averaged sources** available in the -:class:`harmonica.EquivalentSources`, please cite [Soler2021]_ as: - - Soler, S.R. and Uieda, L. (2021). Gradient-boosted equivalent sources. - Geophysical Journal International. - doi:`10.1093/gji/ggab297 `__ - -Here is a BibTeX entry for LaTeX users:: - - @article{soler2021, - doi = {10.1093/gji/ggab297}, - url = {https://doi.org/10.1093/gji/ggab297}, - year = {2021}, - month = aug, - publisher = {Oxford University Press ({OUP})}, - volume = {227}, - number = {3}, - pages = {1768--1783}, - author = {Soler, Santiago R. and Uieda, Leonardo}, - title = {Gradient-boosted equivalent sources} - } - - +* :class:`harmonica.EquivalentSources` with ``block_size`` set (block averaged sources): Soler and Uieda (2021) https://doi.org/10.1093/gji/ggab297 From bdf2a424d5eee74aef98459473e35bfb2b3a883e Mon Sep 17 00:00:00 2001 From: Santiago Soler Date: Wed, 27 Oct 2021 12:56:52 -0300 Subject: [PATCH 11/12] Replace backticks with starts for setting italics --- examples/equivalent_sources/block_averaged_sources.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/equivalent_sources/block_averaged_sources.py b/examples/equivalent_sources/block_averaged_sources.py index a7797bedb..38cc59d00 100644 --- a/examples/equivalent_sources/block_averaged_sources.py +++ b/examples/equivalent_sources/block_averaged_sources.py @@ -10,7 +10,7 @@ By default, the :class:`harmonica.EquivalentSources` class locates one point source beneath each data point during the fitting process. Alternatively, we -can use another strategy: the `block-averaged sources`, introduced in +can use another strategy: the *block-averaged sources*, introduced in [Soler2021]_. This method divides the survey region (defined by the data) into square blocks From a41faeb7bdd103a0175a268046d6f8049180d3db Mon Sep 17 00:00:00 2001 From: Santiago Soler Date: Wed, 27 Oct 2021 12:59:26 -0300 Subject: [PATCH 12/12] Improve citation of Soler and Uieda 2021 in CITATION.rst --- CITATION.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CITATION.rst b/CITATION.rst index 2d69158e4..d6bcf6a56 100644 --- a/CITATION.rst +++ b/CITATION.rst @@ -20,4 +20,8 @@ Harmonica offers implementations of some methods that have been published in scientific journals. We appreciate citations of these publications as well in case you made use of them. -* :class:`harmonica.EquivalentSources` with ``block_size`` set (block averaged sources): Soler and Uieda (2021) https://doi.org/10.1093/gji/ggab297 +* :class:`harmonica.EquivalentSources` with ``block_size`` set (block-averaged + sources): + + Soler, S. R. and Uieda, L. (2021). Gradient-boosted equivalent sources, Geophysical Journal International. + doi:`10.1093/gji/ggab297 `__