-
Notifications
You must be signed in to change notification settings - Fork 224
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
Add a tutorial for grdhisteq #1821
Conversation
region = [-119.825, -119.4, 37.6, 37.825] | ||
|
||
grid = pygmt.datasets.load_earth_relief(resolution="03s", region=region) | ||
grid_dist = pygmt.grd2xyz(grid=grid, outcols=2, output_type="numpy")[:, 0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not directly related to this PR, but running grd2xyz
gives me unexpected output:
>>> pygmt.grd2xyz(grid=grid, outcols=2, output_type="numpy")
array([[1536., nan, nan],
[1539., nan, nan],
[1542., nan, nan],
...,
[2793., nan, nan],
[2800., nan, nan],
[2802., nan, nan]])
So it looks like a bug, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is a PyGMT issue related to how the temp file output is read into a pandas.DataFrame.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two comments here:
pygmt.grd2xyz(grid=grid, outtput_type="pandas")["elevation"]
is more readableShould we limit the use ofoutcols
tooutput_type="file"
only, otherwise we have to parseoutcols
and process the output columns.
Co-authored-by: Dongdong Tian <seisman@users.noreply.github.com>
Co-authored-by: Dongdong Tian <seisman@users.noreply.github.com>
Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com> Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this tutorial Meghan, and happy last day! Hope you get a nice break before starting your next adventure 😃
Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Execpt the two minor changes everything looks great. Thanks for this tutorial @meghanrjones.
Co-authored-by: Michael Grund <23025878+michaelgrund@users.noreply.github.com>
Co-authored-by: Michael Grund <23025878+michaelgrund@users.noreply.github.com>
Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com> Co-authored-by: Dongdong Tian <seisman.info@gmail.com> Co-authored-by: Michael Grund <23025878+michaelgrund@users.noreply.github.com>
Description of proposed changes
This PR adds a tutorial showing how to find data values that divide a grid into equal patches of area and write grids with statistics based on cumulative distribution functions.
Fixes #
Reminders
make format
andmake check
to make sure the code follows the style guide.doc/api/index.rst
.Slash Commands
You can write slash commands (
/command
) in the first line of a comment to performspecific operations. Supported slash commands are:
/format
: automatically format and lint the code/test-gmt-dev
: run full tests on the latest GMT development version