Closed leouieda closed 4 months ago
The test didn't fail because this one https://github.com/fatiando/harmonica/blob/main/harmonica/tests/test_transformations.py#L246 compares the derivative of the potential with gz which is positive downward. The right thing to do is compare with -gz.
Description of the problem:
The upward derivative returned has an inverted sign. It looks OK when inspecting plots because a lot of us are used to the sign convention of positive downwards. But since we use heights (and thus positive upward), the sign should be the opposite of what we expect. This is meant to improve consistency between small-scale and global data (which often has a "radial" component that is positive upward).
The fix should be relatively simple. Just add a minus sign to https://github.com/fatiando/harmonica/blob/main/harmonica/filters/_filters.py#L63
Full code that generated the error
Full error message
This produces the following result:
If we use positive upward, then the positive parts of the anomaly should be decreasing towards 0 (negative derivative) and the negative parts of the anomaly should be increasing towards 0 (positive derivative).
System information
conda list
below: Not using conda.Output of conda list