Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quickfix min elevation for new SRTM15+V2.1 earth relief grids #401

Merged
merged 1 commit into from
Mar 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pygmt/clib/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class Session:
... )
... # Read the contents of the temp file before it's deleted.
... print(fout.read().strip())
-180 180 -90 90 -8596 5559 1 1 361 181
-180 180 -90 90 -8592 5559 1 1 361 181
"""

# The minimum version of GMT required
Expand Down Expand Up @@ -1218,15 +1218,15 @@ def virtualfile_from_grid(self, grid):
>>> print(data.lat.values.min(), data.lat.values.max())
-90.0 90.0
>>> print(data.values.min(), data.values.max())
-8596.0 5559.0
-8592.0 5559.0
>>> with Session() as ses:
... with ses.virtualfile_from_grid(data) as fin:
... # Send the output to a file so that we can read it
... with GMTTempFile() as fout:
... args = '{} -L0 -Cn ->{}'.format(fin, fout.name)
... ses.call_module('grdinfo', args)
... print(fout.read().strip())
-180 180 -90 90 -8596 5559 1 1 361 181
-180 180 -90 90 -8592 5559 1 1 361 181
>>> # The output is: w e s n z0 z1 dx dy n_columns n_rows

"""
Expand Down
Binary file modified pygmt/tests/baseline/test_grdcontour.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pygmt/tests/baseline/test_grdcontour_file.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pygmt/tests/baseline/test_grdcontour_interval_file_full_opts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pygmt/tests/baseline/test_grdcontour_labels.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pygmt/tests/baseline/test_grdcontour_slice.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pygmt/tests/baseline/test_makecpt_continuous.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pygmt/tests/baseline/test_makecpt_reverse_color_and_zsign.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pygmt/tests/baseline/test_makecpt_reverse_color_only.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pygmt/tests/baseline/test_makecpt_reverse_zsign_only.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pygmt/tests/baseline/test_makecpt_to_plot_grid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pygmt/tests/baseline/test_makecpt_truncated_at_zhigh_only.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pygmt/tests/baseline/test_makecpt_truncated_at_zlow_only.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pygmt/tests/baseline/test_makecpt_truncated_to_zlow_zhigh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions pygmt/tests/test_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def test_earth_relief_60():
assert data.shape == (181, 361)
npt.assert_allclose(data.lat, np.arange(-90, 91, 1))
npt.assert_allclose(data.lon, np.arange(-180, 181, 1))
npt.assert_allclose(data.min(), -8596)
npt.assert_allclose(data.min(), -8592)
npt.assert_allclose(data.max(), 5559)


Expand All @@ -72,5 +72,5 @@ def test_earth_relief_30():
assert data.shape == (361, 721)
npt.assert_allclose(data.lat, np.arange(-90, 90.5, 0.5))
npt.assert_allclose(data.lon, np.arange(-180, 180.5, 0.5))
npt.assert_allclose(data.min(), -9458)
npt.assert_allclose(data.min(), -9460)
npt.assert_allclose(data.max(), 5888)
4 changes: 2 additions & 2 deletions pygmt/tests/test_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ def test_grdinfo():
"Make sure grd info works as expected"
grid = load_earth_relief()
result = grdinfo(grid, L=0, C="n")
assert result.strip() == "-180 180 -90 90 -8596 5559 1 1 361 181"
assert result.strip() == "-180 180 -90 90 -8592 5559 1 1 361 181"


def test_grdinfo_file():
"Test grdinfo with file input"
result = grdinfo("@earth_relief_60m", L=0, C="n")
assert result.strip() == "-180 180 -90 90 -8596 5559 1 1 361 181"
assert result.strip() == "-180 180 -90 90 -8592 5559 1 1 361 181"


def test_grdinfo_fails():
Expand Down